From 352159138ee768a1b3387cf043663b18f0e1e293 Mon Sep 17 00:00:00 2001 From: Roberto Raggi Date: Thu, 9 Apr 2009 16:31:17 +0200 Subject: Initial work on the qfx front-end. --- src/declarative/qml/parser/javascript.g | 2265 ++++++++++++++++++++ src/declarative/qml/parser/javascriptast.cpp | 878 ++++++++ src/declarative/qml/parser/javascriptast_p.h | 1756 +++++++++++++++ src/declarative/qml/parser/javascriptastfwd_p.h | 160 ++ .../qml/parser/javascriptastvisitor.cpp | 58 + .../qml/parser/javascriptastvisitor_p.h | 317 +++ src/declarative/qml/parser/javascriptengine_p.cpp | 157 ++ src/declarative/qml/parser/javascriptengine_p.h | 144 ++ src/declarative/qml/parser/javascriptgrammar.cpp | 623 ++++++ src/declarative/qml/parser/javascriptgrammar_p.h | 144 ++ src/declarative/qml/parser/javascriptlexer.cpp | 1124 ++++++++++ src/declarative/qml/parser/javascriptlexer_p.h | 250 +++ .../qml/parser/javascriptmemorypool_p.h | 130 ++ src/declarative/qml/parser/javascriptnodepool_p.h | 139 ++ src/declarative/qml/parser/javascriptparser.cpp | 1207 +++++++++++ src/declarative/qml/parser/javascriptparser_p.h | 212 ++ .../qml/parser/javascriptprettypretty.cpp | 1334 ++++++++++++ .../qml/parser/javascriptprettypretty_p.h | 329 +++ src/declarative/qml/parser/javascriptvalue.h | 6 + src/declarative/qml/parser/parser.pri | 21 + src/declarative/qml/qml.pri | 7 + src/declarative/qml/qmlcompiler.cpp | 2 + src/declarative/qml/qmlcompiler_p.h | 1 + src/declarative/qml/qmlcomponent.cpp | 1 + src/declarative/qml/qmldom.cpp | 8 +- 25 files changed, 11272 insertions(+), 1 deletion(-) create mode 100644 src/declarative/qml/parser/javascript.g create mode 100644 src/declarative/qml/parser/javascriptast.cpp create mode 100644 src/declarative/qml/parser/javascriptast_p.h create mode 100644 src/declarative/qml/parser/javascriptastfwd_p.h create mode 100644 src/declarative/qml/parser/javascriptastvisitor.cpp create mode 100644 src/declarative/qml/parser/javascriptastvisitor_p.h create mode 100644 src/declarative/qml/parser/javascriptengine_p.cpp create mode 100644 src/declarative/qml/parser/javascriptengine_p.h create mode 100644 src/declarative/qml/parser/javascriptgrammar.cpp create mode 100644 src/declarative/qml/parser/javascriptgrammar_p.h create mode 100644 src/declarative/qml/parser/javascriptlexer.cpp create mode 100644 src/declarative/qml/parser/javascriptlexer_p.h create mode 100644 src/declarative/qml/parser/javascriptmemorypool_p.h create mode 100644 src/declarative/qml/parser/javascriptnodepool_p.h create mode 100644 src/declarative/qml/parser/javascriptparser.cpp create mode 100644 src/declarative/qml/parser/javascriptparser_p.h create mode 100644 src/declarative/qml/parser/javascriptprettypretty.cpp create mode 100644 src/declarative/qml/parser/javascriptprettypretty_p.h create mode 100644 src/declarative/qml/parser/javascriptvalue.h create mode 100644 src/declarative/qml/parser/parser.pri diff --git a/src/declarative/qml/parser/javascript.g b/src/declarative/qml/parser/javascript.g new file mode 100644 index 0000000..24467dd --- /dev/null +++ b/src/declarative/qml/parser/javascript.g @@ -0,0 +1,2265 @@ +---------------------------------------------------------------------------- +-- +-- Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +-- Contact: Qt Software Information (qt-info@nokia.com) +-- +-- This file is part of the QtScript 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$ +-- +-- This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +-- WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +-- +---------------------------------------------------------------------------- + +%parser JavaScriptGrammar +%decl javascriptparser_p.h +%impl javascriptparser.cpp +%expect 3 +%expect-rr 1 + +%token T_AND "&" T_AND_AND "&&" T_AND_EQ "&=" +%token T_BREAK "break" T_CASE "case" T_CATCH "catch" +%token T_COLON ":" T_COMMA ";" T_CONTINUE "continue" +%token T_DEFAULT "default" T_DELETE "delete" T_DIVIDE_ "/" +%token T_DIVIDE_EQ "/=" T_DO "do" T_DOT "." +%token T_ELSE "else" T_EQ "=" T_EQ_EQ "==" +%token T_EQ_EQ_EQ "===" T_FINALLY "finally" T_FOR "for" +%token T_FUNCTION "function" T_GE ">=" T_GT ">" +%token T_GT_GT ">>" T_GT_GT_EQ ">>=" T_GT_GT_GT ">>>" +%token T_GT_GT_GT_EQ ">>>=" T_IDENTIFIER "identifier" T_IF "if" +%token T_IN "in" T_INSTANCEOF "instanceof" T_LBRACE "{" +%token T_LBRACKET "[" T_LE "<=" T_LPAREN "(" +%token T_LT "<" T_LT_LT "<<" T_LT_LT_EQ "<<=" +%token T_MINUS "-" T_MINUS_EQ "-=" T_MINUS_MINUS "--" +%token T_NEW "new" T_NOT "!" T_NOT_EQ "!=" +%token T_NOT_EQ_EQ "!==" T_NUMERIC_LITERAL "numeric literal" T_OR "|" +%token T_OR_EQ "|=" T_OR_OR "||" T_PLUS "+" +%token T_PLUS_EQ "+=" T_PLUS_PLUS "++" T_QUESTION "?" +%token T_RBRACE "}" T_RBRACKET "]" T_REMAINDER "%" +%token T_REMAINDER_EQ "%=" T_RETURN "return" T_RPAREN ")" +%token T_SEMICOLON ";" T_AUTOMATIC_SEMICOLON T_STAR "*" +%token T_STAR_EQ "*=" T_STRING_LITERAL "string literal" +%token T_SWITCH "switch" T_THIS "this" T_THROW "throw" +%token T_TILDE "~" T_TRY "try" T_TYPEOF "typeof" +%token T_VAR "var" T_VOID "void" T_WHILE "while" +%token T_WITH "with" T_XOR "^" T_XOR_EQ "^=" +%token T_NULL "null" T_TRUE "true" T_FALSE "false" +%token T_CONST "const" +%token T_DEBUGGER "debugger" +%token T_RESERVED_WORD "reserved word" + +--- context keywords. +%token T_PUBLIC "public" + +%nonassoc SHIFT_THERE +%nonassoc T_IDENTIFIER T_COLON +%nonassoc REDUCE_HERE + +%start Program + +/. +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtScript 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 + +#include + +#include "javascriptengine_p.h" +#include "javascriptlexer_p.h" +#include "javascriptast_p.h" +#include "javascriptnodepool_p.h" + +./ + +/: +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtScript 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 purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +// +// This file is automatically generated from javascript.g. +// Changes will be lost. +// + +#ifndef JAVASCRIPTPARSER_P_H +#define JAVASCRIPTPARSER_P_H + +#include "javascriptgrammar_p.h" +#include "javascriptast_p.h" +#include + +QT_BEGIN_NAMESPACE + +class QString; +class JavaScriptEnginePrivate; +class JavaScriptNameIdImpl; + +class JavaScriptParser: protected $table +{ +public: + union Value { + int ival; + double dval; + JavaScriptNameIdImpl *sval; + JavaScript::AST::ArgumentList *ArgumentList; + JavaScript::AST::CaseBlock *CaseBlock; + JavaScript::AST::CaseClause *CaseClause; + JavaScript::AST::CaseClauses *CaseClauses; + JavaScript::AST::Catch *Catch; + JavaScript::AST::DefaultClause *DefaultClause; + JavaScript::AST::ElementList *ElementList; + JavaScript::AST::Elision *Elision; + JavaScript::AST::ExpressionNode *Expression; + JavaScript::AST::Finally *Finally; + JavaScript::AST::FormalParameterList *FormalParameterList; + JavaScript::AST::FunctionBody *FunctionBody; + JavaScript::AST::FunctionDeclaration *FunctionDeclaration; + JavaScript::AST::Node *Node; + JavaScript::AST::PropertyName *PropertyName; + JavaScript::AST::PropertyNameAndValueList *PropertyNameAndValueList; + JavaScript::AST::SourceElement *SourceElement; + JavaScript::AST::SourceElements *SourceElements; + JavaScript::AST::Statement *Statement; + JavaScript::AST::StatementList *StatementList; + JavaScript::AST::VariableDeclaration *VariableDeclaration; + JavaScript::AST::VariableDeclarationList *VariableDeclarationList; + + JavaScript::AST::UiProgram *UiProgram; + JavaScript::AST::UiPublicMember *UiPublicMember; + JavaScript::AST::UiObjectDefinition *UiObjectDefinition; + JavaScript::AST::UiObjectInitializer *UiObjectInitializer; + JavaScript::AST::UiObjectBinding *UiObjectBinding; + JavaScript::AST::UiScriptBinding *UiScriptBinding; + JavaScript::AST::UiArrayBinding *UiArrayBinding; + JavaScript::AST::UiObjectMember *UiObjectMember; + JavaScript::AST::UiObjectMemberList *UiObjectMemberList; + JavaScript::AST::UiQualifiedId *UiQualifiedId; + }; + + struct DiagnosticMessage { + enum Kind { Warning, Error }; + + DiagnosticMessage() + : kind(Error), line(0), column(0) {} + + DiagnosticMessage(Kind kind, int line, int column, const QString &message) + : kind(kind), line(line), column(column), message(message) {} + + bool isWarning() const + { return kind == Warning; } + + bool isError() const + { return kind == Error; } + + Kind kind; + int line; + int column; + QString message; + }; + +public: + JavaScriptParser(); + ~JavaScriptParser(); + + bool parse(JavaScriptEnginePrivate *driver); + + JavaScript::AST::UiProgram *ast() + { return sym(1).UiProgram; } + + QList diagnosticMessages() const + { return diagnostic_messages; } + + inline DiagnosticMessage diagnosticMessage() const + { + foreach (const DiagnosticMessage &d, diagnostic_messages) { + if (! d.kind == DiagnosticMessage::Warning) + return d; + } + + return DiagnosticMessage(); + } + + inline QString errorMessage() const + { return diagnosticMessage().message; } + + inline int errorLineNumber() const + { return diagnosticMessage().line; } + + inline int errorColumnNumber() const + { return diagnosticMessage().column; } + +protected: + void reallocateStack(); + + inline Value &sym(int index) + { return sym_stack [tos + index - 1]; } + + inline JavaScript::AST::SourceLocation &loc(int index) + { return location_stack [tos + index - 1]; } + +protected: + int tos; + int stack_size; + Value *sym_stack; + int *state_stack; + JavaScript::AST::SourceLocation *location_stack; + + // error recovery + enum { TOKEN_BUFFER_SIZE = 3 }; + + struct SavedToken { + int token; + double dval; + JavaScript::AST::SourceLocation loc; + }; + + double yylval; + JavaScript::AST::SourceLocation yylloc; + JavaScript::AST::SourceLocation yyprevlloc; + + SavedToken token_buffer[TOKEN_BUFFER_SIZE]; + SavedToken *first_token; + SavedToken *last_token; + + QList diagnostic_messages; +}; + +:/ + + +/. + +#include "javascriptparser_p.h" + +// +// This file is automatically generated from javascript.g. +// Changes will be lost. +// + +using namespace JavaScript; + +QT_BEGIN_NAMESPACE + +void JavaScriptParser::reallocateStack() +{ + if (! stack_size) + stack_size = 128; + else + stack_size <<= 1; + + sym_stack = reinterpret_cast (qRealloc(sym_stack, stack_size * sizeof(Value))); + state_stack = reinterpret_cast (qRealloc(state_stack, stack_size * sizeof(int))); + location_stack = reinterpret_cast (qRealloc(location_stack, stack_size * sizeof(AST::SourceLocation))); +} + +inline static bool automatic(JavaScriptEnginePrivate *driver, int token) +{ + return token == $table::T_RBRACE + || token == 0 + || driver->lexer()->prevTerminator(); +} + + +JavaScriptParser::JavaScriptParser(): + tos(0), + stack_size(0), + sym_stack(0), + state_stack(0), + location_stack(0), + first_token(0), + last_token(0) +{ +} + +JavaScriptParser::~JavaScriptParser() +{ + if (stack_size) { + qFree(sym_stack); + qFree(state_stack); + qFree(location_stack); + } +} + +static inline AST::SourceLocation location(Lexer *lexer) +{ + AST::SourceLocation loc; + loc.offset = lexer->tokenOffset(); + loc.length = lexer->tokenLength(); + loc.startLine = lexer->startLineNo(); + loc.startColumn = lexer->startColumnNo(); + return loc; +} + +bool JavaScriptParser::parse(JavaScriptEnginePrivate *driver) +{ + Lexer *lexer = driver->lexer(); + bool hadErrors = false; + int yytoken = -1; + int action = 0; + + first_token = last_token = 0; + + tos = -1; + + do { + if (++tos == stack_size) + reallocateStack(); + + state_stack[tos] = action; + + _Lcheck_token: + if (yytoken == -1 && -TERMINAL_COUNT != action_index[action]) { + yyprevlloc = yylloc; + + if (first_token == last_token) { + yytoken = lexer->lex(); + yylval = lexer->dval(); + yylloc = location(lexer); + } else { + yytoken = first_token->token; + yylval = first_token->dval; + yylloc = first_token->loc; + ++first_token; + } + } + + action = t_action(action, yytoken); + if (action > 0) { + if (action != ACCEPT_STATE) { + yytoken = -1; + sym(1).dval = yylval; + loc(1) = yylloc; + } else { + --tos; + return ! hadErrors; + } + } else if (action < 0) { + const int r = -action - 1; + tos -= rhs[r]; + + switch (r) { +./ + +-------------------------------------------------------------------------------------------------------- +-- Declarative UI +-------------------------------------------------------------------------------------------------------- +Program: UiObjectMemberList ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).UiObjectMemberList->finish()); +} break; +./ + +Empty: ; + +UiObjectMemberList: UiObjectMember ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).UiObjectMember); +} break; +./ + +UiObjectMemberList: UiObjectMemberList Empty UiObjectMember ; +/.case $rule_number:./ +UiObjectMemberList: UiObjectMemberList T_COMMA UiObjectMember ; +/. +case $rule_number: { + AST::UiObjectMemberList *node = makeAstNode (driver->nodePool(), + sym(1).UiObjectMemberList, sym(3).UiObjectMember); + sym(1).Node = node; +} break; +./ + +UiObjectInitializer: T_LBRACE UiObjectMemberList T_RBRACE ; +/. +case $rule_number: { + AST::UiObjectInitializer *node = makeAstNode (driver->nodePool(), sym(2).UiObjectMemberList->finish()); + node->lbraceToken = loc(1); + node->rbraceToken = loc(3); + sym(1).Node = node; +} break; +./ + +UiObjectMember: UiQualifiedId T_COLON T_IDENTIFIER UiObjectInitializer ; +/. +case $rule_number: { + AST::UiObjectBinding *node = makeAstNode (driver->nodePool(), sym(1).UiQualifiedId->finish(), + sym(3).sval, sym(4).UiObjectInitializer); + node->colonToken = loc(2); + node->identifierToken = loc(3); + sym(1).Node = node; +} break; +./ + +UiObjectMember: T_IDENTIFIER UiObjectInitializer ; +/. +case $rule_number: { + AST::UiObjectDefinition *node = makeAstNode (driver->nodePool(), sym(1).sval, + sym(2).UiObjectInitializer); + node->identifierToken = loc(1); + sym(1).Node = node; +} break; +./ + +UiObjectMember: UiQualifiedId T_COLON T_LBRACKET UiObjectMemberList T_RBRACKET ; +/. +case $rule_number: { + AST::UiArrayBinding *node = makeAstNode (driver->nodePool(), sym(1).UiQualifiedId->finish(), + sym(4).UiObjectMemberList->finish()); + node->colonToken = loc(2); + node->lbracketToken = loc(3); + node->rbraceToken = loc(5); + sym(1).Node = node; +} break; +./ + +UiObjectMember: UiQualifiedId T_COLON Statement ; +/. +case $rule_number: { + AST::UiScriptBinding *node = makeAstNode (driver->nodePool(), sym(1).UiQualifiedId->finish(), + sym(3).Statement); + node->colonToken = loc(2); + sym(1).Node = node; +} break; +./ + +UiObjectMember: T_PUBLIC T_IDENTIFIER T_IDENTIFIER T_COLON Expression UiObjectInitializer ; +/. +case $rule_number: { + AST::UiPublicMember *node = makeAstNode (driver->nodePool(), sym(2).sval, sym(3).sval, + sym(5).Expression, sym(6).UiObjectInitializer); + node->publicToken = loc(1); + node->attributeTypeToken = loc(2); + node->identifierToken = loc(3); + node->colonToken = loc(4); + sym(1).Node = node; +} break; +./ + +UiObjectMember: T_PUBLIC T_IDENTIFIER T_IDENTIFIER ; +/. +case $rule_number: { + AST::UiPublicMember *node = makeAstNode (driver->nodePool(), sym(2).sval, sym(3).sval); + node->publicToken = loc(1); + node->attributeTypeToken = loc(2); + node->identifierToken = loc(3); + sym(1).Node = node; +} break; +./ + +UiObjectMember: T_PUBLIC T_IDENTIFIER T_IDENTIFIER T_COLON Expression ; +/. +case $rule_number: { + AST::UiPublicMember *node = makeAstNode (driver->nodePool(), sym(2).sval, sym(3).sval, + sym(5).Expression, static_cast(0)); + node->publicToken = loc(1); + node->attributeTypeToken = loc(2); + node->identifierToken = loc(3); + node->colonToken = loc(4); + sym(1).Node = node; +} break; +./ + + +UiQualifiedId: T_IDENTIFIER ; +/. +case $rule_number: { + AST::UiQualifiedId *node = makeAstNode (driver->nodePool(), sym(1).sval); + node->identifierToken = loc(1); + sym(1).Node = node; +} break; +./ + +UiQualifiedId: UiQualifiedId T_DOT T_IDENTIFIER ; +/. +case $rule_number: + AST::UiQualifiedId *node = makeAstNode (driver->nodePool(), sym(1).UiQualifiedId, sym(3).sval); + node->identifierToken = loc(3); + sym(1).Node = node; + break; +./ + + +-------------------------------------------------------------------------------------------------------- +-- Expressions +-------------------------------------------------------------------------------------------------------- +PrimaryExpression: T_THIS ; +/. +case $rule_number: { + AST::ThisExpression *node = makeAstNode (driver->nodePool()); + node->thisToken = loc(1); + sym(1).Node = node; +} break; +./ + +PrimaryExpression: T_IDENTIFIER ; +/. +case $rule_number: { + AST::IdentifierExpression *node = makeAstNode (driver->nodePool(), sym(1).sval); + node->identifierToken = loc(1); + sym(1).Node = node; +} break; +./ + +PrimaryExpression: T_NULL ; +/. +case $rule_number: { + AST::NullExpression *node = makeAstNode (driver->nodePool()); + node->nullToken = loc(1); + sym(1).Node = node; +} break; +./ + +PrimaryExpression: T_TRUE ; +/. +case $rule_number: { + AST::TrueLiteral *node = makeAstNode (driver->nodePool()); + node->trueToken = loc(1); + sym(1).Node = node; +} break; +./ + +PrimaryExpression: T_FALSE ; +/. +case $rule_number: { + AST::FalseLiteral *node = makeAstNode (driver->nodePool()); + node->falseToken = loc(1); + sym(1).Node = node; +} break; +./ + +PrimaryExpression: T_NUMERIC_LITERAL ; +/. +case $rule_number: { + AST::NumericLiteral *node = makeAstNode (driver->nodePool(), sym(1).dval); + node->literalToken = loc(1); + sym(1).Node = node; +} break; +./ + +PrimaryExpression: T_STRING_LITERAL ; +/. +case $rule_number: { + AST::StringLiteral *node = makeAstNode (driver->nodePool(), sym(1).sval); + node->literalToken = loc(1); + sym(1).Node = node; +} break; +./ + +PrimaryExpression: T_DIVIDE_ ; +/: +#define J_SCRIPT_REGEXPLITERAL_RULE1 $rule_number +:/ +/. +case $rule_number: { + bool rx = lexer->scanRegExp(Lexer::NoPrefix); + if (!rx) { + diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, lexer->startLineNo(), + lexer->startColumnNo(), lexer->errorMessage())); + return false; + } + AST::RegExpLiteral *node = makeAstNode (driver->nodePool(), lexer->pattern, lexer->flags); + node->literalToken = loc(1); + sym(1).Node = node; +} break; +./ + +PrimaryExpression: T_DIVIDE_EQ ; +/: +#define J_SCRIPT_REGEXPLITERAL_RULE2 $rule_number +:/ +/. +case $rule_number: { + bool rx = lexer->scanRegExp(Lexer::EqualPrefix); + if (!rx) { + diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, lexer->startLineNo(), + lexer->startColumnNo(), lexer->errorMessage())); + return false; + } + AST::RegExpLiteral *node = makeAstNode (driver->nodePool(), lexer->pattern, lexer->flags); + node->literalToken = loc(1); + sym(1).Node = node; +} break; +./ + +PrimaryExpression: T_LBRACKET ElisionOpt T_RBRACKET ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Elision); +} break; +./ + +PrimaryExpression: T_LBRACKET ElementList T_RBRACKET ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(2).ElementList->finish ()); +} break; +./ + +PrimaryExpression: T_LBRACKET ElementList T_COMMA ElisionOpt T_RBRACKET ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(2).ElementList->finish (), sym(4).Elision); +} break; +./ + +-- PrimaryExpression: T_LBRACE T_RBRACE ; +-- /. +-- case $rule_number: { +-- sym(1).Node = makeAstNode (driver->nodePool()); +-- } break; +-- ./ + +PrimaryExpression: T_LBRACE PropertyNameAndValueListOpt T_RBRACE ; +/. +case $rule_number: { + if (sym(2).Node) + sym(1).Node = makeAstNode (driver->nodePool(), sym(2).PropertyNameAndValueList->finish ()); + else + sym(1).Node = makeAstNode (driver->nodePool()); +} break; +./ + +PrimaryExpression: T_LBRACE PropertyNameAndValueList T_COMMA T_RBRACE ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(2).PropertyNameAndValueList->finish ()); +} break; +./ + +PrimaryExpression: T_LPAREN Expression T_RPAREN ; +/. +case $rule_number: { + sym(1) = sym(2); +} break; +./ + +ElementList: ElisionOpt AssignmentExpression ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Elision, sym(2).Expression); +} break; +./ + +ElementList: ElementList T_COMMA ElisionOpt AssignmentExpression ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).ElementList, sym(3).Elision, sym(4).Expression); +} break; +./ + +Elision: T_COMMA ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool()); +} break; +./ + +Elision: Elision T_COMMA ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Elision); +} break; +./ + +ElisionOpt: %prec SHIFT_THERE ; +/. +case $rule_number: { + sym(1).Node = 0; +} break; +./ + +ElisionOpt: Elision ; +/. +case $rule_number: { + sym(1).Elision = sym(1).Elision->finish (); +} break; +./ + +PropertyNameAndValueList: PropertyName T_COLON AssignmentExpression ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).PropertyName, sym(3).Expression); +} break; +./ + +PropertyNameAndValueList: PropertyNameAndValueList T_COMMA PropertyName T_COLON AssignmentExpression ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).PropertyNameAndValueList, sym(3).PropertyName, sym(5).Expression); +} break; +./ + +PropertyName: T_IDENTIFIER %prec REDUCE_HERE ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).sval); +} break; +./ + +PropertyName: T_STRING_LITERAL ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).sval); +} break; +./ + +PropertyName: T_NUMERIC_LITERAL ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).dval); +} break; +./ + +PropertyName: ReservedIdentifier ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).sval); +} break; +./ + +ReservedIdentifier: T_BREAK ; +/. +case $rule_number: +./ +ReservedIdentifier: T_CASE ; +/. +case $rule_number: +./ +ReservedIdentifier: T_CATCH ; +/. +case $rule_number: +./ +ReservedIdentifier: T_CONTINUE ; +/. +case $rule_number: +./ +ReservedIdentifier: T_DEFAULT ; +/. +case $rule_number: +./ +ReservedIdentifier: T_DELETE ; +/. +case $rule_number: +./ +ReservedIdentifier: T_DO ; +/. +case $rule_number: +./ +ReservedIdentifier: T_ELSE ; +/. +case $rule_number: +./ +ReservedIdentifier: T_FALSE ; +/. +case $rule_number: +./ +ReservedIdentifier: T_FINALLY ; +/. +case $rule_number: +./ +ReservedIdentifier: T_FOR ; +/. +case $rule_number: +./ +ReservedIdentifier: T_FUNCTION ; +/. +case $rule_number: +./ +ReservedIdentifier: T_IF ; +/. +case $rule_number: +./ +ReservedIdentifier: T_IN ; +/. +case $rule_number: +./ +ReservedIdentifier: T_INSTANCEOF ; +/. +case $rule_number: +./ +ReservedIdentifier: T_NEW ; +/. +case $rule_number: +./ +ReservedIdentifier: T_NULL ; +/. +case $rule_number: +./ +ReservedIdentifier: T_RETURN ; +/. +case $rule_number: +./ +ReservedIdentifier: T_SWITCH ; +/. +case $rule_number: +./ +ReservedIdentifier: T_THIS ; +/. +case $rule_number: +./ +ReservedIdentifier: T_THROW ; +/. +case $rule_number: +./ +ReservedIdentifier: T_TRUE ; +/. +case $rule_number: +./ +ReservedIdentifier: T_TRY ; +/. +case $rule_number: +./ +ReservedIdentifier: T_TYPEOF ; +/. +case $rule_number: +./ +ReservedIdentifier: T_VAR ; +/. +case $rule_number: +./ +ReservedIdentifier: T_VOID ; +/. +case $rule_number: +./ +ReservedIdentifier: T_WHILE ; +/. +case $rule_number: +./ +ReservedIdentifier: T_CONST ; +/. +case $rule_number: +./ +ReservedIdentifier: T_DEBUGGER ; +/. +case $rule_number: +./ +ReservedIdentifier: T_RESERVED_WORD ; +/. +case $rule_number: +./ +ReservedIdentifier: T_WITH ; +/. +case $rule_number: +{ + sym(1).sval = driver->intern(lexer->characterBuffer(), lexer->characterCount()); +} break; +./ + +PropertyIdentifier: T_IDENTIFIER ; +PropertyIdentifier: ReservedIdentifier ; + +MemberExpression: PrimaryExpression ; +MemberExpression: FunctionExpression ; + +MemberExpression: MemberExpression T_LBRACKET Expression T_RBRACKET ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression); +} break; +./ + +MemberExpression: MemberExpression T_DOT PropertyIdentifier ; +/. +case $rule_number: { + AST::FieldMemberExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).sval); + node->dotToken = loc(2); + node->identifierToken = loc(3); + sym(1).Node = node; +} break; +./ + +MemberExpression: T_NEW MemberExpression T_LPAREN ArgumentListOpt T_RPAREN ; +/. +case $rule_number: { + AST::NewMemberExpression *node = makeAstNode (driver->nodePool(), sym(2).Expression, sym(4).ArgumentList); + node->newToken = loc(1); + node->lparenToken = loc(3); + node->rparenToken = loc(5); + sym(1).Node = node; +} break; +./ + +NewExpression: MemberExpression ; + +NewExpression: T_NEW NewExpression ; +/. +case $rule_number: { + AST::NewExpression *node = makeAstNode (driver->nodePool(), sym(2).Expression); + node->newToken = loc(1); + sym(1).Node = node; +} break; +./ + +CallExpression: MemberExpression T_LPAREN ArgumentListOpt T_RPAREN ; +/. +case $rule_number: { + AST::CallExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).ArgumentList); + node->lparenToken = loc(2); + node->rparenToken = loc(4); + sym(1).Node = node; +} break; +./ + +CallExpression: CallExpression T_LPAREN ArgumentListOpt T_RPAREN ; +/. +case $rule_number: { + AST::CallExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).ArgumentList); + node->lparenToken = loc(2); + node->rparenToken = loc(4); + sym(1).Node = node; +} break; +./ + +CallExpression: CallExpression T_LBRACKET Expression T_RBRACKET ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression); +} break; +./ + +CallExpression: CallExpression T_DOT PropertyIdentifier ; +/. +case $rule_number: { + AST::FieldMemberExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).sval); + node->dotToken = loc(2); + node->identifierToken = loc(3); + sym(1).Node = node; +} break; +./ + +ArgumentListOpt: ; +/. +case $rule_number: { + sym(1).Node = 0; +} break; +./ + +ArgumentListOpt: ArgumentList ; +/. +case $rule_number: { + sym(1).Node = sym(1).ArgumentList->finish(); +} break; +./ + +ArgumentList: AssignmentExpression ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression); +} break; +./ + +ArgumentList: ArgumentList T_COMMA AssignmentExpression ; +/. +case $rule_number: { + AST::ArgumentList *node = makeAstNode (driver->nodePool(), sym(1).ArgumentList, sym(3).Expression); + node->commaToken = loc(2); + sym(1).Node = node; +} break; +./ + +LeftHandSideExpression: NewExpression ; +LeftHandSideExpression: CallExpression ; +PostfixExpression: LeftHandSideExpression ; + +PostfixExpression: LeftHandSideExpression T_PLUS_PLUS ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression); +} break; +./ + +PostfixExpression: LeftHandSideExpression T_MINUS_MINUS ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression); +} break; +./ + +UnaryExpression: PostfixExpression ; + +UnaryExpression: T_DELETE UnaryExpression ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); +} break; +./ + +UnaryExpression: T_VOID UnaryExpression ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); +} break; +./ + +UnaryExpression: T_TYPEOF UnaryExpression ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); +} break; +./ + +UnaryExpression: T_PLUS_PLUS UnaryExpression ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); +} break; +./ + +UnaryExpression: T_MINUS_MINUS UnaryExpression ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); +} break; +./ + +UnaryExpression: T_PLUS UnaryExpression ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); +} break; +./ + +UnaryExpression: T_MINUS UnaryExpression ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); +} break; +./ + +UnaryExpression: T_TILDE UnaryExpression ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); +} break; +./ + +UnaryExpression: T_NOT UnaryExpression ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); +} break; +./ + +MultiplicativeExpression: UnaryExpression ; + +MultiplicativeExpression: MultiplicativeExpression T_STAR UnaryExpression ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Mul, sym(3).Expression); +} break; +./ + +MultiplicativeExpression: MultiplicativeExpression T_DIVIDE_ UnaryExpression ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Div, sym(3).Expression); +} break; +./ + +MultiplicativeExpression: MultiplicativeExpression T_REMAINDER UnaryExpression ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Mod, sym(3).Expression); +} break; +./ + +AdditiveExpression: MultiplicativeExpression ; + +AdditiveExpression: AdditiveExpression T_PLUS MultiplicativeExpression ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Add, sym(3).Expression); +} break; +./ + +AdditiveExpression: AdditiveExpression T_MINUS MultiplicativeExpression ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Sub, sym(3).Expression); +} break; +./ + +ShiftExpression: AdditiveExpression ; + +ShiftExpression: ShiftExpression T_LT_LT AdditiveExpression ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::LShift, sym(3).Expression); +} break; +./ + +ShiftExpression: ShiftExpression T_GT_GT AdditiveExpression ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::RShift, sym(3).Expression); +} break; +./ + +ShiftExpression: ShiftExpression T_GT_GT_GT AdditiveExpression ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::URShift, sym(3).Expression); +} break; +./ + +RelationalExpression: ShiftExpression ; + +RelationalExpression: RelationalExpression T_LT ShiftExpression ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Lt, sym(3).Expression); +} break; +./ + +RelationalExpression: RelationalExpression T_GT ShiftExpression ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Gt, sym(3).Expression); +} break; +./ + +RelationalExpression: RelationalExpression T_LE ShiftExpression ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Le, sym(3).Expression); +} break; +./ + +RelationalExpression: RelationalExpression T_GE ShiftExpression ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Ge, sym(3).Expression); +} break; +./ + +RelationalExpression: RelationalExpression T_INSTANCEOF ShiftExpression ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::InstanceOf, sym(3).Expression); +} break; +./ + +RelationalExpression: RelationalExpression T_IN ShiftExpression ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::In, sym(3).Expression); +} break; +./ + +RelationalExpressionNotIn: ShiftExpression ; + +RelationalExpressionNotIn: RelationalExpressionNotIn T_LT ShiftExpression ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Lt, sym(3).Expression); +} break; +./ + +RelationalExpressionNotIn: RelationalExpressionNotIn T_GT ShiftExpression ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Gt, sym(3).Expression); +} break; +./ + +RelationalExpressionNotIn: RelationalExpressionNotIn T_LE ShiftExpression ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Le, sym(3).Expression); +} break; +./ + +RelationalExpressionNotIn: RelationalExpressionNotIn T_GE ShiftExpression ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Ge, sym(3).Expression); +} break; +./ + +RelationalExpressionNotIn: RelationalExpressionNotIn T_INSTANCEOF ShiftExpression ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::InstanceOf, sym(3).Expression); +} break; +./ + +EqualityExpression: RelationalExpression ; + +EqualityExpression: EqualityExpression T_EQ_EQ RelationalExpression ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Equal, sym(3).Expression); +} break; +./ + +EqualityExpression: EqualityExpression T_NOT_EQ RelationalExpression ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::NotEqual, sym(3).Expression); +} break; +./ + +EqualityExpression: EqualityExpression T_EQ_EQ_EQ RelationalExpression ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::StrictEqual, sym(3).Expression); +} break; +./ + +EqualityExpression: EqualityExpression T_NOT_EQ_EQ RelationalExpression ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::StrictNotEqual, sym(3).Expression); +} break; +./ + +EqualityExpressionNotIn: RelationalExpressionNotIn ; + +EqualityExpressionNotIn: EqualityExpressionNotIn T_EQ_EQ RelationalExpressionNotIn ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Equal, sym(3).Expression); +} break; +./ + +EqualityExpressionNotIn: EqualityExpressionNotIn T_NOT_EQ RelationalExpressionNotIn; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::NotEqual, sym(3).Expression); +} break; +./ + +EqualityExpressionNotIn: EqualityExpressionNotIn T_EQ_EQ_EQ RelationalExpressionNotIn ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::StrictEqual, sym(3).Expression); +} break; +./ + +EqualityExpressionNotIn: EqualityExpressionNotIn T_NOT_EQ_EQ RelationalExpressionNotIn ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::StrictNotEqual, sym(3).Expression); +} break; +./ + +BitwiseANDExpression: EqualityExpression ; + +BitwiseANDExpression: BitwiseANDExpression T_AND EqualityExpression ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::BitAnd, sym(3).Expression); +} break; +./ + +BitwiseANDExpressionNotIn: EqualityExpressionNotIn ; + +BitwiseANDExpressionNotIn: BitwiseANDExpressionNotIn T_AND EqualityExpressionNotIn ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::BitAnd, sym(3).Expression); +} break; +./ + +BitwiseXORExpression: BitwiseANDExpression ; + +BitwiseXORExpression: BitwiseXORExpression T_XOR BitwiseANDExpression ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::BitXor, sym(3).Expression); +} break; +./ + +BitwiseXORExpressionNotIn: BitwiseANDExpressionNotIn ; + +BitwiseXORExpressionNotIn: BitwiseXORExpressionNotIn T_XOR BitwiseANDExpressionNotIn ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::BitXor, sym(3).Expression); +} break; +./ + +BitwiseORExpression: BitwiseXORExpression ; + +BitwiseORExpression: BitwiseORExpression T_OR BitwiseXORExpression ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::BitOr, sym(3).Expression); +} break; +./ + +BitwiseORExpressionNotIn: BitwiseXORExpressionNotIn ; + +BitwiseORExpressionNotIn: BitwiseORExpressionNotIn T_OR BitwiseXORExpressionNotIn ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::BitOr, sym(3).Expression); +} break; +./ + +LogicalANDExpression: BitwiseORExpression ; + +LogicalANDExpression: LogicalANDExpression T_AND_AND BitwiseORExpression ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::And, sym(3).Expression); +} break; +./ + +LogicalANDExpressionNotIn: BitwiseORExpressionNotIn ; + +LogicalANDExpressionNotIn: LogicalANDExpressionNotIn T_AND_AND BitwiseORExpressionNotIn ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::And, sym(3).Expression); +} break; +./ + +LogicalORExpression: LogicalANDExpression ; + +LogicalORExpression: LogicalORExpression T_OR_OR LogicalANDExpression ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Or, sym(3).Expression); +} break; +./ + +LogicalORExpressionNotIn: LogicalANDExpressionNotIn ; + +LogicalORExpressionNotIn: LogicalORExpressionNotIn T_OR_OR LogicalANDExpressionNotIn ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Or, sym(3).Expression); +} break; +./ + +ConditionalExpression: LogicalORExpression ; + +ConditionalExpression: LogicalORExpression T_QUESTION AssignmentExpression T_COLON AssignmentExpression ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression, sym(5).Expression); +} break; +./ + +ConditionalExpressionNotIn: LogicalORExpressionNotIn ; + +ConditionalExpressionNotIn: LogicalORExpressionNotIn T_QUESTION AssignmentExpressionNotIn T_COLON AssignmentExpressionNotIn ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression, sym(5).Expression); +} break; +./ + +AssignmentExpression: ConditionalExpression ; + +AssignmentExpression: LeftHandSideExpression AssignmentOperator AssignmentExpression ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(2).ival, sym(3).Expression); +} break; +./ + +AssignmentExpressionNotIn: ConditionalExpressionNotIn ; + +AssignmentExpressionNotIn: LeftHandSideExpression AssignmentOperator AssignmentExpressionNotIn ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(2).ival, sym(3).Expression); +} break; +./ + +AssignmentOperator: T_EQ ; +/. +case $rule_number: { + sym(1).ival = QSOperator::Assign; +} break; +./ + +AssignmentOperator: T_STAR_EQ ; +/. +case $rule_number: { + sym(1).ival = QSOperator::InplaceMul; +} break; +./ + +AssignmentOperator: T_DIVIDE_EQ ; +/. +case $rule_number: { + sym(1).ival = QSOperator::InplaceDiv; +} break; +./ + +AssignmentOperator: T_REMAINDER_EQ ; +/. +case $rule_number: { + sym(1).ival = QSOperator::InplaceMod; +} break; +./ + +AssignmentOperator: T_PLUS_EQ ; +/. +case $rule_number: { + sym(1).ival = QSOperator::InplaceAdd; +} break; +./ + +AssignmentOperator: T_MINUS_EQ ; +/. +case $rule_number: { + sym(1).ival = QSOperator::InplaceSub; +} break; +./ + +AssignmentOperator: T_LT_LT_EQ ; +/. +case $rule_number: { + sym(1).ival = QSOperator::InplaceLeftShift; +} break; +./ + +AssignmentOperator: T_GT_GT_EQ ; +/. +case $rule_number: { + sym(1).ival = QSOperator::InplaceRightShift; +} break; +./ + +AssignmentOperator: T_GT_GT_GT_EQ ; +/. +case $rule_number: { + sym(1).ival = QSOperator::InplaceURightShift; +} break; +./ + +AssignmentOperator: T_AND_EQ ; +/. +case $rule_number: { + sym(1).ival = QSOperator::InplaceAnd; +} break; +./ + +AssignmentOperator: T_XOR_EQ ; +/. +case $rule_number: { + sym(1).ival = QSOperator::InplaceXor; +} break; +./ + +AssignmentOperator: T_OR_EQ ; +/. +case $rule_number: { + sym(1).ival = QSOperator::InplaceOr; +} break; +./ + +Expression: AssignmentExpression ; + +Expression: Expression T_COMMA AssignmentExpression ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression); +} break; +./ + +ExpressionOpt: ; +/. +case $rule_number: { + sym(1).Node = 0; +} break; +./ + +ExpressionOpt: Expression ; + +ExpressionNotIn: AssignmentExpressionNotIn ; + +ExpressionNotIn: ExpressionNotIn T_COMMA AssignmentExpressionNotIn ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression); +} break; +./ + +ExpressionNotInOpt: ; +/. +case $rule_number: { + sym(1).Node = 0; +} break; +./ + +ExpressionNotInOpt: ExpressionNotIn ; + +Statement: Block ; +Statement: VariableStatement ; +Statement: EmptyStatement ; +Statement: ExpressionStatement ; +Statement: IfStatement ; +Statement: IterationStatement ; +Statement: ContinueStatement ; +Statement: BreakStatement ; +Statement: ReturnStatement ; +Statement: WithStatement ; +Statement: LabelledStatement ; +Statement: SwitchStatement ; +Statement: ThrowStatement ; +Statement: TryStatement ; +Statement: DebuggerStatement ; + + +Block: T_LBRACE StatementListOpt T_RBRACE ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(2).StatementList); +} break; +./ + +StatementList: Statement ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Statement); +} break; +./ + +StatementList: StatementList Statement ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).StatementList, sym(2).Statement); +} break; +./ + +StatementListOpt: ; +/. +case $rule_number: { + sym(1).Node = 0; +} break; +./ + +StatementListOpt: StatementList ; +/. +case $rule_number: { + sym(1).Node = sym(1).StatementList->finish (); +} break; +./ + +VariableStatement: VariableDeclarationKind VariableDeclarationList T_AUTOMATIC_SEMICOLON ; -- automatic semicolon +VariableStatement: VariableDeclarationKind VariableDeclarationList T_SEMICOLON ; +/. +case $rule_number: { + AST::VariableStatement *node = makeAstNode (driver->nodePool(), sym(2).VariableDeclarationList->finish (/*readOnly=*/sym(1).ival == T_CONST)); + node->declarationKindToken = loc(1); + node->semicolonToken = loc(3); + sym(1).Node = node; +} break; +./ + +VariableDeclarationKind: T_CONST ; +/. +case $rule_number: { + sym(1).ival = T_CONST; +} break; +./ + +VariableDeclarationKind: T_VAR ; +/. +case $rule_number: { + sym(1).ival = T_VAR; +} break; +./ + +VariableDeclarationList: VariableDeclaration ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).VariableDeclaration); +} break; +./ + +VariableDeclarationList: VariableDeclarationList T_COMMA VariableDeclaration ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).VariableDeclarationList, sym(3).VariableDeclaration); +} break; +./ + +VariableDeclarationListNotIn: VariableDeclarationNotIn ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).VariableDeclaration); +} break; +./ + +VariableDeclarationListNotIn: VariableDeclarationListNotIn T_COMMA VariableDeclarationNotIn ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).VariableDeclarationList, sym(3).VariableDeclaration); +} break; +./ + +VariableDeclaration: T_IDENTIFIER InitialiserOpt ; +/. +case $rule_number: { + AST::VariableDeclaration *node = makeAstNode (driver->nodePool(), sym(1).sval, sym(2).Expression); + node->identifierToken = loc(1); + sym(1).Node = node; +} break; +./ + +VariableDeclarationNotIn: T_IDENTIFIER InitialiserNotInOpt ; +/. +case $rule_number: { + AST::VariableDeclaration *node = makeAstNode (driver->nodePool(), sym(1).sval, sym(2).Expression); + node->identifierToken = loc(1); + sym(1).Node = node; +} break; +./ + +Initialiser: T_EQ AssignmentExpression ; +/. +case $rule_number: { + sym(1) = sym(2); +} break; +./ + +InitialiserOpt: ; +/. +case $rule_number: { + sym(1).Node = 0; +} break; +./ + +InitialiserOpt: Initialiser ; + +InitialiserNotIn: T_EQ AssignmentExpressionNotIn ; +/. +case $rule_number: { + sym(1) = sym(2); +} break; +./ + +InitialiserNotInOpt: ; +/. +case $rule_number: { + sym(1).Node = 0; +} break; +./ + +InitialiserNotInOpt: InitialiserNotIn ; + +EmptyStatement: T_SEMICOLON ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool()); +} break; +./ + +ExpressionStatement: Expression T_AUTOMATIC_SEMICOLON ; -- automatic semicolon +ExpressionStatement: Expression T_SEMICOLON ; +/. +case $rule_number: { + AST::ExpressionStatement *node = makeAstNode (driver->nodePool(), sym(1).Expression); + node->semicolonToken = loc(2); + sym(1).Node = node; +} break; +./ + +IfStatement: T_IF T_LPAREN Expression T_RPAREN Statement T_ELSE Statement ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Statement, sym(7).Statement); +} break; +./ + +IfStatement: T_IF T_LPAREN Expression T_RPAREN Statement ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Statement); +} break; +./ + + +IterationStatement: T_DO Statement T_WHILE T_LPAREN Expression T_RPAREN T_AUTOMATIC_SEMICOLON ; -- automatic semicolon +IterationStatement: T_DO Statement T_WHILE T_LPAREN Expression T_RPAREN T_SEMICOLON ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Statement, sym(5).Expression); +} break; +./ + +IterationStatement: T_WHILE T_LPAREN Expression T_RPAREN Statement ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Statement); +} break; +./ + +IterationStatement: T_FOR T_LPAREN ExpressionNotInOpt T_SEMICOLON ExpressionOpt T_SEMICOLON ExpressionOpt T_RPAREN Statement ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Expression, sym(7).Expression, sym(9).Statement); +} break; +./ + +IterationStatement: T_FOR T_LPAREN T_VAR VariableDeclarationListNotIn T_SEMICOLON ExpressionOpt T_SEMICOLON ExpressionOpt T_RPAREN Statement ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(4).VariableDeclarationList->finish (/*readOnly=*/false), sym(6).Expression, sym(8).Expression, sym(10).Statement); +} break; +./ + +IterationStatement: T_FOR T_LPAREN LeftHandSideExpression T_IN Expression T_RPAREN Statement ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Expression, sym(7).Statement); +} break; +./ + +IterationStatement: T_FOR T_LPAREN T_VAR VariableDeclarationNotIn T_IN Expression T_RPAREN Statement ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(4).VariableDeclaration, sym(6).Expression, sym(8).Statement); +} break; +./ + +ContinueStatement: T_CONTINUE T_AUTOMATIC_SEMICOLON ; -- automatic semicolon +ContinueStatement: T_CONTINUE T_SEMICOLON ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool()); +} break; +./ + +ContinueStatement: T_CONTINUE T_IDENTIFIER T_AUTOMATIC_SEMICOLON ; -- automatic semicolon +ContinueStatement: T_CONTINUE T_IDENTIFIER T_SEMICOLON ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(2).sval); +} break; +./ + +BreakStatement: T_BREAK T_AUTOMATIC_SEMICOLON ; -- automatic semicolon +BreakStatement: T_BREAK T_SEMICOLON ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool()); +} break; +./ + +BreakStatement: T_BREAK T_IDENTIFIER T_AUTOMATIC_SEMICOLON ; -- automatic semicolon +BreakStatement: T_BREAK T_IDENTIFIER T_SEMICOLON ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(2).sval); +} break; +./ + +ReturnStatement: T_RETURN ExpressionOpt T_AUTOMATIC_SEMICOLON ; -- automatic semicolon +ReturnStatement: T_RETURN ExpressionOpt T_SEMICOLON ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); +} break; +./ + +WithStatement: T_WITH T_LPAREN Expression T_RPAREN Statement ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Statement); +} break; +./ + +SwitchStatement: T_SWITCH T_LPAREN Expression T_RPAREN CaseBlock ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).CaseBlock); +} break; +./ + +CaseBlock: T_LBRACE CaseClausesOpt T_RBRACE ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(2).CaseClauses); +} break; +./ + +CaseBlock: T_LBRACE CaseClausesOpt DefaultClause CaseClausesOpt T_RBRACE ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(2).CaseClauses, sym(3).DefaultClause, sym(4).CaseClauses); +} break; +./ + +CaseClauses: CaseClause ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).CaseClause); +} break; +./ + +CaseClauses: CaseClauses CaseClause ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).CaseClauses, sym(2).CaseClause); +} break; +./ + +CaseClausesOpt: ; +/. +case $rule_number: { + sym(1).Node = 0; +} break; +./ + +CaseClausesOpt: CaseClauses ; +/. +case $rule_number: { + sym(1).Node = sym(1).CaseClauses->finish (); +} break; +./ + +CaseClause: T_CASE Expression T_COLON StatementListOpt ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression, sym(4).StatementList); +} break; +./ + +DefaultClause: T_DEFAULT T_COLON StatementListOpt ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(3).StatementList); +} break; +./ + +LabelledStatement: T_IDENTIFIER T_COLON Statement ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).sval, sym(3).Statement); +} break; +./ + +ThrowStatement: T_THROW Expression T_AUTOMATIC_SEMICOLON ; -- automatic semicolon +ThrowStatement: T_THROW Expression T_SEMICOLON ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); +} break; +./ + +TryStatement: T_TRY Block Catch ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Statement, sym(3).Catch); +} break; +./ + +TryStatement: T_TRY Block Finally ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Statement, sym(3).Finally); +} break; +./ + +TryStatement: T_TRY Block Catch Finally ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Statement, sym(3).Catch, sym(4).Finally); +} break; +./ + +Catch: T_CATCH T_LPAREN T_IDENTIFIER T_RPAREN Block ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(3).sval, sym(5).Statement); +} break; +./ + +Finally: T_FINALLY Block ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Statement); +} break; +./ + +DebuggerStatement: T_DEBUGGER T_AUTOMATIC_SEMICOLON ; -- automatic semicolon +DebuggerStatement: T_DEBUGGER T_SEMICOLON ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool()); +} break; +./ + +FunctionDeclaration: T_FUNCTION T_IDENTIFIER T_LPAREN FormalParameterListOpt T_RPAREN T_LBRACE FunctionBodyOpt T_RBRACE ; +/. +case $rule_number: { + AST::FunctionDeclaration *node = makeAstNode (driver->nodePool(), sym(2).sval, sym(4).FormalParameterList, sym(7).FunctionBody); + node->functionToken = loc(1); + node->identifierToken = loc(2); + node->lparenToken = loc(3); + node->rparenToken = loc(5); + node->lbraceToken = loc(6); + node->rbraceToken = loc(8); + sym(1).Node = node; +} break; +./ + +FunctionExpression: T_FUNCTION IdentifierOpt T_LPAREN FormalParameterListOpt T_RPAREN T_LBRACE FunctionBodyOpt T_RBRACE ; +/. +case $rule_number: { + AST::FunctionExpression *node = makeAstNode (driver->nodePool(), sym(2).sval, sym(4).FormalParameterList, sym(7).FunctionBody); + node->functionToken = loc(1); + if (sym(2).sval) + node->identifierToken = loc(2); + node->lparenToken = loc(3); + node->rparenToken = loc(5); + node->lbraceToken = loc(6); + node->rbraceToken = loc(8); + sym(1).Node = node; +} break; +./ + +FormalParameterList: T_IDENTIFIER ; +/. +case $rule_number: { + AST::FormalParameterList *node = makeAstNode (driver->nodePool(), sym(1).sval); + node->identifierToken = loc(1); + sym(1).Node = node; +} break; +./ + +FormalParameterList: FormalParameterList T_COMMA T_IDENTIFIER ; +/. +case $rule_number: { + AST::FormalParameterList *node = makeAstNode (driver->nodePool(), sym(1).FormalParameterList, sym(3).sval); + node->commaToken = loc(2); + node->identifierToken = loc(3); + sym(1).Node = node; +} break; +./ + +FormalParameterListOpt: ; +/. +case $rule_number: { + sym(1).Node = 0; +} break; +./ + +FormalParameterListOpt: FormalParameterList ; +/. +case $rule_number: { + sym(1).Node = sym(1).FormalParameterList->finish (); +} break; +./ + +FunctionBodyOpt: ; +/. +case $rule_number: { + sym(1).Node = 0; +} break; +./ + +FunctionBodyOpt: FunctionBody ; + +FunctionBody: SourceElements ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).SourceElements->finish ()); +} break; +./ + +--JavaScriptProgram: SourceElements ; +--/. +--case $rule_number: { +-- sym(1).Node = makeAstNode (driver->nodePool(), sym(1).SourceElements->finish ()); +-- driver->changeAbstractSyntaxTree(sym(1).Node); +--} break; +--./ + +SourceElements: SourceElement ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).SourceElement); +} break; +./ + +SourceElements: SourceElements SourceElement ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).SourceElements, sym(2).SourceElement); +} break; +./ + +SourceElement: Statement ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Statement); +} break; +./ + +SourceElement: FunctionDeclaration ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).FunctionDeclaration); +} break; +./ + +IdentifierOpt: ; +/. +case $rule_number: { + sym(1).sval = 0; +} break; +./ + +IdentifierOpt: T_IDENTIFIER ; + +PropertyNameAndValueListOpt: ; +/. +case $rule_number: { + sym(1).Node = 0; +} break; +./ + +PropertyNameAndValueListOpt: PropertyNameAndValueList ; + +/. + } // switch + action = nt_action(state_stack[tos], lhs[r] - TERMINAL_COUNT); + } // if + } while (action != 0); + + if (first_token == last_token) { + const int errorState = state_stack[tos]; + + // automatic insertion of `;' + if (t_action(errorState, T_AUTOMATIC_SEMICOLON) && automatic(driver, yytoken)) { + SavedToken &tk = token_buffer[0]; + tk.token = yytoken; + tk.dval = yylval; + tk.loc = yylloc; + + const QString msg = QString::fromUtf8("Missing `;'"); + + diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Warning, + yyprevlloc.startLine, yyprevlloc.startColumn, msg)); + + first_token = &token_buffer[0]; + last_token = &token_buffer[1]; + + yytoken = T_SEMICOLON; + yylval = 0; + + action = errorState; + + goto _Lcheck_token; + } + + hadErrors = true; + + token_buffer[0].token = yytoken; + token_buffer[0].dval = yylval; + token_buffer[0].loc = yylloc; + + token_buffer[1].token = yytoken = lexer->lex(); + token_buffer[1].dval = yylval = lexer->dval(); + token_buffer[1].loc = yylloc = location(lexer); + + if (t_action(errorState, yytoken)) { + const QString msg = QString::fromUtf8("Removed token: `%1'").arg(spell[token_buffer[0].token]); + + diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, + token_buffer[0].loc.startLine, token_buffer[0].loc.startColumn, msg)); + + action = errorState; + goto _Lcheck_token; + } + + static int tokens[] = { + T_PLUS, + T_EQ, + + T_COMMA, + T_COLON, + T_SEMICOLON, + + T_RPAREN, T_RBRACKET, T_RBRACE, + + T_NUMERIC_LITERAL, + T_IDENTIFIER, + + T_LPAREN, T_LBRACKET, T_LBRACE, + + EOF_SYMBOL + }; + + for (int *tk = tokens; *tk != EOF_SYMBOL; ++tk) { + int a = t_action(errorState, *tk); + if (a > 0 && t_action(a, yytoken)) { + const QString msg = QString::fromUtf8("Inserted token: `%1'").arg(spell[*tk]); + + diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, + token_buffer[0].loc.startLine, token_buffer[0].loc.startColumn, msg)); + + yytoken = *tk; + yylval = 0; + yylloc = token_buffer[0].loc; + + first_token = &token_buffer[0]; + last_token = &token_buffer[2]; + + action = errorState; + goto _Lcheck_token; + } + } + + for (int tk = 1; tk < TERMINAL_COUNT; ++tk) { + int a = t_action(errorState, tk); + if (a > 0 && t_action(a, yytoken)) { + const QString msg = QString::fromUtf8("Inserted token: `%1'").arg(spell[tk]); + diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, + token_buffer[0].loc.startLine, token_buffer[0].loc.startColumn, msg)); + + yytoken = tk; + yylval = 0; + yylloc = token_buffer[0].loc; + + action = errorState; + goto _Lcheck_token; + } + } + + const QString msg = QString::fromUtf8("Unexpected token"); + diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, + token_buffer[0].loc.startLine, token_buffer[0].loc.startColumn, msg)); + } + + return false; +} + +QT_END_NAMESPACE + + +./ +/: +QT_END_NAMESPACE + + + +#endif // JAVASCRIPTPARSER_P_H +:/ diff --git a/src/declarative/qml/parser/javascriptast.cpp b/src/declarative/qml/parser/javascriptast.cpp new file mode 100644 index 0000000..8d8ca7d --- /dev/null +++ b/src/declarative/qml/parser/javascriptast.cpp @@ -0,0 +1,878 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtScript 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 "javascriptast_p.h" + + + +#include "javascriptastvisitor_p.h" + +QT_BEGIN_NAMESPACE + +namespace JavaScript { namespace AST { + +ExpressionNode *Node::expressionCast() +{ + return 0; +} + +BinaryExpression *Node::binaryExpressionCast() +{ + return 0; +} + +Statement *Node::statementCast() +{ + return 0; +} + +ExpressionNode *ExpressionNode::expressionCast() +{ + return this; +} + +BinaryExpression *BinaryExpression::binaryExpressionCast() +{ + return this; +} + +Statement *Statement::statementCast() +{ + return this; +} + +void ThisExpression::accept0(Visitor *visitor) +{ + if (visitor->visit(this)) { + } + + visitor->endVisit(this); +} + +void IdentifierExpression::accept0(Visitor *visitor) +{ + if (visitor->visit(this)) { + } + + visitor->endVisit(this); +} + +void NullExpression::accept0(Visitor *visitor) +{ + if (visitor->visit(this)) { + } + + visitor->endVisit(this); +} + +void TrueLiteral::accept0(Visitor *visitor) +{ + if (visitor->visit(this)) { + } + + visitor->endVisit(this); +} + +void FalseLiteral::accept0(Visitor *visitor) +{ + if (visitor->visit(this)) { + } + + visitor->endVisit(this); +} + +void StringLiteral::accept0(Visitor *visitor) +{ + if (visitor->visit(this)) { + } + + visitor->endVisit(this); +} + +void NumericLiteral::accept0(Visitor *visitor) +{ + if (visitor->visit(this)) { + } + + visitor->endVisit(this); +} + +void RegExpLiteral::accept0(Visitor *visitor) +{ + if (visitor->visit(this)) { + } + + visitor->endVisit(this); +} + +void ArrayLiteral::accept0(Visitor *visitor) +{ + if (visitor->visit(this)) { + acceptChild(elements, visitor); + acceptChild(elision, visitor); + } + + visitor->endVisit(this); +} + +void ObjectLiteral::accept0(Visitor *visitor) +{ + if (visitor->visit(this)) { + acceptChild(properties, visitor); + } + + visitor->endVisit(this); +} + +void ElementList::accept0(Visitor *visitor) +{ + if (visitor->visit(this)) { + ElementList *it = this; + do { + acceptChild(it->elision, visitor); + acceptChild(it->expression, visitor); + it = it->next; + } while (it); + } + + visitor->endVisit(this); +} + +void Elision::accept0(Visitor *visitor) +{ + if (visitor->visit(this)) { + // ### + } + + visitor->endVisit(this); +} + +void PropertyNameAndValueList::accept0(Visitor *visitor) +{ + if (visitor->visit(this)) { + PropertyNameAndValueList *it = this; + do { + acceptChild(it->name, visitor); + acceptChild(it->value, visitor); + it = it->next; + } while (it); + } + + visitor->endVisit(this); +} + +void IdentifierPropertyName::accept0(Visitor *visitor) +{ + if (visitor->visit(this)) { + } + + visitor->endVisit(this); +} + +void StringLiteralPropertyName::accept0(Visitor *visitor) +{ + if (visitor->visit(this)) { + } + + visitor->endVisit(this); +} + +void NumericLiteralPropertyName::accept0(Visitor *visitor) +{ + if (visitor->visit(this)) { + } + + visitor->endVisit(this); +} + +void ArrayMemberExpression::accept0(Visitor *visitor) +{ + if (visitor->visit(this)) { + acceptChild(base, visitor); + acceptChild(expression, visitor); + } + + visitor->endVisit(this); +} + +void FieldMemberExpression::accept0(Visitor *visitor) +{ + if (visitor->visit(this)) { + acceptChild(base, visitor); + } + + visitor->endVisit(this); +} + +void NewMemberExpression::accept0(Visitor *visitor) +{ + if (visitor->visit(this)) { + acceptChild(base, visitor); + acceptChild(arguments, visitor); + } + + visitor->endVisit(this); +} + +void NewExpression::accept0(Visitor *visitor) +{ + if (visitor->visit(this)) { + acceptChild(expression, visitor); + } + + visitor->endVisit(this); +} + +void CallExpression::accept0(Visitor *visitor) +{ + if (visitor->visit(this)) { + acceptChild(base, visitor); + acceptChild(arguments, visitor); + } + + visitor->endVisit(this); +} + +void ArgumentList::accept0(Visitor *visitor) +{ + if (visitor->visit(this)) { + ArgumentList *it = this; + do { + acceptChild(it->expression, visitor); + it = it->next; + } while (it); + } + + visitor->endVisit(this); +} + +void PostIncrementExpression::accept0(Visitor *visitor) +{ + if (visitor->visit(this)) { + acceptChild(base, visitor); + } + + visitor->endVisit(this); +} + +void PostDecrementExpression::accept0(Visitor *visitor) +{ + if (visitor->visit(this)) { + acceptChild(base, visitor); + } + + visitor->endVisit(this); +} + +void DeleteExpression::accept0(Visitor *visitor) +{ + if (visitor->visit(this)) { + acceptChild(expression, visitor); + } + + visitor->endVisit(this); +} + +void VoidExpression::accept0(Visitor *visitor) +{ + if (visitor->visit(this)) { + acceptChild(expression, visitor); + } + + visitor->endVisit(this); +} + +void TypeOfExpression::accept0(Visitor *visitor) +{ + if (visitor->visit(this)) { + acceptChild(expression, visitor); + } + + visitor->endVisit(this); +} + +void PreIncrementExpression::accept0(Visitor *visitor) +{ + if (visitor->visit(this)) { + acceptChild(expression, visitor); + } + + visitor->endVisit(this); +} + +void PreDecrementExpression::accept0(Visitor *visitor) +{ + if (visitor->visit(this)) { + acceptChild(expression, visitor); + } + + visitor->endVisit(this); +} + +void UnaryPlusExpression::accept0(Visitor *visitor) +{ + if (visitor->visit(this)) { + acceptChild(expression, visitor); + } + + visitor->endVisit(this); +} + +void UnaryMinusExpression::accept0(Visitor *visitor) +{ + if (visitor->visit(this)) { + acceptChild(expression, visitor); + } + + visitor->endVisit(this); +} + +void TildeExpression::accept0(Visitor *visitor) +{ + if (visitor->visit(this)) { + acceptChild(expression, visitor); + } + + visitor->endVisit(this); +} + +void NotExpression::accept0(Visitor *visitor) +{ + if (visitor->visit(this)) { + acceptChild(expression, visitor); + } + + visitor->endVisit(this); +} + +void BinaryExpression::accept0(Visitor *visitor) +{ + if (visitor->visit(this)) { + acceptChild(left, visitor); + acceptChild(right, visitor); + } + + visitor->endVisit(this); +} + +void ConditionalExpression::accept0(Visitor *visitor) +{ + if (visitor->visit(this)) { + acceptChild(expression, visitor); + acceptChild(ok, visitor); + acceptChild(ko, visitor); + } + + visitor->endVisit(this); +} + +void Expression::accept0(Visitor *visitor) +{ + if (visitor->visit(this)) { + acceptChild(left, visitor); + acceptChild(right, visitor); + } + + visitor->endVisit(this); +} + +void Block::accept0(Visitor *visitor) +{ + if (visitor->visit(this)) { + acceptChild(statements, visitor); + } + + visitor->endVisit(this); +} + +void StatementList::accept0(Visitor *visitor) +{ + if (visitor->visit(this)) { + StatementList *it = this; + do { + acceptChild(it->statement, visitor); + it = it->next; + } while (it); + } + + visitor->endVisit(this); +} + +void VariableStatement::accept0(Visitor *visitor) +{ + if (visitor->visit(this)) { + acceptChild(declarations, visitor); + } + + visitor->endVisit(this); +} + +void VariableDeclarationList::accept0(Visitor *visitor) +{ + if (visitor->visit(this)) { + VariableDeclarationList *it = this; + do { + acceptChild(it->declaration, visitor); + it = it->next; + } while (it); + } + + visitor->endVisit(this); +} + +void VariableDeclaration::accept0(Visitor *visitor) +{ + if (visitor->visit(this)) { + acceptChild(expression, visitor); + } + + visitor->endVisit(this); +} + +void EmptyStatement::accept0(Visitor *visitor) +{ + if (visitor->visit(this)) { + } + + visitor->endVisit(this); +} + +void ExpressionStatement::accept0(Visitor *visitor) +{ + if (visitor->visit(this)) { + acceptChild(expression, visitor); + } + + visitor->endVisit(this); +} + +void IfStatement::accept0(Visitor *visitor) +{ + if (visitor->visit(this)) { + acceptChild(expression, visitor); + acceptChild(ok, visitor); + acceptChild(ko, visitor); + } + + visitor->endVisit(this); +} + +void DoWhileStatement::accept0(Visitor *visitor) +{ + if (visitor->visit(this)) { + acceptChild(statement, visitor); + acceptChild(expression, visitor); + } + + visitor->endVisit(this); +} + +void WhileStatement::accept0(Visitor *visitor) +{ + if (visitor->visit(this)) { + acceptChild(expression, visitor); + acceptChild(statement, visitor); + } + + visitor->endVisit(this); +} + +void ForStatement::accept0(Visitor *visitor) +{ + if (visitor->visit(this)) { + acceptChild(initialiser, visitor); + acceptChild(condition, visitor); + acceptChild(expression, visitor); + acceptChild(statement, visitor); + } + + visitor->endVisit(this); +} + +void LocalForStatement::accept0(Visitor *visitor) +{ + if (visitor->visit(this)) { + acceptChild(declarations, visitor); + acceptChild(condition, visitor); + acceptChild(expression, visitor); + acceptChild(statement, visitor); + } + + visitor->endVisit(this); +} + +void ForEachStatement::accept0(Visitor *visitor) +{ + if (visitor->visit(this)) { + acceptChild(initialiser, visitor); + acceptChild(expression, visitor); + acceptChild(statement, visitor); + } + + visitor->endVisit(this); +} + +void LocalForEachStatement::accept0(Visitor *visitor) +{ + if (visitor->visit(this)) { + acceptChild(declaration, visitor); + acceptChild(expression, visitor); + acceptChild(statement, visitor); + } + + visitor->endVisit(this); +} + +void ContinueStatement::accept0(Visitor *visitor) +{ + if (visitor->visit(this)) { + } + + visitor->endVisit(this); +} + +void BreakStatement::accept0(Visitor *visitor) +{ + if (visitor->visit(this)) { + } + + visitor->endVisit(this); +} + +void ReturnStatement::accept0(Visitor *visitor) +{ + if (visitor->visit(this)) { + acceptChild(expression, visitor); + } + + visitor->endVisit(this); +} + +void WithStatement::accept0(Visitor *visitor) +{ + if (visitor->visit(this)) { + acceptChild(expression, visitor); + acceptChild(statement, visitor); + } + + visitor->endVisit(this); +} + +void SwitchStatement::accept0(Visitor *visitor) +{ + if (visitor->visit(this)) { + acceptChild(expression, visitor); + acceptChild(block, visitor); + } + + visitor->endVisit(this); +} + +void CaseBlock::accept0(Visitor *visitor) +{ + if (visitor->visit(this)) { + acceptChild(clauses, visitor); + acceptChild(defaultClause, visitor); + acceptChild(moreClauses, visitor); + } + + visitor->endVisit(this); +} + +void CaseClauses::accept0(Visitor *visitor) +{ + if (visitor->visit(this)) { + CaseClauses *it = this; + do { + acceptChild(it->clause, visitor); + it = it->next; + } while (it); + } + + visitor->endVisit(this); +} + +void CaseClause::accept0(Visitor *visitor) +{ + if (visitor->visit(this)) { + acceptChild(expression, visitor); + acceptChild(statements, visitor); + } + + visitor->endVisit(this); +} + +void DefaultClause::accept0(Visitor *visitor) +{ + if (visitor->visit(this)) { + acceptChild(statements, visitor); + } + + visitor->endVisit(this); +} + +void LabelledStatement::accept0(Visitor *visitor) +{ + if (visitor->visit(this)) { + acceptChild(statement, visitor); + } + + visitor->endVisit(this); +} + +void ThrowStatement::accept0(Visitor *visitor) +{ + if (visitor->visit(this)) { + acceptChild(expression, visitor); + } + + visitor->endVisit(this); +} + +void TryStatement::accept0(Visitor *visitor) +{ + if (visitor->visit(this)) { + acceptChild(statement, visitor); + acceptChild(catchExpression, visitor); + acceptChild(finallyExpression, visitor); + } + + visitor->endVisit(this); +} + +void Catch::accept0(Visitor *visitor) +{ + if (visitor->visit(this)) { + acceptChild(statement, visitor); + } + + visitor->endVisit(this); +} + +void Finally::accept0(Visitor *visitor) +{ + if (visitor->visit(this)) { + acceptChild(statement, visitor); + } + + visitor->endVisit(this); +} + +void FunctionDeclaration::accept0(Visitor *visitor) +{ + if (visitor->visit(this)) { + acceptChild(formals, visitor); + acceptChild(body, visitor); + } + + visitor->endVisit(this); +} + +void FunctionExpression::accept0(Visitor *visitor) +{ + if (visitor->visit(this)) { + acceptChild(formals, visitor); + acceptChild(body, visitor); + } + + visitor->endVisit(this); +} + +void FormalParameterList::accept0(Visitor *visitor) +{ + if (visitor->visit(this)) { + // ### + } + + visitor->endVisit(this); +} + +void FunctionBody::accept0(Visitor *visitor) +{ + if (visitor->visit(this)) { + acceptChild(elements, visitor); + } + + visitor->endVisit(this); +} + +void Program::accept0(Visitor *visitor) +{ + if (visitor->visit(this)) { + acceptChild(elements, visitor); + } + + visitor->endVisit(this); +} + +void SourceElements::accept0(Visitor *visitor) +{ + if (visitor->visit(this)) { + SourceElements *it = this; + do { + acceptChild(it->element, visitor); + it = it->next; + } while (it); + } + + visitor->endVisit(this); +} + +void FunctionSourceElement::accept0(Visitor *visitor) +{ + if (visitor->visit(this)) { + acceptChild(declaration, visitor); + } + + visitor->endVisit(this); +} + +void StatementSourceElement::accept0(Visitor *visitor) +{ + if (visitor->visit(this)) { + acceptChild(statement, visitor); + } + + visitor->endVisit(this); +} + +void DebuggerStatement::accept0(Visitor *visitor) +{ + if (visitor->visit(this)) { + } + + visitor->endVisit(this); +} + + +void UiProgram::accept0(Visitor *visitor) +{ + if (visitor->visit(this)) { + for (UiObjectMemberList *it = members; it; it = it->next) + acceptChild(it->member, visitor); + } + + visitor->endVisit(this); +} + +void UiPublicMember::accept0(Visitor *visitor) +{ + if (visitor->visit(this)) { + acceptChild(expression, visitor); + acceptChild(initializer, visitor); + } + + visitor->endVisit(this); +} + +void UiObjectDefinition::accept0(Visitor *visitor) +{ + if (visitor->visit(this)) { + acceptChild(initializer, visitor); + } + + visitor->endVisit(this); +} + +void UiObjectInitializer::accept0(Visitor *visitor) +{ + if (visitor->visit(this)) { + for (UiObjectMemberList *it = members; it; it = it->next) + acceptChild(it->member, visitor); + } + + visitor->endVisit(this); +} + +void UiObjectBinding::accept0(Visitor *visitor) +{ + if (visitor->visit(this)) { + acceptChild(qualifiedId, visitor); + acceptChild(initializer, visitor); + } + + visitor->endVisit(this); +} + +void UiScriptBinding::accept0(Visitor *visitor) +{ + if (visitor->visit(this)) { + acceptChild(qualifiedId, visitor); + acceptChild(statement, visitor); + } + + visitor->endVisit(this); +} + +void UiArrayBinding::accept0(Visitor *visitor) +{ + if (visitor->visit(this)) { + acceptChild(qualifiedId, visitor); + for (UiObjectMemberList *it = members; it; it = it->next) + acceptChild(it->member, visitor); + } + + visitor->endVisit(this); +} + +void UiObjectMemberList::accept0(Visitor *visitor) +{ + if (visitor->visit(this)) { + for (UiObjectMemberList *it = this; it; it = it->next) + acceptChild(it->member, visitor); + } + + visitor->endVisit(this); +} + +void UiQualifiedId::accept0(Visitor *visitor) +{ + if (visitor->visit(this)) { + } + + visitor->endVisit(this); +} + +} } // namespace JavaScript::AST + +QT_END_NAMESPACE + + diff --git a/src/declarative/qml/parser/javascriptast_p.h b/src/declarative/qml/parser/javascriptast_p.h new file mode 100644 index 0000000..1e9256e --- /dev/null +++ b/src/declarative/qml/parser/javascriptast_p.h @@ -0,0 +1,1756 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtScript 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 JAVASCRIPTAST_P_H +#define JAVASCRIPTAST_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include + + + +#include "javascriptastvisitor_p.h" + +QT_BEGIN_NAMESPACE + +class JavaScriptNameIdImpl; + +namespace QSOperator // ### rename +{ + +enum Op { + Add, + And, + InplaceAnd, + Assign, + BitAnd, + BitOr, + BitXor, + InplaceSub, + Div, + InplaceDiv, + Equal, + Ge, + Gt, + In, + InplaceAdd, + InstanceOf, + Le, + LShift, + InplaceLeftShift, + Lt, + Mod, + InplaceMod, + Mul, + InplaceMul, + NotEqual, + Or, + InplaceOr, + RShift, + InplaceRightShift, + StrictEqual, + StrictNotEqual, + Sub, + URShift, + InplaceURightShift, + InplaceXor +}; + +} // namespace QSOperator + +namespace JavaScript { namespace AST { + +class SourceLocation +{ +public: + SourceLocation(quint32 offset = 0, quint32 length = 0) + : offset(offset), length(length), + startLine(0), startColumn(0) + { } + +// attributes + // ### encode + quint32 offset; + quint32 length; + quint32 startLine; + quint32 startColumn; +}; + +class Node +{ +public: + enum Kind { + Kind_Node, + Kind_ExpressionNode, + Kind_Statement, + Kind_ThisExpression, + Kind_IdentifierExpression, + Kind_NullExpression, + Kind_TrueLiteral, + Kind_FalseLiteral, + Kind_NumericLiteral, + Kind_StringLiteral, + Kind_RegExpLiteral, + Kind_ArrayLiteral, + Kind_ObjectLiteral, + Kind_ElementList, + Kind_Elision, + Kind_PropertyNameAndValueList, + Kind_PropertyName, + Kind_IdentifierPropertyName, + Kind_StringLiteralPropertyName, + Kind_NumericLiteralPropertyName, + Kind_ArrayMemberExpression, + Kind_FieldMemberExpression, + Kind_NewMemberExpression, + Kind_NewExpression, + Kind_CallExpression, + Kind_ArgumentList, + Kind_PostIncrementExpression, + Kind_PostDecrementExpression, + Kind_DeleteExpression, + Kind_VoidExpression, + Kind_TypeOfExpression, + Kind_PreIncrementExpression, + Kind_PreDecrementExpression, + Kind_UnaryPlusExpression, + Kind_UnaryMinusExpression, + Kind_TildeExpression, + Kind_NotExpression, + Kind_BinaryExpression, + Kind_ConditionalExpression, + Kind_Expression, + Kind_Block, + Kind_StatementList, + Kind_VariableStatement, + Kind_VariableDeclarationList, + Kind_VariableDeclaration, + Kind_EmptyStatement, + Kind_ExpressionStatement, + Kind_IfStatement, + Kind_DoWhileStatement, + Kind_WhileStatement, + Kind_ForStatement, + Kind_LocalForStatement, + Kind_ForEachStatement, + Kind_LocalForEachStatement, + Kind_ContinueStatement, + Kind_BreakStatement, + Kind_ReturnStatement, + Kind_WithStatement, + Kind_SwitchStatement, + Kind_CaseBlock, + Kind_CaseClauses, + Kind_CaseClause, + Kind_DefaultClause, + Kind_LabelledStatement, + Kind_ThrowStatement, + Kind_TryStatement, + Kind_Catch, + Kind_Finally, + Kind_FunctionDeclaration, + Kind_FunctionExpression, + Kind_FormalParameterList, + Kind_FunctionBody, + Kind_Program, + Kind_SourceElements, + Kind_SourceElement, + Kind_FunctionSourceElement, + Kind_StatementSourceElement, + Kind_DebuggerStatement, + + Kind_UiProgram, + Kind_UiPublicMember, + Kind_UiObjectDefinition, + Kind_UiObjectInitializer, + Kind_UiObjectBinding, + Kind_UiScriptBinding, + Kind_UiArrayBinding, + Kind_UiObjectMemberList, + Kind_UiQualifiedId + }; + + inline Node() + : kind(Kind_Node) {} + + virtual ~Node() {} + + virtual ExpressionNode *expressionCast(); + virtual BinaryExpression *binaryExpressionCast(); + virtual Statement *statementCast(); + + inline void accept(Visitor *visitor) + { + if (visitor->preVisit(this)) { + accept0(visitor); + visitor->postVisit(this); + } + } + + static void acceptChild(Node *node, Visitor *visitor) + { + if (node) + node->accept(visitor); + } + + virtual void accept0(Visitor *visitor) = 0; + + Kind kind; +}; + +class ExpressionNode: public Node +{ +public: + ExpressionNode() { kind = Kind_ExpressionNode; } + virtual ~ExpressionNode() {} + + virtual ExpressionNode *expressionCast(); +}; + +class Statement: public Node +{ +public: + Statement() { kind = Kind_Statement; } + virtual ~Statement() {} + + virtual Statement *statementCast(); +}; + +class ThisExpression: public ExpressionNode +{ +public: + ThisExpression() { kind = Kind_ThisExpression; } + virtual ~ThisExpression() {} + + virtual void accept0(Visitor *visitor); + +// attributes + SourceLocation thisToken; +}; + +class IdentifierExpression: public ExpressionNode +{ +public: + IdentifierExpression(JavaScriptNameIdImpl *n): + name (n) { kind = Kind_IdentifierExpression; } + + virtual ~IdentifierExpression() {} + + virtual void accept0(Visitor *visitor); + +// attributes + JavaScriptNameIdImpl *name; + SourceLocation identifierToken; +}; + +class NullExpression: public ExpressionNode +{ +public: + NullExpression() { kind = Kind_NullExpression; } + virtual ~NullExpression() {} + + virtual void accept0(Visitor *visitor); + +// attributes + SourceLocation nullToken; +}; + +class TrueLiteral: public ExpressionNode +{ +public: + TrueLiteral() { kind = Kind_TrueLiteral; } + virtual ~TrueLiteral() {} + + virtual void accept0(Visitor *visitor); + +// attributes + SourceLocation trueToken; +}; + +class FalseLiteral: public ExpressionNode +{ +public: + FalseLiteral() { kind = Kind_FalseLiteral; } + virtual ~FalseLiteral() {} + + virtual void accept0(Visitor *visitor); + +// attributes + SourceLocation falseToken; +}; + +class NumericLiteral: public ExpressionNode +{ +public: + NumericLiteral(double v): + value (v) { kind = Kind_NumericLiteral; } + virtual ~NumericLiteral() {} + + virtual void accept0(Visitor *visitor); + +// attributes: + double value; + SourceLocation literalToken; +}; + +class StringLiteral: public ExpressionNode +{ +public: + StringLiteral(JavaScriptNameIdImpl *v): + value (v) { kind = Kind_StringLiteral; } + + virtual ~StringLiteral() {} + + virtual void accept0(Visitor *visitor); + +// attributes: + JavaScriptNameIdImpl *value; + SourceLocation literalToken; +}; + +class RegExpLiteral: public ExpressionNode +{ +public: + RegExpLiteral(JavaScriptNameIdImpl *p, int f): + pattern (p), flags (f) { kind = Kind_RegExpLiteral; } + + virtual ~RegExpLiteral() {} + + virtual void accept0(Visitor *visitor); + +// attributes: + JavaScriptNameIdImpl *pattern; + int flags; + SourceLocation literalToken; +}; + +class ArrayLiteral: public ExpressionNode +{ +public: + ArrayLiteral(Elision *e): + elements (0), elision (e) + { kind = Kind_ArrayLiteral; } + + ArrayLiteral(ElementList *elts): + elements (elts), elision (0) + { kind = Kind_ArrayLiteral; } + + ArrayLiteral(ElementList *elts, Elision *e): + elements (elts), elision (e) + { kind = Kind_ArrayLiteral; } + + virtual ~ArrayLiteral() {} + + virtual void accept0(Visitor *visitor); + +// attributes + ElementList *elements; + Elision *elision; +}; + +class ObjectLiteral: public ExpressionNode +{ +public: + ObjectLiteral(): + properties (0) { kind = Kind_ObjectLiteral; } + + ObjectLiteral(PropertyNameAndValueList *plist): + properties (plist) { kind = Kind_ObjectLiteral; } + + virtual ~ObjectLiteral() {} + + virtual void accept0(Visitor *visitor); + +// attributes + PropertyNameAndValueList *properties; +}; + +class ElementList: public Node +{ +public: + ElementList(Elision *e, ExpressionNode *expr): + elision (e), expression (expr), next (this) + { kind = Kind_ElementList; } + + ElementList(ElementList *previous, Elision *e, ExpressionNode *expr): + elision (e), expression (expr) + { + kind = Kind_ElementList; + next = previous->next; + previous->next = this; + } + + virtual ~ElementList() {} + + inline ElementList *finish () + { + ElementList *front = next; + next = 0; + return front; + } + + virtual void accept0(Visitor *visitor); + +// attributes + Elision *elision; + ExpressionNode *expression; + ElementList *next; +}; + +class Elision: public Node +{ +public: + Elision(): + next (this) { kind = Kind_Elision; } + + Elision(Elision *previous) + { + kind = Kind_Elision; + next = previous->next; + previous->next = this; + } + + virtual ~Elision() {} + + virtual void accept0(Visitor *visitor); + + inline Elision *finish () + { + Elision *front = next; + next = 0; + return front; + } + +// attributes + Elision *next; +}; + +class PropertyNameAndValueList: public Node +{ +public: + PropertyNameAndValueList(PropertyName *n, ExpressionNode *v): + name (n), value (v), next (this) + { kind = Kind_PropertyNameAndValueList; } + + PropertyNameAndValueList(PropertyNameAndValueList *previous, PropertyName *n, ExpressionNode *v): + name (n), value (v) + { + kind = Kind_PropertyNameAndValueList; + next = previous->next; + previous->next = this; + } + + virtual ~PropertyNameAndValueList() {} + + virtual void accept0(Visitor *visitor); + + inline PropertyNameAndValueList *finish () + { + PropertyNameAndValueList *front = next; + next = 0; + return front; + } + +// attributes + PropertyName *name; + ExpressionNode *value; + PropertyNameAndValueList *next; +}; + +class PropertyName: public Node +{ +public: + PropertyName() { kind = Kind_PropertyName; } + virtual ~PropertyName() {} +}; + +class IdentifierPropertyName: public PropertyName +{ +public: + IdentifierPropertyName(JavaScriptNameIdImpl *n): + id (n) { kind = Kind_IdentifierPropertyName; } + + virtual ~IdentifierPropertyName() {} + + virtual void accept0(Visitor *visitor); + +// attributes + JavaScriptNameIdImpl *id; +}; + +class StringLiteralPropertyName: public PropertyName +{ +public: + StringLiteralPropertyName(JavaScriptNameIdImpl *n): + id (n) { kind = Kind_StringLiteralPropertyName; } + virtual ~StringLiteralPropertyName() {} + + virtual void accept0(Visitor *visitor); + +// attributes + JavaScriptNameIdImpl *id; +}; + +class NumericLiteralPropertyName: public PropertyName +{ +public: + NumericLiteralPropertyName(double n): + id (n) { kind = Kind_NumericLiteralPropertyName; } + virtual ~NumericLiteralPropertyName() {} + + virtual void accept0(Visitor *visitor); + +// attributes + double id; +}; + +class ArrayMemberExpression: public ExpressionNode +{ +public: + ArrayMemberExpression(ExpressionNode *b, ExpressionNode *e): + base (b), expression (e) + { kind = Kind_ArrayMemberExpression; } + + virtual ~ArrayMemberExpression() {} + + virtual void accept0(Visitor *visitor); + +// attributes + ExpressionNode *base; + ExpressionNode *expression; +}; + +class FieldMemberExpression: public ExpressionNode +{ +public: + FieldMemberExpression(ExpressionNode *b, JavaScriptNameIdImpl *n): + base (b), name (n) + { kind = Kind_FieldMemberExpression; } + + virtual ~FieldMemberExpression() {} + + virtual void accept0(Visitor *visitor); + +// attributes + ExpressionNode *base; + JavaScriptNameIdImpl *name; + SourceLocation dotToken; + SourceLocation identifierToken; +}; + +class NewMemberExpression: public ExpressionNode +{ +public: + NewMemberExpression(ExpressionNode *b, ArgumentList *a): + base (b), arguments (a) + { kind = Kind_NewMemberExpression; } + + virtual ~NewMemberExpression() {} + + virtual void accept0(Visitor *visitor); + +// attributes + ExpressionNode *base; + ArgumentList *arguments; + SourceLocation newToken; + SourceLocation lparenToken; + SourceLocation rparenToken; +}; + +class NewExpression: public ExpressionNode +{ +public: + NewExpression(ExpressionNode *e): + expression (e) { kind = Kind_NewExpression; } + + virtual ~NewExpression() {} + + virtual void accept0(Visitor *visitor); + +// attributes + ExpressionNode *expression; + SourceLocation newToken; +}; + +class CallExpression: public ExpressionNode +{ +public: + CallExpression(ExpressionNode *b, ArgumentList *a): + base (b), arguments (a) + { kind = Kind_CallExpression; } + + virtual ~CallExpression() {} + + virtual void accept0(Visitor *visitor); + +// attributes + ExpressionNode *base; + ArgumentList *arguments; + SourceLocation lparenToken; + SourceLocation rparenToken; +}; + +class ArgumentList: public Node +{ +public: + ArgumentList(ExpressionNode *e): + expression (e), next (this) + { kind = Kind_ArgumentList; } + + ArgumentList(ArgumentList *previous, ExpressionNode *e): + expression (e) + { + kind = Kind_ArgumentList; + next = previous->next; + previous->next = this; + } + + virtual ~ArgumentList() {} + + virtual void accept0(Visitor *visitor); + + inline ArgumentList *finish () + { + ArgumentList *front = next; + next = 0; + return front; + } + +// attributes + ExpressionNode *expression; + ArgumentList *next; + SourceLocation commaToken; +}; + +class PostIncrementExpression: public ExpressionNode +{ +public: + PostIncrementExpression(ExpressionNode *b): + base (b) { kind = Kind_PostIncrementExpression; } + + virtual ~PostIncrementExpression() {} + + virtual void accept0(Visitor *visitor); + +// attributes + ExpressionNode *base; +}; + +class PostDecrementExpression: public ExpressionNode +{ +public: + PostDecrementExpression(ExpressionNode *b): + base (b) { kind = Kind_PostDecrementExpression; } + + virtual ~PostDecrementExpression() {} + + virtual void accept0(Visitor *visitor); + +// attributes + ExpressionNode *base; +}; + +class DeleteExpression: public ExpressionNode +{ +public: + DeleteExpression(ExpressionNode *e): + expression (e) { kind = Kind_DeleteExpression; } + virtual ~DeleteExpression() {} + + virtual void accept0(Visitor *visitor); + +// attributes + ExpressionNode *expression; +}; + +class VoidExpression: public ExpressionNode +{ +public: + VoidExpression(ExpressionNode *e): + expression (e) { kind = Kind_VoidExpression; } + + virtual ~VoidExpression() {} + + virtual void accept0(Visitor *visitor); + +// attributes + ExpressionNode *expression; +}; + +class TypeOfExpression: public ExpressionNode +{ +public: + TypeOfExpression(ExpressionNode *e): + expression (e) { kind = Kind_TypeOfExpression; } + + virtual ~TypeOfExpression() {} + + virtual void accept0(Visitor *visitor); + +// attributes + ExpressionNode *expression; +}; + +class PreIncrementExpression: public ExpressionNode +{ +public: + PreIncrementExpression(ExpressionNode *e): + expression (e) { kind = Kind_PreIncrementExpression; } + + virtual ~PreIncrementExpression() {} + + virtual void accept0(Visitor *visitor); + +// attributes + ExpressionNode *expression; +}; + +class PreDecrementExpression: public ExpressionNode +{ +public: + PreDecrementExpression(ExpressionNode *e): + expression (e) { kind = Kind_PreDecrementExpression; } + + virtual ~PreDecrementExpression() {} + + virtual void accept0(Visitor *visitor); + +// attributes + ExpressionNode *expression; +}; + +class UnaryPlusExpression: public ExpressionNode +{ +public: + UnaryPlusExpression(ExpressionNode *e): + expression (e) { kind = Kind_UnaryPlusExpression; } + + virtual ~UnaryPlusExpression() {} + + virtual void accept0(Visitor *visitor); + +// attributes + ExpressionNode *expression; +}; + +class UnaryMinusExpression: public ExpressionNode +{ +public: + UnaryMinusExpression(ExpressionNode *e): + expression (e) { kind = Kind_UnaryMinusExpression; } + + virtual ~UnaryMinusExpression() {} + + virtual void accept0(Visitor *visitor); + +// attributes + ExpressionNode *expression; +}; + +class TildeExpression: public ExpressionNode +{ +public: + TildeExpression(ExpressionNode *e): + expression (e) { kind = Kind_TildeExpression; } + + virtual ~TildeExpression() {} + + virtual void accept0(Visitor *visitor); + +// attributes + ExpressionNode *expression; +}; + +class NotExpression: public ExpressionNode +{ +public: + NotExpression(ExpressionNode *e): + expression (e) { kind = Kind_NotExpression; } + + virtual ~NotExpression() {} + + virtual void accept0(Visitor *visitor); + +// attributes + ExpressionNode *expression; +}; + +class BinaryExpression: public ExpressionNode +{ +public: + BinaryExpression(ExpressionNode *l, int o, ExpressionNode *r): + left (l), op (o), right (r) + { kind = Kind_BinaryExpression; } + + virtual ~BinaryExpression() {} + + virtual BinaryExpression *binaryExpressionCast(); + + virtual void accept0(Visitor *visitor); + +// attributes + ExpressionNode *left; + int op; + ExpressionNode *right; +}; + +class ConditionalExpression: public ExpressionNode +{ +public: + ConditionalExpression(ExpressionNode *e, ExpressionNode *t, ExpressionNode *f): + expression (e), ok (t), ko (f) + { kind = Kind_ConditionalExpression; } + + virtual ~ConditionalExpression() {} + + virtual void accept0(Visitor *visitor); + +// attributes + ExpressionNode *expression; + ExpressionNode *ok; + ExpressionNode *ko; +}; + +class Expression: public ExpressionNode // ### rename +{ +public: + Expression(ExpressionNode *l, ExpressionNode *r): + left (l), right (r) { kind = Kind_Expression; } + + virtual ~Expression() {} + + virtual void accept0(Visitor *visitor); + +// attributes + ExpressionNode *left; + ExpressionNode *right; +}; + +class Block: public Statement +{ +public: + Block(StatementList *slist): + statements (slist) { kind = Kind_Block; } + + virtual ~Block() {} + + virtual void accept0(Visitor *visitor); + +// attributes + StatementList *statements; +}; + +class StatementList: public Node +{ +public: + StatementList(Statement *stmt): + statement (stmt), next (this) + { kind = Kind_StatementList; } + + StatementList(StatementList *previous, Statement *stmt): + statement (stmt) + { + kind = Kind_StatementList; + next = previous->next; + previous->next = this; + } + + virtual ~StatementList() {} + + virtual void accept0(Visitor *visitor); + + inline StatementList *finish () + { + StatementList *front = next; + next = 0; + return front; + } + +// attributes + Statement *statement; + StatementList *next; +}; + +class VariableStatement: public Statement +{ +public: + VariableStatement(VariableDeclarationList *vlist): + declarations (vlist) + { kind = Kind_VariableStatement; } + + virtual ~VariableStatement() {} + + virtual void accept0(Visitor *visitor); + +// attributes + VariableDeclarationList *declarations; + SourceLocation declarationKindToken; + SourceLocation semicolonToken; +}; + +class VariableDeclaration: public Node +{ +public: + VariableDeclaration(JavaScriptNameIdImpl *n, ExpressionNode *e): + name (n), expression (e), readOnly(false) + { kind = Kind_VariableDeclaration; } + + virtual ~VariableDeclaration() {} + + virtual void accept0(Visitor *visitor); + +// attributes + JavaScriptNameIdImpl *name; + ExpressionNode *expression; + bool readOnly; + SourceLocation identifierToken; +}; + +class VariableDeclarationList: public Node +{ +public: + VariableDeclarationList(VariableDeclaration *decl): + declaration (decl), next (this) + { kind = Kind_VariableDeclarationList; } + + VariableDeclarationList(VariableDeclarationList *previous, VariableDeclaration *decl): + declaration (decl) + { + kind = Kind_VariableDeclarationList; + next = previous->next; + previous->next = this; + } + + virtual ~VariableDeclarationList() {} + + virtual void accept0(Visitor *visitor); + + inline VariableDeclarationList *finish (bool readOnly) + { + VariableDeclarationList *front = next; + next = 0; + if (readOnly) { + VariableDeclarationList *vdl; + for (vdl = front; vdl != 0; vdl = vdl->next) + vdl->declaration->readOnly = true; + } + return front; + } + +// attributes + VariableDeclaration *declaration; + VariableDeclarationList *next; +}; + +class EmptyStatement: public Statement +{ +public: + EmptyStatement() { kind = Kind_EmptyStatement; } + virtual ~EmptyStatement() {} + + virtual void accept0(Visitor *visitor); +}; + +class ExpressionStatement: public Statement +{ +public: + ExpressionStatement(ExpressionNode *e): + expression (e) { kind = Kind_ExpressionStatement; } + + virtual ~ExpressionStatement() {} + + virtual void accept0(Visitor *visitor); + +// attributes + ExpressionNode *expression; + SourceLocation semicolonToken; +}; + +class IfStatement: public Statement +{ +public: + IfStatement(ExpressionNode *e, Statement *t, Statement *f = 0): + expression (e), ok (t), ko (f) + { kind = Kind_IfStatement; } + + virtual ~IfStatement() {} + + virtual void accept0(Visitor *visitor); + +// attributes + ExpressionNode *expression; + Statement *ok; + Statement *ko; +}; + +class DoWhileStatement: public Statement +{ +public: + DoWhileStatement(Statement *stmt, ExpressionNode *e): + statement (stmt), expression (e) + { kind = Kind_DoWhileStatement; } + + virtual ~DoWhileStatement() {} + + virtual void accept0(Visitor *visitor); + +// attributes + Statement *statement; + ExpressionNode *expression; +}; + +class WhileStatement: public Statement +{ +public: + WhileStatement(ExpressionNode *e, Statement *stmt): + expression (e), statement (stmt) + { kind = Kind_WhileStatement; } + + virtual ~WhileStatement() {} + + virtual void accept0(Visitor *visitor); + +// attributes + ExpressionNode *expression; + Statement *statement; +}; + +class ForStatement: public Statement +{ +public: + ForStatement(ExpressionNode *i, ExpressionNode *c, ExpressionNode *e, Statement *stmt): + initialiser (i), condition (c), expression (e), statement (stmt) + { kind = Kind_ForStatement; } + + virtual ~ForStatement() {} + + virtual void accept0(Visitor *visitor); + +// attributes + ExpressionNode *initialiser; + ExpressionNode *condition; + ExpressionNode *expression; + Statement *statement; +}; + +class LocalForStatement: public Statement +{ +public: + LocalForStatement(VariableDeclarationList *vlist, ExpressionNode *c, ExpressionNode *e, Statement *stmt): + declarations (vlist), condition (c), expression (e), statement (stmt) + { kind = Kind_LocalForStatement; } + + virtual ~LocalForStatement() {} + + virtual void accept0(Visitor *visitor); + +// attributes + VariableDeclarationList *declarations; + ExpressionNode *condition; + ExpressionNode *expression; + Statement *statement; +}; + +class ForEachStatement: public Statement +{ +public: + ForEachStatement(ExpressionNode *i, ExpressionNode *e, Statement *stmt): + initialiser (i), expression (e), statement (stmt) + { kind = Kind_ForEachStatement; } + + virtual ~ForEachStatement() {} + + virtual void accept0(Visitor *visitor); + +// attributes + ExpressionNode *initialiser; + ExpressionNode *expression; + Statement *statement; +}; + +class LocalForEachStatement: public Statement +{ +public: + LocalForEachStatement(VariableDeclaration *v, ExpressionNode *e, Statement *stmt): + declaration (v), expression (e), statement (stmt) + { kind = Kind_LocalForEachStatement; } + + virtual ~LocalForEachStatement() {} + + virtual void accept0(Visitor *visitor); + +// attributes + VariableDeclaration *declaration; + ExpressionNode *expression; + Statement *statement; +}; + +class ContinueStatement: public Statement +{ +public: + ContinueStatement(JavaScriptNameIdImpl *l = 0): + label (l) { kind = Kind_ContinueStatement; } + + virtual ~ContinueStatement() {} + + virtual void accept0(Visitor *visitor); + +// attributes + JavaScriptNameIdImpl *label; +}; + +class BreakStatement: public Statement +{ +public: + BreakStatement(JavaScriptNameIdImpl *l = 0): + label (l) { kind = Kind_BreakStatement; } + + virtual ~BreakStatement() {} + + virtual void accept0(Visitor *visitor); + +// attributes + JavaScriptNameIdImpl *label; +}; + +class ReturnStatement: public Statement +{ +public: + ReturnStatement(ExpressionNode *e): + expression (e) { kind = Kind_ReturnStatement; } + + virtual ~ReturnStatement() {} + + virtual void accept0(Visitor *visitor); + +// attributes + ExpressionNode *expression; +}; + +class WithStatement: public Statement +{ +public: + WithStatement(ExpressionNode *e, Statement *stmt): + expression (e), statement (stmt) + { kind = Kind_WithStatement; } + + virtual ~WithStatement() {} + + virtual void accept0(Visitor *visitor); + +// attributes + ExpressionNode *expression; + Statement *statement; +}; + +class SwitchStatement: public Statement +{ +public: + SwitchStatement(ExpressionNode *e, CaseBlock *b): + expression (e), block (b) + { kind = Kind_SwitchStatement; } + + virtual ~SwitchStatement() {} + + virtual void accept0(Visitor *visitor); + +// attributes + ExpressionNode *expression; + CaseBlock *block; +}; + +class CaseBlock: public Node +{ +public: + CaseBlock(CaseClauses *c, DefaultClause *d = 0, CaseClauses *r = 0): + clauses (c), defaultClause (d), moreClauses (r) + { kind = Kind_CaseBlock; } + + virtual ~CaseBlock() {} + + virtual void accept0(Visitor *visitor); + +// attributes + CaseClauses *clauses; + DefaultClause *defaultClause; + CaseClauses *moreClauses; +}; + +class CaseClauses: public Node +{ +public: + CaseClauses(CaseClause *c): + clause (c), next (this) + { kind = Kind_CaseClauses; } + + CaseClauses(CaseClauses *previous, CaseClause *c): + clause (c) + { + kind = Kind_CaseClauses; + next = previous->next; + previous->next = this; + } + + virtual ~CaseClauses() {} + + virtual void accept0(Visitor *visitor); + + inline CaseClauses *finish () + { + CaseClauses *front = next; + next = 0; + return front; + } + +//attributes + CaseClause *clause; + CaseClauses *next; +}; + +class CaseClause: public Node +{ +public: + CaseClause(ExpressionNode *e, StatementList *slist): + expression (e), statements (slist) + { kind = Kind_CaseClause; } + + virtual ~CaseClause() {} + + virtual void accept0(Visitor *visitor); + +// attributes + ExpressionNode *expression; + StatementList *statements; +}; + +class DefaultClause: public Node +{ +public: + DefaultClause(StatementList *slist): + statements (slist) + { kind = Kind_DefaultClause; } + + virtual ~DefaultClause() {} + + virtual void accept0(Visitor *visitor); + +// attributes + StatementList *statements; +}; + +class LabelledStatement: public Statement +{ +public: + LabelledStatement(JavaScriptNameIdImpl *l, Statement *stmt): + label (l), statement (stmt) + { kind = Kind_LabelledStatement; } + + virtual ~LabelledStatement() {} + + virtual void accept0(Visitor *visitor); + +// attributes + JavaScriptNameIdImpl *label; + Statement *statement; +}; + +class ThrowStatement: public Statement +{ +public: + ThrowStatement(ExpressionNode *e): + expression (e) { kind = Kind_ThrowStatement; } + + virtual ~ThrowStatement() {} + + virtual void accept0(Visitor *visitor); + +// attributes + ExpressionNode *expression; +}; + +class TryStatement: public Statement +{ +public: + TryStatement(Statement *stmt, Catch *c, Finally *f): + statement (stmt), catchExpression (c), finallyExpression (f) + { kind = Kind_TryStatement; } + + TryStatement(Statement *stmt, Finally *f): + statement (stmt), catchExpression (0), finallyExpression (f) + { kind = Kind_TryStatement; } + + TryStatement(Statement *stmt, Catch *c): + statement (stmt), catchExpression (c), finallyExpression (0) + { kind = Kind_TryStatement; } + + virtual ~TryStatement() {} + + virtual void accept0(Visitor *visitor); + +// attributes + Statement *statement; + Catch *catchExpression; + Finally *finallyExpression; +}; + +class Catch: public Node +{ +public: + Catch(JavaScriptNameIdImpl *n, Statement *stmt): + name (n), statement (stmt) + { kind = Kind_Catch; } + + virtual ~Catch() {} + + virtual void accept0(Visitor *visitor); + +// attributes + JavaScriptNameIdImpl *name; + Statement *statement; +}; + +class Finally: public Node +{ +public: + Finally(Statement *stmt): + statement (stmt) + { kind = Kind_Finally; } + + virtual ~Finally() {} + + virtual void accept0(Visitor *visitor); + +// attributes + Statement *statement; +}; + +class FunctionExpression: public ExpressionNode +{ +public: + FunctionExpression(JavaScriptNameIdImpl *n, FormalParameterList *f, FunctionBody *b): + name (n), formals (f), body (b) + { kind = Kind_FunctionExpression; } + + virtual ~FunctionExpression() {} + + virtual void accept0(Visitor *visitor); + +// attributes + JavaScriptNameIdImpl *name; + FormalParameterList *formals; + FunctionBody *body; + SourceLocation functionToken; + SourceLocation identifierToken; + SourceLocation lparenToken; + SourceLocation rparenToken; + SourceLocation lbraceToken; + SourceLocation rbraceToken; +}; + +class FunctionDeclaration: public FunctionExpression +{ +public: + FunctionDeclaration(JavaScriptNameIdImpl *n, FormalParameterList *f, FunctionBody *b): + FunctionExpression(n, f, b) + { kind = Kind_FunctionDeclaration; } + + virtual ~FunctionDeclaration() {} + + virtual void accept0(Visitor *visitor); +}; + +class FormalParameterList: public Node +{ +public: + FormalParameterList(JavaScriptNameIdImpl *n): + name (n), next (this) + { kind = Kind_FormalParameterList; } + + FormalParameterList(FormalParameterList *previous, JavaScriptNameIdImpl *n): + name (n) + { + kind = Kind_FormalParameterList; + next = previous->next; + previous->next = this; + } + + virtual ~FormalParameterList() {} + + virtual void accept0(Visitor *visitor); + + inline FormalParameterList *finish () + { + FormalParameterList *front = next; + next = 0; + return front; + } + +// attributes + JavaScriptNameIdImpl *name; + FormalParameterList *next; + SourceLocation commaToken; + SourceLocation identifierToken; +}; + +class FunctionBody: public Node +{ +public: + FunctionBody(SourceElements *elts): + elements (elts) + { kind = Kind_FunctionBody; } + + virtual ~FunctionBody() {} + + virtual void accept0(Visitor *visitor); + +// attributes + SourceElements *elements; +}; + +class Program: public Node +{ +public: + Program(SourceElements *elts): + elements (elts) + { kind = Kind_Program; } + + virtual ~Program() {} + + virtual void accept0(Visitor *visitor); + +// attributes + SourceElements *elements; +}; + +class SourceElements: public Node +{ +public: + SourceElements(SourceElement *elt): + element (elt), next (this) + { kind = Kind_SourceElements; } + + SourceElements(SourceElements *previous, SourceElement *elt): + element (elt) + { + kind = Kind_SourceElements; + next = previous->next; + previous->next = this; + } + + virtual ~SourceElements() {} + + virtual void accept0(Visitor *visitor); + + inline SourceElements *finish () + { + SourceElements *front = next; + next = 0; + return front; + } + +// attributes + SourceElement *element; + SourceElements *next; +}; + +class SourceElement: public Node +{ +public: + inline SourceElement() + { kind = Kind_SourceElement; } + + virtual ~SourceElement() {} +}; + +class FunctionSourceElement: public SourceElement +{ +public: + FunctionSourceElement(FunctionDeclaration *f): + declaration (f) + { kind = Kind_FunctionSourceElement; } + + virtual ~FunctionSourceElement() {} + + virtual void accept0(Visitor *visitor); + +// attributes + FunctionDeclaration *declaration; +}; + +class StatementSourceElement: public SourceElement +{ +public: + StatementSourceElement(Statement *stmt): + statement (stmt) + { kind = Kind_StatementSourceElement; } + + virtual ~StatementSourceElement() {} + + virtual void accept0(Visitor *visitor); + +// attributes + Statement *statement; +}; + +class DebuggerStatement: public Statement +{ +public: + DebuggerStatement() + { kind = Kind_DebuggerStatement; } + + virtual ~DebuggerStatement() {} + + virtual void accept0(Visitor *visitor); +}; + +class UiProgram: public Node +{ +public: + UiProgram(UiObjectMemberList *members) + : members(members) + { kind = Kind_UiProgram; } + + virtual void accept0(Visitor *visitor); + +// attributes + UiObjectMemberList *members; +}; + +class UiObjectMember: public Node +{ +}; + +class UiPublicMember: public UiObjectMember +{ +public: + UiPublicMember(JavaScriptNameIdImpl *type, + JavaScriptNameIdImpl *name) + : type(type), name(name), expression(0), initializer(0) + { kind = Kind_UiPublicMember; } + + UiPublicMember(JavaScriptNameIdImpl *type, + JavaScriptNameIdImpl *name, + ExpressionNode *expression, + UiObjectInitializer *initializer) + : type(type), name(name), + expression(expression), initializer(initializer) + { kind = Kind_UiPublicMember; } + + virtual void accept0(Visitor *visitor); + +// attributes + JavaScriptNameIdImpl *type; + JavaScriptNameIdImpl *name; + ExpressionNode *expression; + UiObjectInitializer *initializer; + SourceLocation publicToken; + SourceLocation attributeTypeToken; + SourceLocation identifierToken; + SourceLocation colonToken; +}; + +class UiObjectDefinition: public UiObjectMember +{ +public: + UiObjectDefinition(JavaScriptNameIdImpl *name, + UiObjectInitializer *initializer) + : name(name), initializer(initializer) + { kind = Kind_UiObjectDefinition; } + + virtual void accept0(Visitor *visitor); + +// attributes + JavaScriptNameIdImpl *name; + UiObjectInitializer *initializer; + SourceLocation identifierToken; +}; + +class UiObjectInitializer: public Node +{ +public: + UiObjectInitializer(UiObjectMemberList *members) + : members(members) + { kind = Kind_UiObjectInitializer; } + + virtual void accept0(Visitor *visitor); + +// attributes + SourceLocation lbraceToken; + UiObjectMemberList *members; + SourceLocation rbraceToken; +}; + +class UiObjectBinding: public UiObjectMember +{ +public: + UiObjectBinding(UiQualifiedId *qualifiedId, + JavaScriptNameIdImpl *name, + UiObjectInitializer *initializer) + : qualifiedId(qualifiedId), + name(name), + initializer(initializer) + { kind = Kind_UiObjectBinding; } + + virtual void accept0(Visitor *visitor); + +// attributes + UiQualifiedId *qualifiedId; + JavaScriptNameIdImpl *name; + UiObjectInitializer *initializer; + SourceLocation colonToken; + SourceLocation identifierToken; +}; + +class UiScriptBinding: public UiObjectMember +{ +public: + UiScriptBinding(UiQualifiedId *qualifiedId, + Statement *statement) + : qualifiedId(qualifiedId), + statement(statement) + { kind = Kind_UiScriptBinding; } + + virtual void accept0(Visitor *visitor); + +// attributes + UiQualifiedId *qualifiedId; + Statement *statement; + SourceLocation colonToken; +}; + +class UiArrayBinding: public UiObjectMember +{ +public: + UiArrayBinding(UiQualifiedId *qualifiedId, + UiObjectMemberList *members) + : qualifiedId(qualifiedId), + members(members) + { kind = Kind_UiArrayBinding; } + + virtual void accept0(Visitor *visitor); + +// attributes + UiQualifiedId *qualifiedId; + UiObjectMemberList *members; + SourceLocation colonToken; + SourceLocation lbracketToken; + SourceLocation rbraceToken; +}; + +class UiObjectMemberList: public Node +{ +public: + UiObjectMemberList(UiObjectMember *member) + : next(this), member(member) + { kind = Kind_UiObjectMemberList; } + + UiObjectMemberList(UiObjectMemberList *previous, UiObjectMember *member) + : member(member) + { + kind = Kind_UiObjectMemberList; + next = previous->next; + previous->next = this; + } + + virtual void accept0(Visitor *visitor); + + UiObjectMemberList *finish() + { + UiObjectMemberList *head = next; + next = 0; + return head; + } + +// attributes + UiObjectMemberList *next; + UiObjectMember *member; +}; + +class UiQualifiedId: public Node +{ +public: + UiQualifiedId(JavaScriptNameIdImpl *name) + : next(this), name(name) + { kind = Kind_UiQualifiedId; } + + UiQualifiedId(UiQualifiedId *previous, JavaScriptNameIdImpl *name) + : name(name) + { + kind = Kind_UiQualifiedId; + next = previous->next; + previous->next = this; + } + + virtual ~UiQualifiedId() {} + + UiQualifiedId *finish() + { + UiQualifiedId *head = next; + next = 0; + return head; + } + + virtual void accept0(Visitor *visitor); + +// attributes + UiQualifiedId *next; + JavaScriptNameIdImpl *name; + SourceLocation identifierToken; +}; + + +} } // namespace AST + + + +QT_END_NAMESPACE + +#endif diff --git a/src/declarative/qml/parser/javascriptastfwd_p.h b/src/declarative/qml/parser/javascriptastfwd_p.h new file mode 100644 index 0000000..946879a --- /dev/null +++ b/src/declarative/qml/parser/javascriptastfwd_p.h @@ -0,0 +1,160 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtScript 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 JAVASCRIPTAST_FWD_P_H +#define JAVASCRIPTAST_FWD_P_H + +#include + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +QT_BEGIN_NAMESPACE + +namespace JavaScript { namespace AST { + +class SourceLocation; + +class Visitor; +class Node; +class ExpressionNode; +class Statement; +class ThisExpression; +class IdentifierExpression; +class NullExpression; +class TrueLiteral; +class FalseLiteral; +class NumericLiteral; +class StringLiteral; +class RegExpLiteral; +class ArrayLiteral; +class ObjectLiteral; +class ElementList; +class Elision; +class PropertyNameAndValueList; +class PropertyName; +class IdentifierPropertyName; +class StringLiteralPropertyName; +class NumericLiteralPropertyName; +class ArrayMemberExpression; +class FieldMemberExpression; +class NewMemberExpression; +class NewExpression; +class CallExpression; +class ArgumentList; +class PostIncrementExpression; +class PostDecrementExpression; +class DeleteExpression; +class VoidExpression; +class TypeOfExpression; +class PreIncrementExpression; +class PreDecrementExpression; +class UnaryPlusExpression; +class UnaryMinusExpression; +class TildeExpression; +class NotExpression; +class BinaryExpression; +class ConditionalExpression; +class Expression; // ### rename +class Block; +class StatementList; +class VariableStatement; +class VariableDeclarationList; +class VariableDeclaration; +class EmptyStatement; +class ExpressionStatement; +class IfStatement; +class DoWhileStatement; +class WhileStatement; +class ForStatement; +class LocalForStatement; +class ForEachStatement; +class LocalForEachStatement; +class ContinueStatement; +class BreakStatement; +class ReturnStatement; +class WithStatement; +class SwitchStatement; +class CaseBlock; +class CaseClauses; +class CaseClause; +class DefaultClause; +class LabelledStatement; +class ThrowStatement; +class TryStatement; +class Catch; +class Finally; +class FunctionDeclaration; +class FunctionExpression; +class FormalParameterList; +class FunctionBody; +class Program; +class SourceElements; +class SourceElement; +class FunctionSourceElement; +class StatementSourceElement; +class DebuggerStatement; + +// ui elements +class UiProgram; +class UiPublicMember; +class UiObjectDefinition; +class UiObjectInitializer; +class UiObjectBinding; +class UiScriptBinding; +class UiArrayBinding; +class UiObjectMember; +class UiObjectMemberList; +class UiQualifiedId; + +} } // namespace AST + +QT_END_NAMESPACE + +#endif diff --git a/src/declarative/qml/parser/javascriptastvisitor.cpp b/src/declarative/qml/parser/javascriptastvisitor.cpp new file mode 100644 index 0000000..eac291d --- /dev/null +++ b/src/declarative/qml/parser/javascriptastvisitor.cpp @@ -0,0 +1,58 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtScript 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 "javascriptastvisitor_p.h" + +QT_BEGIN_NAMESPACE + +namespace JavaScript { namespace AST { + +Visitor::Visitor() +{ +} + +Visitor::~Visitor() +{ +} + +} } // namespace JavaScript::AST + +QT_END_NAMESPACE diff --git a/src/declarative/qml/parser/javascriptastvisitor_p.h b/src/declarative/qml/parser/javascriptastvisitor_p.h new file mode 100644 index 0000000..9e428cb --- /dev/null +++ b/src/declarative/qml/parser/javascriptastvisitor_p.h @@ -0,0 +1,317 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtScript 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 JAVASCRIPTASTVISITOR_P_H +#define JAVASCRIPTASTVISITOR_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include "javascriptastfwd_p.h" + +QT_BEGIN_NAMESPACE + +namespace JavaScript { namespace AST { + +class Visitor +{ +public: + Visitor(); + virtual ~Visitor(); + + virtual bool preVisit(Node *) { return true; } + virtual void postVisit(Node *) {} + + // Ui + virtual bool visit(UiProgram *) { return true; } + virtual bool visit(UiPublicMember *) { return true; } + virtual bool visit(UiObjectDefinition *) { return true; } + virtual bool visit(UiObjectInitializer *) { return true; } + virtual bool visit(UiObjectBinding *) { return true; } + virtual bool visit(UiScriptBinding *) { return true; } + virtual bool visit(UiArrayBinding *) { return true; } + virtual bool visit(UiObjectMemberList *) { return true; } + virtual bool visit(UiQualifiedId *) { return true; } + + virtual void endVisit(UiProgram *) {} + virtual void endVisit(UiPublicMember *) {} + virtual void endVisit(UiObjectDefinition *) {} + virtual void endVisit(UiObjectInitializer *) {} + virtual void endVisit(UiObjectBinding *) {} + virtual void endVisit(UiScriptBinding *) {} + virtual void endVisit(UiArrayBinding *) {} + virtual void endVisit(UiObjectMemberList *) {} + virtual void endVisit(UiQualifiedId *) {} + + // JavaScript + virtual bool visit(ThisExpression *) { return true; } + virtual void endVisit(ThisExpression *) {} + + virtual bool visit(IdentifierExpression *) { return true; } + virtual void endVisit(IdentifierExpression *) {} + + virtual bool visit(NullExpression *) { return true; } + virtual void endVisit(NullExpression *) {} + + virtual bool visit(TrueLiteral *) { return true; } + virtual void endVisit(TrueLiteral *) {} + + virtual bool visit(FalseLiteral *) { return true; } + virtual void endVisit(FalseLiteral *) {} + + virtual bool visit(StringLiteral *) { return true; } + virtual void endVisit(StringLiteral *) {} + + virtual bool visit(NumericLiteral *) { return true; } + virtual void endVisit(NumericLiteral *) {} + + virtual bool visit(RegExpLiteral *) { return true; } + virtual void endVisit(RegExpLiteral *) {} + + virtual bool visit(ArrayLiteral *) { return true; } + virtual void endVisit(ArrayLiteral *) {} + + virtual bool visit(ObjectLiteral *) { return true; } + virtual void endVisit(ObjectLiteral *) {} + + virtual bool visit(ElementList *) { return true; } + virtual void endVisit(ElementList *) {} + + virtual bool visit(Elision *) { return true; } + virtual void endVisit(Elision *) {} + + virtual bool visit(PropertyNameAndValueList *) { return true; } + virtual void endVisit(PropertyNameAndValueList *) {} + + virtual bool visit(IdentifierPropertyName *) { return true; } + virtual void endVisit(IdentifierPropertyName *) {} + + virtual bool visit(StringLiteralPropertyName *) { return true; } + virtual void endVisit(StringLiteralPropertyName *) {} + + virtual bool visit(NumericLiteralPropertyName *) { return true; } + virtual void endVisit(NumericLiteralPropertyName *) {} + + virtual bool visit(ArrayMemberExpression *) { return true; } + virtual void endVisit(ArrayMemberExpression *) {} + + virtual bool visit(FieldMemberExpression *) { return true; } + virtual void endVisit(FieldMemberExpression *) {} + + virtual bool visit(NewMemberExpression *) { return true; } + virtual void endVisit(NewMemberExpression *) {} + + virtual bool visit(NewExpression *) { return true; } + virtual void endVisit(NewExpression *) {} + + virtual bool visit(CallExpression *) { return true; } + virtual void endVisit(CallExpression *) {} + + virtual bool visit(ArgumentList *) { return true; } + virtual void endVisit(ArgumentList *) {} + + virtual bool visit(PostIncrementExpression *) { return true; } + virtual void endVisit(PostIncrementExpression *) {} + + virtual bool visit(PostDecrementExpression *) { return true; } + virtual void endVisit(PostDecrementExpression *) {} + + virtual bool visit(DeleteExpression *) { return true; } + virtual void endVisit(DeleteExpression *) {} + + virtual bool visit(VoidExpression *) { return true; } + virtual void endVisit(VoidExpression *) {} + + virtual bool visit(TypeOfExpression *) { return true; } + virtual void endVisit(TypeOfExpression *) {} + + virtual bool visit(PreIncrementExpression *) { return true; } + virtual void endVisit(PreIncrementExpression *) {} + + virtual bool visit(PreDecrementExpression *) { return true; } + virtual void endVisit(PreDecrementExpression *) {} + + virtual bool visit(UnaryPlusExpression *) { return true; } + virtual void endVisit(UnaryPlusExpression *) {} + + virtual bool visit(UnaryMinusExpression *) { return true; } + virtual void endVisit(UnaryMinusExpression *) {} + + virtual bool visit(TildeExpression *) { return true; } + virtual void endVisit(TildeExpression *) {} + + virtual bool visit(NotExpression *) { return true; } + virtual void endVisit(NotExpression *) {} + + virtual bool visit(BinaryExpression *) { return true; } + virtual void endVisit(BinaryExpression *) {} + + virtual bool visit(ConditionalExpression *) { return true; } + virtual void endVisit(ConditionalExpression *) {} + + virtual bool visit(Expression *) { return true; } + virtual void endVisit(Expression *) {} + + virtual bool visit(Block *) { return true; } + virtual void endVisit(Block *) {} + + virtual bool visit(StatementList *) { return true; } + virtual void endVisit(StatementList *) {} + + virtual bool visit(VariableStatement *) { return true; } + virtual void endVisit(VariableStatement *) {} + + virtual bool visit(VariableDeclarationList *) { return true; } + virtual void endVisit(VariableDeclarationList *) {} + + virtual bool visit(VariableDeclaration *) { return true; } + virtual void endVisit(VariableDeclaration *) {} + + virtual bool visit(EmptyStatement *) { return true; } + virtual void endVisit(EmptyStatement *) {} + + virtual bool visit(ExpressionStatement *) { return true; } + virtual void endVisit(ExpressionStatement *) {} + + virtual bool visit(IfStatement *) { return true; } + virtual void endVisit(IfStatement *) {} + + virtual bool visit(DoWhileStatement *) { return true; } + virtual void endVisit(DoWhileStatement *) {} + + virtual bool visit(WhileStatement *) { return true; } + virtual void endVisit(WhileStatement *) {} + + virtual bool visit(ForStatement *) { return true; } + virtual void endVisit(ForStatement *) {} + + virtual bool visit(LocalForStatement *) { return true; } + virtual void endVisit(LocalForStatement *) {} + + virtual bool visit(ForEachStatement *) { return true; } + virtual void endVisit(ForEachStatement *) {} + + virtual bool visit(LocalForEachStatement *) { return true; } + virtual void endVisit(LocalForEachStatement *) {} + + virtual bool visit(ContinueStatement *) { return true; } + virtual void endVisit(ContinueStatement *) {} + + virtual bool visit(BreakStatement *) { return true; } + virtual void endVisit(BreakStatement *) {} + + virtual bool visit(ReturnStatement *) { return true; } + virtual void endVisit(ReturnStatement *) {} + + virtual bool visit(WithStatement *) { return true; } + virtual void endVisit(WithStatement *) {} + + virtual bool visit(SwitchStatement *) { return true; } + virtual void endVisit(SwitchStatement *) {} + + virtual bool visit(CaseBlock *) { return true; } + virtual void endVisit(CaseBlock *) {} + + virtual bool visit(CaseClauses *) { return true; } + virtual void endVisit(CaseClauses *) {} + + virtual bool visit(CaseClause *) { return true; } + virtual void endVisit(CaseClause *) {} + + virtual bool visit(DefaultClause *) { return true; } + virtual void endVisit(DefaultClause *) {} + + virtual bool visit(LabelledStatement *) { return true; } + virtual void endVisit(LabelledStatement *) {} + + virtual bool visit(ThrowStatement *) { return true; } + virtual void endVisit(ThrowStatement *) {} + + virtual bool visit(TryStatement *) { return true; } + virtual void endVisit(TryStatement *) {} + + virtual bool visit(Catch *) { return true; } + virtual void endVisit(Catch *) {} + + virtual bool visit(Finally *) { return true; } + virtual void endVisit(Finally *) {} + + virtual bool visit(FunctionDeclaration *) { return true; } + virtual void endVisit(FunctionDeclaration *) {} + + virtual bool visit(FunctionExpression *) { return true; } + virtual void endVisit(FunctionExpression *) {} + + virtual bool visit(FormalParameterList *) { return true; } + virtual void endVisit(FormalParameterList *) {} + + virtual bool visit(FunctionBody *) { return true; } + virtual void endVisit(FunctionBody *) {} + + virtual bool visit(Program *) { return true; } + virtual void endVisit(Program *) {} + + virtual bool visit(SourceElements *) { return true; } + virtual void endVisit(SourceElements *) {} + + virtual bool visit(FunctionSourceElement *) { return true; } + virtual void endVisit(FunctionSourceElement *) {} + + virtual bool visit(StatementSourceElement *) { return true; } + virtual void endVisit(StatementSourceElement *) {} + + virtual bool visit(DebuggerStatement *) { return true; } + virtual void endVisit(DebuggerStatement *) {} +}; + +} } // namespace AST + +QT_END_NAMESPACE + +#endif // JAVASCRIPTASTVISITOR_P_H diff --git a/src/declarative/qml/parser/javascriptengine_p.cpp b/src/declarative/qml/parser/javascriptengine_p.cpp new file mode 100644 index 0000000..ca15b75 --- /dev/null +++ b/src/declarative/qml/parser/javascriptengine_p.cpp @@ -0,0 +1,157 @@ +/************************************************************************** +** +** This file is part of Qt Creator +** +** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Qt Software Information (qt-info@nokia.com) +** +** Commercial Usage +** +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** 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. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** +**************************************************************************/ + +#include "javascriptengine_p.h" +#include "javascriptnodepool_p.h" +#include "javascriptvalue.h" +#include +#include + +QT_BEGIN_NAMESPACE + +namespace JavaScript { + +QString numberToString(qjsreal value) +{ return QString::number(value); } + +int Ecma::RegExp::flagFromChar(const QChar &ch) +{ + static QHash flagsHash; + if (flagsHash.isEmpty()) { + flagsHash[QLatin1Char('g')] = Global; + flagsHash[QLatin1Char('i')] = IgnoreCase; + flagsHash[QLatin1Char('m')] = Multiline; + } + QHash::const_iterator it; + it = flagsHash.constFind(ch); + if (it == flagsHash.constEnd()) + return 0; + return it.value(); +} + +QString Ecma::RegExp::flagsToString(int flags) +{ + QString result; + if (flags & Global) + result += QLatin1Char('g'); + if (flags & IgnoreCase) + result += QLatin1Char('i'); + if (flags & Multiline) + result += QLatin1Char('m'); + return result; +} + +NodePool::NodePool(const QString &fileName, JavaScriptEnginePrivate *engine) + : m_fileName(fileName), m_engine(engine) +{ +} + +NodePool::~NodePool() +{ +} + +Code *NodePool::createCompiledCode(AST::Node *, CompilationUnit &) +{ + Q_ASSERT(0); + return 0; +} + +static int toDigit(char c) +{ + if ((c >= '0') && (c <= '9')) + return c - '0'; + else if ((c >= 'a') && (c <= 'z')) + return 10 + c - 'a'; + else if ((c >= 'A') && (c <= 'Z')) + return 10 + c - 'A'; + return -1; +} + +qjsreal integerFromString(const char *buf, int size, int radix) +{ + if (size == 0) + return qSNaN(); + + qjsreal sign = 1.0; + int i = 0; + if (buf[0] == '+') { + ++i; + } else if (buf[0] == '-') { + sign = -1.0; + ++i; + } + + if (((size-i) >= 2) && (buf[i] == '0')) { + if (((buf[i+1] == 'x') || (buf[i+1] == 'X')) + && (radix < 34)) { + if ((radix != 0) && (radix != 16)) + return 0; + radix = 16; + i += 2; + } else { + if (radix == 0) { + radix = 8; + ++i; + } + } + } else if (radix == 0) { + radix = 10; + } + + int j = i; + for ( ; i < size; ++i) { + int d = toDigit(buf[i]); + if ((d == -1) || (d >= radix)) + break; + } + qjsreal result; + if (j == i) { + if (!qstrcmp(buf, "Infinity")) + result = qInf(); + else + result = qSNaN(); + } else { + result = 0; + qjsreal multiplier = 1; + for (--i ; i >= j; --i, multiplier *= radix) + result += toDigit(buf[i]) * multiplier; + } + result *= sign; + return result; +} + +qjsreal integerFromString(const QString &str, int radix) +{ + QByteArray ba = str.trimmed().toUtf8(); + return integerFromString(ba.constData(), ba.size(), radix); +} + +} // end of namespace JavaScript + +QT_END_NAMESPACE diff --git a/src/declarative/qml/parser/javascriptengine_p.h b/src/declarative/qml/parser/javascriptengine_p.h new file mode 100644 index 0000000..1e6e568 --- /dev/null +++ b/src/declarative/qml/parser/javascriptengine_p.h @@ -0,0 +1,144 @@ +/************************************************************************** +** +** This file is part of Qt Creator +** +** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Qt Software Information (qt-info@nokia.com) +** +** Commercial Usage +** +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** 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. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** +**************************************************************************/ + +#ifndef JAVASCRIPTENGINE_P_H +#define JAVASCRIPTENGINE_P_H + +#include "javascriptvalue.h" +#include +#include + +QT_BEGIN_NAMESPACE + +namespace JavaScript { + +class Node; +class Lexer; +class NodePool; + +namespace AST { + +class Node; + +} // end of namespace AST + +namespace Ecma { + +class RegExp +{ +public: + enum RegExpFlag { + Global = 0x01, + IgnoreCase = 0x02, + Multiline = 0x04 + }; + +public: + static int flagFromChar(const QChar &); + static QString flagsToString(int flags); +}; + +} // end of namespace Ecma + +} // end of namespace JavaScript + + + +class JavaScriptNameIdImpl +{ + QString _text; + +public: + JavaScriptNameIdImpl(const QChar *u, int s) + : _text(u, s) + { } + + const QString asString() const + { return _text; } + + bool operator == (const JavaScriptNameIdImpl &other) const + { return _text == other._text; } + + bool operator != (const JavaScriptNameIdImpl &other) const + { return _text != other._text; } + + bool operator < (const JavaScriptNameIdImpl &other) const + { return _text < other._text; } +}; + +inline uint qHash(const JavaScriptNameIdImpl &id) +{ return qHash(id.asString()); } + +class JavaScriptEnginePrivate +{ + JavaScript::Lexer *_lexer; + JavaScript::NodePool *_nodePool; + JavaScript::AST::Node *_ast; + QSet _literals; + +public: + JavaScriptEnginePrivate() + : _lexer(0), _nodePool(0), _ast(0) + { } + + QSet literals() const + { return _literals; } + + JavaScriptNameIdImpl *intern(const QChar *u, int s) + { return const_cast(&*_literals.insert(JavaScriptNameIdImpl(u, s))); } + + static QString toString(JavaScriptNameIdImpl *id) + { return id->asString(); } + + JavaScript::Lexer *lexer() const + { return _lexer; } + + void setLexer(JavaScript::Lexer *lexer) + { _lexer = lexer; } + + JavaScript::NodePool *nodePool() const + { return _nodePool; } + + void setNodePool(JavaScript::NodePool *nodePool) + { _nodePool = nodePool; } + + JavaScript::AST::Node *ast() const + { return _ast; } + + JavaScript::AST::Node *changeAbstractSyntaxTree(JavaScript::AST::Node *node) + { + JavaScript::AST::Node *previousAST = _ast; + _ast = node; + return previousAST; + } +}; + +QT_END_NAMESPACE + +#endif // JAVASCRIPTENGINE_P_H diff --git a/src/declarative/qml/parser/javascriptgrammar.cpp b/src/declarative/qml/parser/javascriptgrammar.cpp new file mode 100644 index 0000000..a8da9a6 --- /dev/null +++ b/src/declarative/qml/parser/javascriptgrammar.cpp @@ -0,0 +1,623 @@ +// This file was generated by qlalr - DO NOT EDIT! +#include "javascriptgrammar_p.h" + +const char *const JavaScriptGrammar::spell [] = { + "end of file", "&", "&&", "&=", "break", "case", "catch", ":", ";", "continue", + "default", "delete", "/", "/=", "do", ".", "else", "=", "==", "===", + "finally", "for", "function", ">=", ">", ">>", ">>=", ">>>", ">>>=", "identifier", + "if", "in", "instanceof", "{", "[", "<=", "(", "<", "<<", "<<=", + "-", "-=", "--", "new", "!", "!=", "!==", "numeric literal", "|", "|=", + "||", "+", "+=", "++", "?", "}", "]", "%", "%=", "return", + ")", ";", 0, "*", "*=", "string literal", "switch", "this", "throw", "~", + "try", "typeof", "var", "void", "while", "with", "^", "^=", "null", "true", + "false", "const", "debugger", "reserved word", "public", 0, 0}; + +const int JavaScriptGrammar::lhs [] = { + 87, 89, 88, 88, 88, 91, 90, 90, 90, 90, + 90, 90, 90, 92, 92, 95, 95, 95, 95, 95, + 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, + 97, 97, 101, 101, 96, 96, 99, 99, 102, 102, + 102, 102, 103, 103, 103, 103, 103, 103, 103, 103, + 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, + 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, + 103, 103, 103, 104, 104, 105, 105, 105, 105, 105, + 108, 108, 109, 109, 109, 109, 107, 107, 110, 110, + 111, 111, 112, 112, 112, 113, 113, 113, 113, 113, + 113, 113, 113, 113, 113, 114, 114, 114, 114, 115, + 115, 115, 116, 116, 116, 116, 117, 117, 117, 117, + 117, 117, 117, 118, 118, 118, 118, 118, 118, 119, + 119, 119, 119, 119, 120, 120, 120, 120, 120, 121, + 121, 122, 122, 123, 123, 124, 124, 125, 125, 126, + 126, 127, 127, 128, 128, 129, 129, 130, 130, 131, + 131, 132, 132, 100, 100, 133, 133, 134, 134, 134, + 134, 134, 134, 134, 134, 134, 134, 134, 134, 94, + 94, 135, 135, 136, 136, 137, 137, 93, 93, 93, + 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, + 93, 93, 138, 154, 154, 153, 153, 139, 139, 155, + 155, 156, 156, 158, 158, 157, 159, 162, 160, 160, + 163, 161, 161, 140, 141, 141, 142, 142, 143, 143, + 143, 143, 143, 143, 143, 144, 144, 144, 144, 145, + 145, 145, 145, 146, 146, 147, 149, 164, 164, 167, + 167, 165, 165, 168, 166, 148, 150, 150, 151, 151, + 151, 169, 170, 152, 152, 171, 106, 175, 175, 172, + 172, 173, 173, 176, 177, 177, 178, 178, 174, 174, + 98, 98, 179}; + +const int JavaScriptGrammar:: rhs[] = { + 1, 0, 1, 3, 3, 3, 4, 2, 5, 3, + 6, 3, 5, 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, 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, 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 [] = { + 0, 0, 14, 0, 3, 2, 0, 283, 0, 8, + 2, 0, 0, 6, 4, 5, 0, 12, 0, 113, + 180, 144, 152, 148, 92, 164, 140, 13, 77, 93, + 156, 160, 81, 110, 91, 96, 76, 130, 117, 0, + 23, 24, 20, 279, 17, 281, 35, 0, 0, 0, + 0, 0, 18, 21, 0, 0, 22, 16, 0, 19, + 0, 0, 106, 0, 0, 93, 112, 95, 94, 0, + 0, 0, 108, 109, 107, 111, 0, 141, 0, 0, + 0, 0, 131, 0, 0, 0, 0, 0, 0, 121, + 0, 0, 0, 115, 116, 114, 119, 123, 122, 120, + 118, 133, 132, 134, 0, 149, 0, 145, 0, 0, + 87, 86, 75, 43, 44, 45, 70, 46, 71, 47, + 48, 49, 50, 51, 52, 53, 54, 74, 55, 56, + 57, 58, 59, 72, 60, 61, 62, 63, 64, 65, + 66, 67, 68, 69, 73, 0, 0, 85, 181, 88, + 0, 89, 0, 90, 84, 11, 0, 177, 170, 168, + 175, 176, 174, 173, 179, 172, 171, 169, 178, 165, + 0, 153, 0, 0, 157, 0, 0, 161, 0, 0, + 87, 79, 0, 78, 0, 83, 97, 0, 280, 270, + 271, 0, 268, 0, 269, 0, 272, 188, 195, 194, + 202, 190, 0, 191, 273, 0, 278, 192, 193, 198, + 196, 275, 274, 277, 199, 0, 210, 0, 0, 0, + 0, 279, 17, 0, 281, 182, 224, 0, 0, 0, + 211, 0, 0, 200, 201, 0, 189, 197, 225, 226, + 267, 276, 240, 0, 241, 242, 243, 236, 0, 237, + 238, 239, 264, 265, 0, 0, 0, 0, 0, 229, + 230, 186, 184, 146, 154, 150, 166, 142, 187, 0, + 93, 158, 162, 135, 124, 0, 0, 143, 0, 0, + 0, 0, 136, 0, 0, 0, 0, 0, 128, 126, + 129, 127, 125, 138, 137, 139, 0, 151, 0, 147, + 0, 185, 93, 0, 167, 182, 183, 0, 182, 0, + 0, 232, 0, 0, 0, 234, 0, 155, 0, 0, + 159, 0, 0, 163, 222, 0, 214, 223, 217, 0, + 221, 0, 182, 215, 0, 182, 0, 0, 233, 0, + 0, 0, 235, 280, 270, 0, 0, 272, 0, 266, + 0, 256, 0, 0, 0, 228, 0, 227, 0, 282, + 0, 42, 204, 207, 0, 43, 70, 46, 71, 48, + 49, 20, 53, 54, 17, 55, 58, 18, 21, 182, + 22, 61, 16, 63, 19, 65, 66, 67, 68, 69, + 73, 0, 37, 0, 0, 39, 41, 29, 40, 0, + 38, 28, 205, 203, 81, 82, 87, 0, 80, 0, + 244, 245, 0, 0, 0, 247, 252, 250, 253, 0, + 0, 251, 252, 0, 248, 0, 249, 206, 255, 0, + 206, 254, 0, 257, 258, 0, 206, 259, 260, 0, + 0, 261, 0, 0, 0, 262, 263, 99, 98, 0, + 0, 0, 231, 0, 0, 0, 246, 219, 212, 0, + 220, 216, 0, 218, 208, 0, 209, 213, 0, 36, + 0, 33, 35, 26, 0, 32, 27, 34, 31, 25, + 0, 30, 103, 101, 105, 102, 100, 104, 0, 0, + 10, 17, 35, 7, 2, 9, 15}; + +const int JavaScriptGrammar::goto_default [] = { + 1, 5, 11, 4, 9, 6, 362, 202, 36, 470, + 468, 360, 359, 20, 469, 358, 361, 111, 32, 28, + 150, 34, 24, 149, 29, 35, 62, 33, 19, 38, + 37, 273, 26, 267, 21, 263, 23, 265, 22, 264, + 30, 271, 31, 272, 25, 266, 262, 303, 409, 268, + 269, 197, 236, 201, 203, 207, 208, 199, 198, 210, + 237, 209, 214, 233, 234, 200, 364, 363, 235, 459, + 458, 325, 326, 461, 328, 460, 327, 415, 419, 422, + 418, 417, 437, 438, 206, 191, 205, 187, 190, 204, + 212, 211, 0}; + +const int JavaScriptGrammar::action_index [] = { + 107, 43, -3, -8, -87, 144, 165, -87, 122, -87, + 135, 120, 111, -87, -87, -87, -22, 3, 567, 127, + -87, 13, -36, -63, 192, -87, 220, 106, -87, 407, + 81, 78, 195, 177, -87, -87, -87, 317, 259, 567, + -87, -87, -87, 34, -87, 1041, 52, 567, 567, 567, + 349, 567, -87, -87, 567, 567, -87, -87, 567, -87, + 567, 567, -87, 567, 567, 108, 162, -87, -87, 567, + 567, 567, -87, -87, -87, 146, 567, 204, 567, 567, + 567, 567, 280, 567, 567, 567, 567, 567, 567, 154, + 567, 567, 567, 82, 87, 97, 259, 259, 259, 259, + 259, 300, 290, 270, 567, -65, 567, 17, 958, 567, + 567, -87, -87, -87, -87, -87, -87, -87, -87, -87, + -87, -87, -87, -87, -87, -87, -87, -87, -87, -87, + -87, -87, -87, -87, -87, -87, -87, -87, -87, -87, + -87, -87, -87, -87, -87, 113, 567, -87, -87, 49, + -1, -87, 567, -87, -87, -87, 567, -87, -87, -87, + -87, -87, -87, -87, -87, -87, -87, -87, -87, -87, + 567, 38, 567, 567, 64, 58, 567, -87, 958, 567, + 567, -87, 117, -87, 2, -87, -87, 36, -87, 46, + 63, 20, -87, 40, -87, 35, 1373, -87, -87, -87, + -87, -87, 138, -87, -87, 1, -87, -87, -87, -87, + -87, -87, 1373, -87, -87, 136, -87, 153, 109, 1290, + 60, 65, 85, 59, 1456, 567, -87, 48, 567, 57, + -87, 53, 51, -87, -87, 56, -87, -87, -87, -87, + -87, -87, -87, 80, -87, -87, -87, -87, 68, -87, + -87, -87, -87, -87, -57, -16, 567, 197, 115, -87, + -87, 875, -87, 4, -48, -72, -87, 214, -2, -59, + 449, 14, 114, 323, 259, 8, 567, 223, 567, 567, + 567, 567, 238, 567, 567, 567, 567, 567, 259, 259, + 259, 259, 259, 255, 221, 248, 567, -43, 567, 118, + 567, -87, 491, 567, -87, 567, 23, -29, 567, -34, + 1290, -87, 567, 126, 1290, -87, 567, -39, 567, 567, + 6, 32, 567, -87, 11, 99, 7, -87, -87, 567, + -87, 0, 567, -87, -38, 567, -33, 1290, -87, 567, + 103, 1290, -87, -11, 5, -24, 9, 1373, -10, -87, + 1290, -87, 567, 94, 1290, 30, 1290, -87, 37, 33, + -20, -87, -87, 1290, -15, 159, -5, 155, 62, 567, + 1290, -4, -35, 79, 15, -17, 375, 67, 41, 799, + 70, 61, 84, 567, 86, 66, 567, 69, 567, 16, + 22, 567, -87, 1124, 54, -87, -87, -87, -87, 567, + -87, -87, -87, -87, 160, -87, 567, -9, -87, 55, + -87, -87, 567, 102, -18, -87, 73, -87, 77, 90, + 567, -87, 83, 74, -87, 24, -87, 1290, -87, 105, + 1290, -87, 175, -87, -87, 100, 1290, 29, -87, 19, + 21, -87, 44, 10, 31, -87, -87, -87, -87, 567, + 95, 1290, -87, 567, 96, 1290, -87, 50, -87, 151, + -87, -87, 567, -87, -87, 47, -87, -87, 101, 45, + 719, -87, 42, -87, 643, -87, -87, -87, -87, -87, + 93, -87, -87, -87, -87, -87, -87, -87, 1207, 18, + -87, 98, 179, -87, 110, -87, -87, + + -93, -93, -93, -93, -93, -93, -93, -93, 23, -93, + -93, 16, 18, -93, -93, -93, -93, -93, 28, -93, + -93, -93, -93, -93, -93, -93, -93, 29, -93, -31, + -93, -93, -93, -93, -93, -93, -93, -93, -93, 107, + -93, -93, -93, -93, -93, -93, -93, -1, 126, 123, + 118, 98, -93, -93, 138, 218, -93, -93, 97, -93, + 93, 88, -93, 81, 143, -93, -93, -93, -93, 149, + 101, 120, -93, -93, -93, -93, 110, -93, 102, 150, + 142, 141, -93, 127, 66, 64, 67, 68, 74, -93, + 49, 55, 58, -93, -93, -93, -93, -93, -93, -93, + -93, -93, -93, -93, 77, -93, 70, -93, 46, 52, + 35, -93, -93, -93, -93, -93, -93, -93, -93, -93, + -93, -93, -93, -93, -93, -93, -93, -93, -93, -93, + -93, -93, -93, -93, -93, -93, -93, -93, -93, -93, + -93, -93, -93, -93, -93, -93, -4, -93, -93, -93, + -93, -93, 45, -93, -93, -93, 42, -93, -93, -93, + -93, -93, -93, -93, -93, -93, -93, -93, -93, -93, + 61, -93, 144, 33, -93, -93, -9, -93, 112, 5, + 117, -93, -93, -93, -93, -93, -93, -93, -93, -93, + -93, -93, -93, -93, -93, -93, 25, -93, -93, -93, + -93, -93, -93, -93, -93, -93, -93, -93, -93, -93, + -93, -93, 69, -93, -93, -93, -93, -93, -93, 11, + -93, -93, -93, -93, -93, 34, -93, -93, 30, -23, + -93, -93, -93, -93, -93, -93, -93, -93, -93, -93, + -93, -93, -93, -93, -93, -93, -93, -93, -93, -93, + -93, -93, -93, -93, -93, -93, 57, -93, -93, -93, + -93, 114, -93, -93, -93, -93, -93, -93, -93, -93, + -93, -93, -93, -93, -93, -93, 162, -93, 191, 192, + 175, 201, -93, 60, 82, 91, 124, 116, -93, -93, + -93, -93, -93, -93, -93, -93, 153, -93, 172, -93, + 164, -93, -93, 154, -93, 128, -93, -93, 62, -93, + 20, -93, 15, -93, 14, -93, 174, -93, 188, 165, + -93, -93, 163, -93, -93, -93, -93, -93, -93, 173, + -93, -57, 111, -93, -93, 59, -93, -6, -93, 56, + -93, 38, -93, -93, -49, -93, -93, 72, -93, -93, + 54, -93, 44, -93, 47, -93, 48, -93, -93, -93, + -93, -93, -93, 51, -93, -93, -93, -93, -93, 76, + 43, -93, -93, -93, -93, -93, 50, -93, -93, 36, + -93, -93, -93, 40, -93, -22, 137, -93, 131, -93, + -93, 39, -93, 41, -93, -93, -93, -93, -93, 37, + -93, -93, -93, -93, -93, -93, 96, -93, -93, -93, + -93, -93, 27, -93, -93, -93, -93, -93, -80, -93, + 80, -93, -65, -93, -93, -93, -93, -55, -93, -93, + -56, -93, -93, -93, -93, -93, -93, -75, -93, -93, + -44, -93, -93, -93, -37, -93, -93, -93, -93, -5, + -93, -3, -93, -2, -93, 12, -93, -93, -93, -93, + -93, -93, 26, -93, -93, -43, -93, -93, -93, -93, + 32, -93, 31, -93, 19, -93, -93, -93, -93, -93, + -93, -93, -93, -93, -93, -93, -93, -93, 24, -93, + -93, 21, 22, -93, -93, -93, -93}; + +const int JavaScriptGrammar::action_info [] = { + 296, 261, 305, -51, 298, 276, 300, 17, 316, 296, + 18, 106, 104, 106, 76, 416, 316, 255, 76, 352, + 256, 16, -39, 335, -210, 344, 310, 337, 329, 324, + 8, 146, 308, 298, 192, 401, 346, 324, 339, 322, + 403, 393, 347, 7, 391, 349, 356, 496, -41, 440, + 471, 408, 449, 477, 436, 442, 240, 152, 453, 154, + 471, 399, 185, 188, 436, 176, 170, 462, 196, 194, + 444, 193, 189, 443, -59, 192, 457, -40, 420, 426, + 195, 427, 420, 170, 412, 457, 104, 453, 420, 449, + 436, -62, 350, -64, 343, 352, 261, 412, -211, 436, + 423, 146, 146, 146, 146, 350, 439, 331, 188, 472, + 146, 146, 430, 146, 146, -279, 411, 410, 12, 276, + 440, 146, 63, 253, 252, 146, 0, 63, 172, 251, + 250, 8, 173, 64, 146, 0, 2, 63, 64, 8, + 2, 246, 245, 12, -1, 424, 146, 0, 64, 2, + 67, 2, 12, 481, 354, 451, 455, 473, 69, 465, + 332, 68, 414, 341, 318, 243, 495, 63, 319, 147, + 253, 252, 488, 183, 69, 178, 260, 259, 64, 90, + 489, 91, 248, 146, 248, 0, 314, 471, 243, 69, + 13, 3, 92, 0, 179, 3, 406, 244, 242, 239, + 238, 0, 0, 70, 3, 146, 3, 108, 2, 71, + 178, 0, 466, 464, 249, 247, 249, 247, 0, 70, + 244, 242, 78, 79, 0, 71, 109, 0, 110, 179, + 0, 180, 278, 279, 70, 0, 434, 433, 78, 79, + 71, 278, 279, 0, 283, 284, 0, 0, 0, 80, + 81, 0, 0, 285, 0, 0, 286, 258, 287, 280, + 281, 283, 284, 3, 0, 80, 81, 0, 280, 281, + 285, 283, 284, 286, 0, 287, 0, 0, 283, 284, + 285, 0, 0, 286, 90, 287, 91, 285, 0, 0, + 286, 0, 287, 83, 84, 0, 0, 92, 0, 0, + 0, 85, 86, 83, 84, 87, 0, 88, 0, 0, + 0, 85, 86, 83, 84, 87, 0, 88, 0, 0, + 0, 85, 86, 83, 84, 87, 0, 88, 0, 0, + 0, 85, 86, 0, 0, 87, 0, 88, 0, 0, + 83, 84, 0, 0, 0, 0, 283, 284, 85, 86, + 0, 0, 87, 0, 88, 285, 0, 0, 286, 0, + 287, 40, 41, 0, 0, 0, 0, 0, 0, 0, + 0, 43, 0, 0, 0, 0, 0, 0, 44, 0, + 0, 0, 45, 46, 0, 47, 0, 40, 41, 0, + 0, 0, 50, 0, 0, 0, 53, 43, 0, 0, + 0, 0, 0, 0, 44, 0, 0, 0, 45, 46, + 157, 47, 0, 0, 56, 0, 57, 0, 50, 0, + 158, 0, 53, 0, 159, 0, 0, 52, 59, 42, + 0, 0, 0, 160, 0, 161, 0, 0, 0, 0, + 56, 0, 57, 0, 0, 0, 162, 0, 163, 67, + 0, 0, 157, 52, 59, 42, 164, 0, 0, 165, + 68, 0, 158, 0, 0, 166, 159, 0, 0, 0, + 0, 167, 0, 0, 0, 160, 0, 161, 0, 0, + 312, 0, 0, 0, 168, 0, 0, 0, 162, 0, + 163, 67, 0, 0, 157, 0, 0, 0, 164, 0, + 0, 165, 68, 0, 158, 0, 0, 166, 159, 0, + 0, 0, 0, 167, 0, 0, 0, 160, 0, 161, + 0, 0, 0, 0, 0, 0, 168, 0, 0, 0, + 162, 0, 163, 67, 0, 0, 0, 0, 0, 0, + 164, 0, 0, 165, 68, 0, 0, 0, 0, 166, + 0, 0, 0, 0, 0, 167, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 168, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 39, 40, + 41, 0, 0, 0, 0, 0, 0, 0, 0, 43, + 0, 0, 0, 0, 0, 0, 44, 0, 0, 0, + 45, 46, 0, 47, 0, 0, 0, 48, 0, 49, + 50, 51, 0, 0, 53, 0, 0, 0, 54, 0, + 55, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 56, 0, 57, 0, 58, 0, 60, 0, + 61, 0, 0, 0, 0, 52, 59, 42, 0, 0, + 0, 0, 0, 0, 39, 40, 41, 0, 0, 0, + 0, 0, 0, 0, 0, 43, 0, 0, 0, 0, + 0, 0, 44, 0, 0, 0, 45, 46, 0, 47, + 0, 0, 0, 48, 0, 49, 50, 51, 0, 0, + 53, 0, 0, 0, 54, 0, 55, 0, 0, 476, + 0, 0, 0, 0, 0, 0, 0, 0, 56, 0, + 57, 0, 58, 0, 60, 0, 61, 0, 0, 0, + 0, 52, 59, 42, 0, 0, 0, 0, 0, 0, + 39, 40, 41, 0, 0, 0, 0, 0, 0, 0, + 0, 43, 0, 0, 0, 0, 0, 0, 44, 0, + 0, 0, 45, 46, 0, 47, 0, 0, 0, 48, + 0, 49, 50, 51, 0, 0, 53, 0, 0, 0, + 54, 0, 55, 0, 0, 479, 0, 0, 0, 0, + 0, 0, 0, 0, 56, 0, 57, 0, 58, 0, + 60, 0, 61, 0, 0, 0, 0, 52, 59, 42, + 0, 0, 0, 0, 0, 0, -60, 0, 0, 0, + 39, 40, 41, 0, 0, 0, 0, 0, 0, 0, + 0, 43, 0, 0, 0, 0, 0, 0, 44, 0, + 0, 0, 45, 46, 0, 47, 0, 0, 0, 48, + 0, 49, 50, 51, 0, 0, 53, 0, 0, 0, + 54, 0, 55, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 56, 0, 57, 0, 58, 0, + 60, 0, 61, 0, 0, 0, 0, 52, 59, 42, + 0, 0, 0, 0, 0, 0, 39, 40, 41, 0, + 0, 0, 0, 0, 0, 0, 0, 43, 0, 0, + 0, 0, 0, 0, 44, 0, 0, 0, 45, 46, + 0, 47, 0, 0, 0, 48, 0, 49, 50, 51, + 0, 0, 53, 0, 0, 0, 54, 0, 55, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 56, 0, 57, 0, 58, 0, 60, 275, 61, 0, + 0, 0, 0, 52, 59, 42, 0, 0, 0, 0, + 0, 0, 113, 114, 115, 0, 0, 117, 119, 120, + 0, 0, 121, 0, 122, 0, 0, 0, 124, 125, + 126, 0, 0, 0, 0, 0, 0, 127, 128, 129, + 130, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 131, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 134, 0, 0, + 0, 0, 0, 0, 135, 136, 137, 0, 139, 140, + 141, 142, 143, 144, 0, 0, 132, 138, 123, 116, + 118, 133, 0, 0, 0, 113, 114, 115, 0, 0, + 117, 119, 120, 0, 0, 121, 0, 122, 0, 0, + 0, 124, 125, 126, 0, 0, 0, 0, 0, 0, + 395, 128, 129, 130, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 131, 0, 0, 0, 396, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 134, 0, 0, 0, 0, 0, 398, 135, 136, 137, + 0, 139, 140, 141, 142, 143, 144, 0, 0, 132, + 138, 123, 116, 118, 133, 0, 0, 0, 113, 114, + 115, 0, 0, 117, 119, 120, 0, 0, 121, 0, + 122, 0, 0, 0, 124, 125, 126, 0, 0, 0, + 0, 0, 0, 395, 128, 129, 130, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 131, 0, 0, + 0, 396, 0, 0, 0, 0, 0, 0, 0, 397, + 0, 0, 0, 134, 0, 0, 0, 0, 0, 398, + 135, 136, 137, 0, 139, 140, 141, 142, 143, 144, + 0, 0, 132, 138, 123, 116, 118, 133, 0, 0, + 0, 215, 0, 0, 0, 0, 217, 0, 39, 40, + 41, 219, 0, 0, 0, 0, 0, 0, 220, 43, + 0, 0, 0, 0, 0, 0, 491, 223, 0, 0, + 224, 492, 0, 47, 0, 0, 0, 48, 0, 49, + 50, 51, 0, 0, 53, 0, 0, 0, 54, 0, + 55, 0, 0, 0, 0, 0, 225, 0, 226, 0, + 0, 0, 56, 227, 57, 228, 58, 229, 60, 230, + 61, 231, 232, 0, 0, 52, 59, 42, 216, 218, + 0, 0, 0, 0, 215, 0, 0, 0, 0, 217, + 0, 39, 40, 41, 219, 0, 0, 0, 0, 0, + 0, 220, 43, 0, 0, 0, 0, 0, 0, 222, + 223, 0, 0, 224, 46, 0, 47, 0, 0, 0, + 48, 0, 49, 50, 51, 0, 0, 53, 0, 0, + 0, 54, 0, 55, 0, 0, 0, 0, 0, 225, + 0, 226, 0, 0, 0, 56, 227, 57, 228, 58, + 229, 60, 230, 61, 231, 232, 0, 0, 52, 59, + 42, 216, 218, 0, 0, 0, 0, 215, 0, 0, + 0, 0, 217, 0, 39, 40, 41, 219, 0, 0, + 0, 0, 0, 0, 220, 221, 0, 0, 0, 0, + 0, 0, 222, 223, 0, 0, 224, 46, 0, 47, + 0, 0, 0, 48, 0, 49, 50, 51, 0, 0, + 53, 0, 0, 0, 54, 0, 55, 0, 0, 0, + 0, 0, 225, 0, 226, 0, 0, 0, 56, 227, + 57, 228, 58, 229, 60, 230, 61, 231, 232, 0, + 0, 52, 59, 42, 216, 218, 0, 0, 0, 0, + 365, 114, 115, 0, 0, 367, 119, 369, 40, 41, + 370, 0, 122, 0, 0, 0, 124, 372, 373, 0, + 0, 0, 0, 0, 0, 374, 375, 129, 130, 224, + 46, 0, 47, 0, 0, 0, 48, 0, 49, 376, + 51, 0, 0, 378, 0, 0, 0, 54, 0, 55, + 0, -206, 0, 0, 0, 379, 0, 226, 0, 0, + 0, 380, 381, 382, 383, 58, 385, 386, 387, 388, + 389, 390, 0, 0, 377, 384, 371, 366, 368, 133, + 0, 0, 0, + + 338, 421, 450, 452, 177, 454, 480, 446, 441, 148, + 431, 428, 182, 425, 445, 333, 156, 254, 456, 14, + 315, 15, 313, 494, 10, 493, 311, 467, 435, 435, + 490, 213, 475, 155, 413, 27, 345, 432, 0, 463, + 474, 306, 0, 306, 342, 478, 175, 432, 151, 254, + 400, 353, 392, 355, 357, 169, 394, 402, 153, 145, + 351, 0, 112, 340, 257, 0, 306, 0, 404, 306, + 0, 405, 0, 65, 0, 213, 0, 93, 213, 65, + 0, 0, 65, 94, 65, 65, 95, 429, 65, 288, + 65, 65, 65, 97, 65, 96, 98, 99, 65, 171, + 65, 65, 186, 100, 107, 65, 65, 336, 66, 151, + 309, 289, 65, 105, 448, 65, 407, 65, 306, 447, + 290, 65, 65, 487, 484, 65, 65, 73, 112, 181, + 151, 65, 82, 186, 65, 306, 404, 184, 270, 405, + 65, 0, 77, 274, 65, 292, 74, 65, 65, 483, + 65, 65, 482, 291, 0, 65, 89, 448, 348, 334, + 241, 65, 65, 447, 485, 65, 65, 65, 65, 0, + 75, 103, 102, 65, 65, 72, 307, 65, 302, 0, + 101, 0, 274, 274, 174, 0, 65, 302, 302, 302, + 297, 274, 274, 274, 274, 277, 65, 302, 65, 65, + 304, 274, 274, 274, 274, 0, 294, 299, 0, 323, + 301, 321, 65, 317, 0, 65, 65, 274, 0, 330, + 274, 274, 282, 293, 0, 65, 0, 0, 0, 320, + 274, 0, 295, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 65, 0, 486, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0}; + +const int JavaScriptGrammar::action_check [] = { + 48, 36, 61, 7, 76, 1, 8, 29, 2, 48, + 7, 76, 48, 76, 1, 33, 2, 74, 1, 36, + 36, 29, 7, 61, 29, 36, 60, 60, 17, 29, + 33, 8, 61, 76, 29, 55, 60, 29, 31, 7, + 55, 8, 33, 0, 7, 55, 16, 29, 7, 20, + 8, 60, 36, 8, 33, 36, 55, 8, 36, 60, + 8, 7, 60, 29, 33, 7, 2, 17, 33, 29, + 60, 8, 36, 29, 7, 29, 29, 7, 5, 55, + 60, 7, 5, 2, 36, 29, 48, 36, 5, 36, + 33, 7, 7, 7, 29, 36, 36, 36, 29, 33, + 10, 8, 8, 8, 8, 7, 6, 8, 29, 8, + 8, 8, 7, 8, 8, 36, 61, 62, 8, 1, + 20, 8, 40, 61, 62, 8, -1, 40, 50, 61, + 62, 33, 54, 51, 8, -1, 29, 40, 51, 33, + 29, 61, 62, 8, 0, 55, 8, -1, 51, 29, + 42, 29, 8, 60, 60, 60, 60, 56, 12, 8, + 61, 53, 60, 60, 50, 29, 56, 40, 54, 56, + 61, 62, 7, 56, 12, 15, 61, 62, 51, 25, + 15, 27, 29, 8, 29, -1, 60, 8, 29, 12, + 55, 84, 38, -1, 34, 84, 36, 61, 62, 61, + 62, -1, -1, 57, 84, 8, 84, 15, 29, 63, + 15, -1, 61, 62, 61, 62, 61, 62, -1, 57, + 61, 62, 18, 19, -1, 63, 34, -1, 36, 34, + -1, 36, 18, 19, 57, -1, 61, 62, 18, 19, + 63, 18, 19, -1, 23, 24, -1, -1, -1, 45, + 46, -1, -1, 32, -1, -1, 35, 60, 37, 45, + 46, 23, 24, 84, -1, 45, 46, -1, 45, 46, + 32, 23, 24, 35, -1, 37, -1, -1, 23, 24, + 32, -1, -1, 35, 25, 37, 27, 32, -1, -1, + 35, -1, 37, 23, 24, -1, -1, 38, -1, -1, + -1, 31, 32, 23, 24, 35, -1, 37, -1, -1, + -1, 31, 32, 23, 24, 35, -1, 37, -1, -1, + -1, 31, 32, 23, 24, 35, -1, 37, -1, -1, + -1, 31, 32, -1, -1, 35, -1, 37, -1, -1, + 23, 24, -1, -1, -1, -1, 23, 24, 31, 32, + -1, -1, 35, -1, 37, 32, -1, -1, 35, -1, + 37, 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, 12, 13, -1, + -1, -1, 43, -1, -1, -1, 47, 22, -1, -1, + -1, -1, -1, -1, 29, -1, -1, -1, 33, 34, + 3, 36, -1, -1, 65, -1, 67, -1, 43, -1, + 13, -1, 47, -1, 17, -1, -1, 78, 79, 80, + -1, -1, -1, 26, -1, 28, -1, -1, -1, -1, + 65, -1, 67, -1, -1, -1, 39, -1, 41, 42, + -1, -1, 3, 78, 79, 80, 49, -1, -1, 52, + 53, -1, 13, -1, -1, 58, 17, -1, -1, -1, + -1, 64, -1, -1, -1, 26, -1, 28, -1, -1, + 31, -1, -1, -1, 77, -1, -1, -1, 39, -1, + 41, 42, -1, -1, 3, -1, -1, -1, 49, -1, + -1, 52, 53, -1, 13, -1, -1, 58, 17, -1, + -1, -1, -1, 64, -1, -1, -1, 26, -1, 28, + -1, -1, -1, -1, -1, -1, 77, -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, 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, 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, + 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, 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, 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, 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, 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, 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, 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, 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, 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, + 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, + + 6, 81, 7, 6, 13, 7, 7, 51, 83, 13, + 66, 66, 7, 78, 51, 72, 47, 6, 6, 3, + 6, 3, 7, 1, 1, 4, 6, 70, 51, 51, + 6, 6, 13, 4, 7, 7, 85, 7, -1, 13, + 9, 7, -1, 7, 6, 13, 13, 7, 13, 6, + 13, 7, 13, 6, 6, 13, 15, 6, 13, 7, + 6, -1, 16, 7, 7, -1, 7, -1, 18, 7, + -1, 21, -1, 24, -1, 6, -1, 28, 6, 24, + -1, -1, 24, 28, 24, 24, 28, 7, 24, 29, + 24, 24, 24, 29, 24, 29, 29, 29, 24, 38, + 24, 24, 26, 29, 34, 24, 24, 48, 27, 13, + 48, 29, 24, 36, 26, 24, 20, 24, 7, 26, + 29, 24, 24, 26, 26, 24, 24, 26, 16, 17, + 13, 24, 30, 26, 24, 7, 18, 20, 24, 21, + 24, -1, 32, 29, 24, 29, 26, 24, 24, 26, + 24, 24, 26, 29, -1, 24, 29, 26, 86, 48, + 91, 24, 24, 26, 26, 24, 24, 24, 24, -1, + 27, 30, 30, 24, 24, 26, 48, 24, 24, -1, + 30, -1, 29, 29, 40, -1, 24, 24, 24, 24, + 37, 29, 29, 29, 29, 33, 24, 24, 24, 24, + 46, 29, 29, 29, 29, -1, 31, 35, -1, 46, + 46, 46, 24, 39, -1, 24, 24, 29, -1, 46, + 29, 29, 31, 31, -1, 24, -1, -1, -1, 41, + 29, -1, 31, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 24, -1, 26, -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, -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 new file mode 100644 index 0000000..3cc3307 --- /dev/null +++ b/src/declarative/qml/parser/javascriptgrammar_p.h @@ -0,0 +1,144 @@ +// This file was generated by qlalr - DO NOT EDIT! +#ifndef JAVASCRIPTGRAMMAR_P_H +#define JAVASCRIPTGRAMMAR_P_H + +class JavaScriptGrammar +{ +public: + enum { + EOF_SYMBOL = 0, + REDUCE_HERE = 86, + SHIFT_THERE = 85, + T_AND = 1, + T_AND_AND = 2, + T_AND_EQ = 3, + T_AUTOMATIC_SEMICOLON = 62, + T_BREAK = 4, + T_CASE = 5, + T_CATCH = 6, + T_COLON = 7, + T_COMMA = 8, + T_CONST = 81, + T_CONTINUE = 9, + T_DEBUGGER = 82, + T_DEFAULT = 10, + T_DELETE = 11, + T_DIVIDE_ = 12, + T_DIVIDE_EQ = 13, + T_DO = 14, + T_DOT = 15, + T_ELSE = 16, + T_EQ = 17, + T_EQ_EQ = 18, + T_EQ_EQ_EQ = 19, + T_FALSE = 80, + T_FINALLY = 20, + T_FOR = 21, + T_FUNCTION = 22, + T_GE = 23, + T_GT = 24, + T_GT_GT = 25, + T_GT_GT_EQ = 26, + T_GT_GT_GT = 27, + T_GT_GT_GT_EQ = 28, + T_IDENTIFIER = 29, + T_IF = 30, + T_IN = 31, + T_INSTANCEOF = 32, + T_LBRACE = 33, + T_LBRACKET = 34, + T_LE = 35, + T_LPAREN = 36, + T_LT = 37, + T_LT_LT = 38, + T_LT_LT_EQ = 39, + T_MINUS = 40, + T_MINUS_EQ = 41, + T_MINUS_MINUS = 42, + T_NEW = 43, + T_NOT = 44, + T_NOT_EQ = 45, + T_NOT_EQ_EQ = 46, + T_NULL = 78, + T_NUMERIC_LITERAL = 47, + T_OR = 48, + T_OR_EQ = 49, + T_OR_OR = 50, + T_PLUS = 51, + T_PLUS_EQ = 52, + T_PLUS_PLUS = 53, + T_PUBLIC = 84, + T_QUESTION = 54, + T_RBRACE = 55, + T_RBRACKET = 56, + T_REMAINDER = 57, + T_REMAINDER_EQ = 58, + T_RESERVED_WORD = 83, + T_RETURN = 59, + T_RPAREN = 60, + T_SEMICOLON = 61, + T_STAR = 63, + T_STAR_EQ = 64, + T_STRING_LITERAL = 65, + T_SWITCH = 66, + T_THIS = 67, + T_THROW = 68, + T_TILDE = 69, + T_TRUE = 79, + T_TRY = 70, + T_TYPEOF = 71, + T_VAR = 72, + T_VOID = 73, + T_WHILE = 74, + T_WITH = 75, + T_XOR = 76, + T_XOR_EQ = 77, + + ACCEPT_STATE = 7, + RULE_COUNT = 283, + STATE_COUNT = 497, + TERMINAL_COUNT = 87, + NON_TERMINAL_COUNT = 93, + + GOTO_INDEX_OFFSET = 497, + GOTO_INFO_OFFSET = 1543, + GOTO_CHECK_OFFSET = 1543 + }; + + static const char *const spell []; + static const int lhs []; + static const int rhs []; + static const int goto_default []; + static const int action_default []; + static const int action_index []; + static const int action_info []; + static const int action_check []; + + static inline int nt_action (int state, int nt) + { + const int *const goto_index = &action_index [GOTO_INDEX_OFFSET]; + const int *const goto_check = &action_check [GOTO_CHECK_OFFSET]; + + const int yyn = goto_index [state] + nt; + + if (yyn < 0 || goto_check [yyn] != nt) + return goto_default [nt]; + + const int *const goto_info = &action_info [GOTO_INFO_OFFSET]; + return goto_info [yyn]; + } + + static inline int t_action (int state, int token) + { + const int yyn = action_index [state] + token; + + if (yyn < 0 || action_check [yyn] != token) + return - action_default [state]; + + return action_info [yyn]; + } +}; + + +#endif // JAVASCRIPTGRAMMAR_P_H + diff --git a/src/declarative/qml/parser/javascriptlexer.cpp b/src/declarative/qml/parser/javascriptlexer.cpp new file mode 100644 index 0000000..58d8c53 --- /dev/null +++ b/src/declarative/qml/parser/javascriptlexer.cpp @@ -0,0 +1,1124 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtScript 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$ +** +****************************************************************************/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "javascriptengine_p.h" + + + + + + + +#include "javascriptlexer_p.h" +#include "javascriptgrammar_p.h" + +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +extern double qstrtod(const char *s00, char const **se, bool *ok); + +#define shiftWindowsLineBreak() \ + do { \ + if (((current == '\r') && (next1 == '\n')) \ + || ((current == '\n') && (next1 == '\r'))) { \ + shift(1); \ + } \ + } \ + while (0) + +namespace JavaScript { +extern qjsreal integerFromString(const char *buf, int size, int radix); +} + +JavaScript::Lexer::Lexer(JavaScriptEnginePrivate *eng) + : driver(eng), + yylineno(0), + done(false), + size8(128), size16(128), + pos8(0), pos16(0), + terminator(false), + restrKeyword(false), + delimited(false), + stackToken(-1), + state(Start), + pos(0), + code(0), length(0), + yycolumn(0), + startpos(0), + startlineno(0), startcolumn(0), + bol(true), + current(0), next1(0), next2(0), next3(0), + err(NoError), + wantRx(false), + check_reserved(true), + parenthesesState(IgnoreParentheses), + parenthesesCount(0), + prohibitAutomaticSemicolon(false) +{ + // allocate space for read buffers + buffer8 = new char[size8]; + buffer16 = new QChar[size16]; + pattern = 0; + flags = 0; + +} + +JavaScript::Lexer::~Lexer() +{ + delete [] buffer8; + delete [] buffer16; +} + +void JavaScript::Lexer::setCode(const QString &c, int lineno) +{ + errmsg = QString(); + yylineno = lineno; + yycolumn = 1; + restrKeyword = false; + delimited = false; + stackToken = -1; + pos = 0; + code = c.unicode(); + length = c.length(); + bol = true; + + // read first characters + current = (length > 0) ? code[0].unicode() : 0; + next1 = (length > 1) ? code[1].unicode() : 0; + next2 = (length > 2) ? code[2].unicode() : 0; + next3 = (length > 3) ? code[3].unicode() : 0; +} + +void JavaScript::Lexer::shift(uint p) +{ + while (p--) { + ++pos; + ++yycolumn; + current = next1; + next1 = next2; + next2 = next3; + next3 = (pos + 3 < length) ? code[pos+3].unicode() : 0; + } +} + +void JavaScript::Lexer::setDone(State s) +{ + state = s; + done = true; +} + +int JavaScript::Lexer::findReservedWord(const QChar *c, int size) const +{ + switch (size) { + case 2: { + if (c[0] == QLatin1Char('d') && c[1] == QLatin1Char('o')) + return JavaScriptGrammar::T_DO; + else if (c[0] == QLatin1Char('i') && c[1] == QLatin1Char('f')) + return JavaScriptGrammar::T_IF; + else if (c[0] == QLatin1Char('i') && c[1] == QLatin1Char('n')) + return JavaScriptGrammar::T_IN; + } break; + + case 3: { + if (c[0] == QLatin1Char('f') && c[1] == QLatin1Char('o') && c[2] == QLatin1Char('r')) + return JavaScriptGrammar::T_FOR; + else if (c[0] == QLatin1Char('n') && c[1] == QLatin1Char('e') && c[2] == QLatin1Char('w')) + return JavaScriptGrammar::T_NEW; + else if (c[0] == QLatin1Char('t') && c[1] == QLatin1Char('r') && c[2] == QLatin1Char('y')) + return JavaScriptGrammar::T_TRY; + else if (c[0] == QLatin1Char('v') && c[1] == QLatin1Char('a') && c[2] == QLatin1Char('r')) + return JavaScriptGrammar::T_VAR; + else if (check_reserved) { + if (c[0] == QLatin1Char('i') && c[1] == QLatin1Char('n') && c[2] == QLatin1Char('t')) + return JavaScriptGrammar::T_RESERVED_WORD; + } + } break; + + case 4: { + if (c[0] == QLatin1Char('c') && c[1] == QLatin1Char('a') + && c[2] == QLatin1Char('s') && c[3] == QLatin1Char('e')) + return JavaScriptGrammar::T_CASE; + else if (c[0] == QLatin1Char('e') && c[1] == QLatin1Char('l') + && c[2] == QLatin1Char('s') && c[3] == QLatin1Char('e')) + return JavaScriptGrammar::T_ELSE; + else if (c[0] == QLatin1Char('t') && c[1] == QLatin1Char('h') + && c[2] == QLatin1Char('i') && c[3] == QLatin1Char('s')) + return JavaScriptGrammar::T_THIS; + else if (c[0] == QLatin1Char('v') && c[1] == QLatin1Char('o') + && c[2] == QLatin1Char('i') && c[3] == QLatin1Char('d')) + return JavaScriptGrammar::T_VOID; + else if (c[0] == QLatin1Char('w') && c[1] == QLatin1Char('i') + && c[2] == QLatin1Char('t') && c[3] == QLatin1Char('h')) + return JavaScriptGrammar::T_WITH; + else if (c[0] == QLatin1Char('t') && c[1] == QLatin1Char('r') + && c[2] == QLatin1Char('u') && c[3] == QLatin1Char('e')) + return JavaScriptGrammar::T_TRUE; + else if (c[0] == QLatin1Char('n') && c[1] == QLatin1Char('u') + && c[2] == QLatin1Char('l') && c[3] == QLatin1Char('l')) + return JavaScriptGrammar::T_NULL; + else if (check_reserved) { + if (c[0] == QLatin1Char('e') && c[1] == QLatin1Char('n') + && c[2] == QLatin1Char('u') && c[3] == QLatin1Char('m')) + return JavaScriptGrammar::T_RESERVED_WORD; + else if (c[0] == QLatin1Char('b') && c[1] == QLatin1Char('y') + && c[2] == QLatin1Char('t') && c[3] == QLatin1Char('e')) + return JavaScriptGrammar::T_RESERVED_WORD; + else if (c[0] == QLatin1Char('l') && c[1] == QLatin1Char('o') + && c[2] == QLatin1Char('n') && c[3] == QLatin1Char('g')) + return JavaScriptGrammar::T_RESERVED_WORD; + else if (c[0] == QLatin1Char('c') && c[1] == QLatin1Char('h') + && c[2] == QLatin1Char('a') && c[3] == QLatin1Char('r')) + return JavaScriptGrammar::T_RESERVED_WORD; + else if (c[0] == QLatin1Char('g') && c[1] == QLatin1Char('o') + && c[2] == QLatin1Char('t') && c[3] == QLatin1Char('o')) + return JavaScriptGrammar::T_RESERVED_WORD; + } + } break; + + case 5: { + if (c[0] == QLatin1Char('b') && c[1] == QLatin1Char('r') + && c[2] == QLatin1Char('e') && c[3] == QLatin1Char('a') + && c[4] == QLatin1Char('k')) + return JavaScriptGrammar::T_BREAK; + else if (c[0] == QLatin1Char('c') && c[1] == QLatin1Char('a') + && c[2] == QLatin1Char('t') && c[3] == QLatin1Char('c') + && c[4] == QLatin1Char('h')) + return JavaScriptGrammar::T_CATCH; + else if (c[0] == QLatin1Char('t') && c[1] == QLatin1Char('h') + && c[2] == QLatin1Char('r') && c[3] == QLatin1Char('o') + && c[4] == QLatin1Char('w')) + return JavaScriptGrammar::T_THROW; + else if (c[0] == QLatin1Char('w') && c[1] == QLatin1Char('h') + && c[2] == QLatin1Char('i') && c[3] == QLatin1Char('l') + && c[4] == QLatin1Char('e')) + return JavaScriptGrammar::T_WHILE; + else if (c[0] == QLatin1Char('c') && c[1] == QLatin1Char('o') + && c[2] == QLatin1Char('n') && c[3] == QLatin1Char('s') + && c[4] == QLatin1Char('t')) + return JavaScriptGrammar::T_CONST; + else if (c[0] == QLatin1Char('f') && c[1] == QLatin1Char('a') + && c[2] == QLatin1Char('l') && c[3] == QLatin1Char('s') + && c[4] == QLatin1Char('e')) + return JavaScriptGrammar::T_FALSE; + else if (check_reserved) { + if (c[0] == QLatin1Char('s') && c[1] == QLatin1Char('h') + && c[2] == QLatin1Char('o') && c[3] == QLatin1Char('r') + && c[4] == QLatin1Char('t')) + return JavaScriptGrammar::T_RESERVED_WORD; + else if (c[0] == QLatin1Char('s') && c[1] == QLatin1Char('u') + && c[2] == QLatin1Char('p') && c[3] == QLatin1Char('e') + && c[4] == QLatin1Char('r')) + return JavaScriptGrammar::T_RESERVED_WORD; + else if (c[0] == QLatin1Char('f') && c[1] == QLatin1Char('i') + && c[2] == QLatin1Char('n') && c[3] == QLatin1Char('a') + && c[4] == QLatin1Char('l')) + return JavaScriptGrammar::T_RESERVED_WORD; + else if (c[0] == QLatin1Char('c') && c[1] == QLatin1Char('l') + && c[2] == QLatin1Char('a') && c[3] == QLatin1Char('s') + && c[4] == QLatin1Char('s')) + return JavaScriptGrammar::T_RESERVED_WORD; + else if (c[0] == QLatin1Char('f') && c[1] == QLatin1Char('l') + && c[2] == QLatin1Char('o') && c[3] == QLatin1Char('a') + && c[4] == QLatin1Char('t')) + return JavaScriptGrammar::T_RESERVED_WORD; + } + } break; + + case 6: { + if (c[0] == QLatin1Char('d') && c[1] == QLatin1Char('e') + && c[2] == QLatin1Char('l') && c[3] == QLatin1Char('e') + && c[4] == QLatin1Char('t') && c[5] == QLatin1Char('e')) + return JavaScriptGrammar::T_DELETE; + else if (c[0] == QLatin1Char('r') && c[1] == QLatin1Char('e') + && c[2] == QLatin1Char('t') && c[3] == QLatin1Char('u') + && c[4] == QLatin1Char('r') && c[5] == QLatin1Char('n')) + return JavaScriptGrammar::T_RETURN; + else if (c[0] == QLatin1Char('s') && c[1] == QLatin1Char('w') + && c[2] == QLatin1Char('i') && c[3] == QLatin1Char('t') + && c[4] == QLatin1Char('c') && c[5] == QLatin1Char('h')) + return JavaScriptGrammar::T_SWITCH; + else if (c[0] == QLatin1Char('t') && c[1] == QLatin1Char('y') + && c[2] == QLatin1Char('p') && c[3] == QLatin1Char('e') + && c[4] == QLatin1Char('o') && c[5] == QLatin1Char('f')) + return JavaScriptGrammar::T_TYPEOF; + else if (check_reserved) { + if (c[0] == QLatin1Char('e') && c[1] == QLatin1Char('x') + && c[2] == QLatin1Char('p') && c[3] == QLatin1Char('o') + && c[4] == QLatin1Char('r') && c[5] == QLatin1Char('t')) + return JavaScriptGrammar::T_RESERVED_WORD; + else if (c[0] == QLatin1Char('s') && c[1] == QLatin1Char('t') + && c[2] == QLatin1Char('a') && c[3] == QLatin1Char('t') + && c[4] == QLatin1Char('i') && c[5] == QLatin1Char('c')) + return JavaScriptGrammar::T_RESERVED_WORD; + else if (c[0] == QLatin1Char('d') && c[1] == QLatin1Char('o') + && c[2] == QLatin1Char('u') && c[3] == QLatin1Char('b') + && c[4] == QLatin1Char('l') && c[5] == QLatin1Char('e')) + return JavaScriptGrammar::T_RESERVED_WORD; + else if (c[0] == QLatin1Char('i') && c[1] == QLatin1Char('m') + && c[2] == QLatin1Char('p') && c[3] == QLatin1Char('o') + && c[4] == QLatin1Char('r') && c[5] == QLatin1Char('t')) + return JavaScriptGrammar::T_RESERVED_WORD; + 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_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')) + return JavaScriptGrammar::T_RESERVED_WORD; + else if (c[0] == QLatin1Char('t') && c[1] == QLatin1Char('h') + && c[2] == QLatin1Char('r') && c[3] == QLatin1Char('o') + && c[4] == QLatin1Char('w') && c[5] == QLatin1Char('s')) + return JavaScriptGrammar::T_RESERVED_WORD; + } + } break; + + case 7: { + if (c[0] == QLatin1Char('d') && c[1] == QLatin1Char('e') + && c[2] == QLatin1Char('f') && c[3] == QLatin1Char('a') + && c[4] == QLatin1Char('u') && c[5] == QLatin1Char('l') + && c[6] == QLatin1Char('t')) + return JavaScriptGrammar::T_DEFAULT; + else if (c[0] == QLatin1Char('f') && c[1] == QLatin1Char('i') + && c[2] == QLatin1Char('n') && c[3] == QLatin1Char('a') + && c[4] == QLatin1Char('l') && c[5] == QLatin1Char('l') + && c[6] == QLatin1Char('y')) + return JavaScriptGrammar::T_FINALLY; + else if (check_reserved) { + if (c[0] == QLatin1Char('b') && c[1] == QLatin1Char('o') + && c[2] == QLatin1Char('o') && c[3] == QLatin1Char('l') + && c[4] == QLatin1Char('e') && c[5] == QLatin1Char('a') + && c[6] == QLatin1Char('n')) + return JavaScriptGrammar::T_RESERVED_WORD; + else if (c[0] == QLatin1Char('e') && c[1] == QLatin1Char('x') + && c[2] == QLatin1Char('t') && c[3] == QLatin1Char('e') + && c[4] == QLatin1Char('n') && c[5] == QLatin1Char('d') + && c[6] == QLatin1Char('s')) + return JavaScriptGrammar::T_RESERVED_WORD; + else if (c[0] == QLatin1Char('p') && c[1] == QLatin1Char('a') + && c[2] == QLatin1Char('c') && c[3] == QLatin1Char('k') + && c[4] == QLatin1Char('a') && c[5] == QLatin1Char('g') + && c[6] == QLatin1Char('e')) + return JavaScriptGrammar::T_RESERVED_WORD; + else if (c[0] == QLatin1Char('p') && c[1] == QLatin1Char('r') + && c[2] == QLatin1Char('i') && c[3] == QLatin1Char('v') + && c[4] == QLatin1Char('a') && c[5] == QLatin1Char('t') + && c[6] == QLatin1Char('e')) + return JavaScriptGrammar::T_RESERVED_WORD; + } + } break; + + case 8: { + if (c[0] == QLatin1Char('c') && c[1] == QLatin1Char('o') + && c[2] == QLatin1Char('n') && c[3] == QLatin1Char('t') + && c[4] == QLatin1Char('i') && c[5] == QLatin1Char('n') + && c[6] == QLatin1Char('u') && c[7] == QLatin1Char('e')) + return JavaScriptGrammar::T_CONTINUE; + else if (c[0] == QLatin1Char('f') && c[1] == QLatin1Char('u') + && c[2] == QLatin1Char('n') && c[3] == QLatin1Char('c') + && c[4] == QLatin1Char('t') && c[5] == QLatin1Char('i') + && c[6] == QLatin1Char('o') && c[7] == QLatin1Char('n')) + return JavaScriptGrammar::T_FUNCTION; + else if (c[0] == QLatin1Char('d') && c[1] == QLatin1Char('e') + && c[2] == QLatin1Char('b') && c[3] == QLatin1Char('u') + && c[4] == QLatin1Char('g') && c[5] == QLatin1Char('g') + && c[6] == QLatin1Char('e') && c[7] == QLatin1Char('r')) + return JavaScriptGrammar::T_DEBUGGER; + else if (check_reserved) { + if (c[0] == QLatin1Char('a') && c[1] == QLatin1Char('b') + && c[2] == QLatin1Char('s') && c[3] == QLatin1Char('t') + && c[4] == QLatin1Char('r') && c[5] == QLatin1Char('a') + && c[6] == QLatin1Char('c') && c[7] == QLatin1Char('t')) + return JavaScriptGrammar::T_RESERVED_WORD; + else if (c[0] == QLatin1Char('v') && c[1] == QLatin1Char('o') + && c[2] == QLatin1Char('l') && c[3] == QLatin1Char('a') + && c[4] == QLatin1Char('t') && c[5] == QLatin1Char('i') + && c[6] == QLatin1Char('l') && c[7] == QLatin1Char('e')) + return JavaScriptGrammar::T_RESERVED_WORD; + } + } break; + + case 9: { + if (check_reserved) { + if (c[0] == QLatin1Char('i') && c[1] == QLatin1Char('n') + && c[2] == QLatin1Char('t') && c[3] == QLatin1Char('e') + && c[4] == QLatin1Char('r') && c[5] == QLatin1Char('f') + && c[6] == QLatin1Char('a') && c[7] == QLatin1Char('c') + && c[8] == QLatin1Char('e')) + return JavaScriptGrammar::T_RESERVED_WORD; + else if (c[0] == QLatin1Char('t') && c[1] == QLatin1Char('r') + && c[2] == QLatin1Char('a') && c[3] == QLatin1Char('n') + && c[4] == QLatin1Char('s') && c[5] == QLatin1Char('i') + && c[6] == QLatin1Char('e') && c[7] == QLatin1Char('n') + && c[8] == QLatin1Char('t')) + return JavaScriptGrammar::T_RESERVED_WORD; + else if (c[0] == QLatin1Char('p') && c[1] == QLatin1Char('r') + && c[2] == QLatin1Char('o') && c[3] == QLatin1Char('t') + && c[4] == QLatin1Char('e') && c[5] == QLatin1Char('c') + && c[6] == QLatin1Char('t') && c[7] == QLatin1Char('e') + && c[8] == QLatin1Char('d')) + return JavaScriptGrammar::T_RESERVED_WORD; + } + } break; + + case 10: { + if (c[0] == QLatin1Char('i') && c[1] == QLatin1Char('n') + && c[2] == QLatin1Char('s') && c[3] == QLatin1Char('t') + && c[4] == QLatin1Char('a') && c[5] == QLatin1Char('n') + && c[6] == QLatin1Char('c') && c[7] == QLatin1Char('e') + && c[8] == QLatin1Char('o') && c[9] == QLatin1Char('f')) + return JavaScriptGrammar::T_INSTANCEOF; + else if (check_reserved) { + if (c[0] == QLatin1Char('i') && c[1] == QLatin1Char('m') + && c[2] == QLatin1Char('p') && c[3] == QLatin1Char('l') + && c[4] == QLatin1Char('e') && c[5] == QLatin1Char('m') + && c[6] == QLatin1Char('e') && c[7] == QLatin1Char('n') + && c[8] == QLatin1Char('t') && c[9] == QLatin1Char('s')) + return JavaScriptGrammar::T_RESERVED_WORD; + } + } break; + + case 12: { + if (check_reserved) { + if (c[0] == QLatin1Char('s') && c[1] == QLatin1Char('y') + && c[2] == QLatin1Char('n') && c[3] == QLatin1Char('c') + && c[4] == QLatin1Char('h') && c[5] == QLatin1Char('r') + && c[6] == QLatin1Char('o') && c[7] == QLatin1Char('n') + && c[8] == QLatin1Char('i') && c[9] == QLatin1Char('z') + && c[10] == QLatin1Char('e') && c[11] == QLatin1Char('d')) + return JavaScriptGrammar::T_RESERVED_WORD; + } + } break; + + } // switch + + return -1; +} + +int JavaScript::Lexer::lex() +{ + int token = 0; + state = Start; + ushort stringType = 0; // either single or double quotes + pos8 = pos16 = 0; + done = false; + terminator = false; + + // did we push a token on the stack previously ? + // (after an automatic semicolon insertion) + if (stackToken >= 0) { + setDone(Other); + token = stackToken; + stackToken = -1; + } + + while (!done) { + switch (state) { + case Start: + if (isWhiteSpace()) { + // do nothing + } else if (current == '/' && next1 == '/') { + recordStartPos(); + shift(1); + state = InSingleLineComment; + } else if (current == '/' && next1 == '*') { + recordStartPos(); + shift(1); + state = InMultiLineComment; + } else if (current == 0) { + syncProhibitAutomaticSemicolon(); + if (!terminator && !delimited && !prohibitAutomaticSemicolon) { + // automatic semicolon insertion if program incomplete + token = JavaScriptGrammar::T_SEMICOLON; + stackToken = 0; + setDone(Other); + } else { + setDone(Eof); + } + } else if (isLineTerminator()) { + shiftWindowsLineBreak(); + yylineno++; + yycolumn = 0; + bol = true; + terminator = true; + syncProhibitAutomaticSemicolon(); + if (restrKeyword) { + token = JavaScriptGrammar::T_SEMICOLON; + setDone(Other); + } + } else if (current == '"' || current == '\'') { + recordStartPos(); + state = InString; + stringType = current; + } else if (isIdentLetter(current)) { + recordStartPos(); + record16(current); + state = InIdentifier; + } else if (current == '0') { + recordStartPos(); + record8(current); + state = InNum0; + } else if (isDecimalDigit(current)) { + recordStartPos(); + record8(current); + state = InNum; + } else if (current == '.' && isDecimalDigit(next1)) { + recordStartPos(); + record8(current); + state = InDecimal; + } else { + recordStartPos(); + token = matchPunctuator(current, next1, next2, next3); + if (token != -1) { + if (terminator && !delimited && !prohibitAutomaticSemicolon + && (token == JavaScriptGrammar::T_PLUS_PLUS + || token == JavaScriptGrammar::T_MINUS_MINUS)) { + // automatic semicolon insertion + stackToken = token; + token = JavaScriptGrammar::T_SEMICOLON; + } + setDone(Other); + } + else { + setDone(Bad); + err = IllegalCharacter; + errmsg = QLatin1String("Illegal character"); + } + } + break; + case InString: + if (current == stringType) { + shift(1); + setDone(String); + } else if (current == 0 || isLineTerminator()) { + setDone(Bad); + err = UnclosedStringLiteral; + errmsg = QLatin1String("Unclosed string at end of line"); + } else if (current == '\\') { + state = InEscapeSequence; + } else { + record16(current); + } + break; + // Escape Sequences inside of strings + case InEscapeSequence: + if (isOctalDigit(current)) { + if (current >= '0' && current <= '3' && + isOctalDigit(next1) && isOctalDigit(next2)) { + record16(convertOctal(current, next1, next2)); + shift(2); + state = InString; + } else if (isOctalDigit(current) && + isOctalDigit(next1)) { + record16(convertOctal('0', current, next1)); + shift(1); + state = InString; + } else if (isOctalDigit(current)) { + record16(convertOctal('0', '0', current)); + state = InString; + } else { + setDone(Bad); + err = IllegalEscapeSequence; + errmsg = QLatin1String("Illegal escape squence"); + } + } else if (current == 'x') + state = InHexEscape; + else if (current == 'u') + state = InUnicodeEscape; + else { + if (isLineTerminator()) { + shiftWindowsLineBreak(); + yylineno++; + yycolumn = 0; + bol = true; + } else { + record16(singleEscape(current)); + } + state = InString; + } + break; + case InHexEscape: + if (isHexDigit(current) && isHexDigit(next1)) { + state = InString; + record16(QLatin1Char(convertHex(current, next1))); + shift(1); + } else if (current == stringType) { + record16(QLatin1Char('x')); + shift(1); + setDone(String); + } else { + record16(QLatin1Char('x')); + record16(current); + state = InString; + } + break; + case InUnicodeEscape: + if (isHexDigit(current) && isHexDigit(next1) && + isHexDigit(next2) && isHexDigit(next3)) { + record16(convertUnicode(current, next1, next2, next3)); + shift(3); + state = InString; + } else if (current == stringType) { + record16(QLatin1Char('u')); + shift(1); + setDone(String); + } else { + setDone(Bad); + err = IllegalUnicodeEscapeSequence; + errmsg = QLatin1String("Illegal unicode escape sequence"); + } + break; + case InSingleLineComment: + if (isLineTerminator()) { + shiftWindowsLineBreak(); + yylineno++; + yycolumn = 0; + terminator = true; + bol = true; + if (restrKeyword) { + token = JavaScriptGrammar::T_SEMICOLON; + setDone(Other); + } else + state = Start; + } else if (current == 0) { + setDone(Eof); + } + break; + case InMultiLineComment: + if (current == 0) { + setDone(Bad); + err = UnclosedComment; + errmsg = QLatin1String("Unclosed comment at end of file"); + } else if (isLineTerminator()) { + shiftWindowsLineBreak(); + yylineno++; + } else if (current == '*' && next1 == '/') { + state = Start; + shift(1); + } + break; + case InIdentifier: + if (isIdentLetter(current) || isDecimalDigit(current)) { + record16(current); + break; + } + setDone(Identifier); + break; + case InNum0: + if (current == 'x' || current == 'X') { + record8(current); + state = InHex; + } else if (current == '.') { + record8(current); + state = InDecimal; + } else if (current == 'e' || current == 'E') { + record8(current); + state = InExponentIndicator; + } else if (isOctalDigit(current)) { + record8(current); + state = InOctal; + } else if (isDecimalDigit(current)) { + record8(current); + state = InDecimal; + } else { + setDone(Number); + } + break; + case InHex: + if (isHexDigit(current)) + record8(current); + else + setDone(Hex); + break; + case InOctal: + if (isOctalDigit(current)) { + record8(current); + } else if (isDecimalDigit(current)) { + record8(current); + state = InDecimal; + } else { + setDone(Octal); + } + break; + case InNum: + if (isDecimalDigit(current)) { + record8(current); + } else if (current == '.') { + record8(current); + state = InDecimal; + } else if (current == 'e' || current == 'E') { + record8(current); + state = InExponentIndicator; + } else { + setDone(Number); + } + break; + case InDecimal: + if (isDecimalDigit(current)) { + record8(current); + } else if (current == 'e' || current == 'E') { + record8(current); + state = InExponentIndicator; + } else { + setDone(Number); + } + break; + case InExponentIndicator: + if (current == '+' || current == '-') { + record8(current); + } else if (isDecimalDigit(current)) { + record8(current); + state = InExponent; + } else { + setDone(Bad); + err = IllegalExponentIndicator; + errmsg = QLatin1String("Illegal syntax for exponential number"); + } + break; + case InExponent: + if (isDecimalDigit(current)) { + record8(current); + } else { + setDone(Number); + } + break; + default: + Q_ASSERT_X(0, "Lexer::lex", "Unhandled state in switch statement"); + } + + // move on to the next character + if (!done) + shift(1); + if (state != Start && state != InSingleLineComment) + bol = false; + } + + // no identifiers allowed directly after numeric literal, e.g. "3in" is bad + if ((state == Number || state == Octal || state == Hex) + && isIdentLetter(current)) { + state = Bad; + err = IllegalIdentifier; + errmsg = QLatin1String("Identifier cannot start with numeric literal"); + } + + // terminate string + buffer8[pos8] = '\0'; + + double dval = 0; + if (state == Number) { + dval = qstrtod(buffer8, 0, 0); + } else if (state == Hex) { // scan hex numbers + dval = JavaScript::integerFromString(buffer8, pos8, 16); + state = Number; + } else if (state == Octal) { // scan octal number + dval = JavaScript::integerFromString(buffer8, pos8, 8); + state = Number; + } + + restrKeyword = false; + delimited = false; + + switch (parenthesesState) { + case IgnoreParentheses: + break; + case CountParentheses: + if (token == JavaScriptGrammar::T_RPAREN) { + --parenthesesCount; + if (parenthesesCount == 0) + parenthesesState = BalancedParentheses; + } else if (token == JavaScriptGrammar::T_LPAREN) { + ++parenthesesCount; + } + break; + case BalancedParentheses: + parenthesesState = IgnoreParentheses; + break; + } + + switch (state) { + case Eof: + return 0; + case Other: + if(token == JavaScriptGrammar::T_RBRACE || token == JavaScriptGrammar::T_SEMICOLON) + delimited = true; + return token; + case Identifier: + if ((token = findReservedWord(buffer16, pos16)) < 0) { + /* TODO: close leak on parse error. same holds true for String */ + if (driver) + qsyylval.ustr = driver->intern(buffer16, pos16); + else + qsyylval.ustr = 0; + return JavaScriptGrammar::T_IDENTIFIER; + } + if (token == JavaScriptGrammar::T_CONTINUE || token == JavaScriptGrammar::T_BREAK + || token == JavaScriptGrammar::T_RETURN || token == JavaScriptGrammar::T_THROW) { + restrKeyword = true; + } else if (token == JavaScriptGrammar::T_IF || token == JavaScriptGrammar::T_FOR + || token == JavaScriptGrammar::T_WHILE || token == JavaScriptGrammar::T_WITH) { + parenthesesState = CountParentheses; + parenthesesCount = 0; + } else if (token == JavaScriptGrammar::T_DO) { + parenthesesState = BalancedParentheses; + } + return token; + case String: + if (driver) + qsyylval.ustr = driver->intern(buffer16, pos16); + else + qsyylval.ustr = 0; + return JavaScriptGrammar::T_STRING_LITERAL; + case Number: + qsyylval.dval = dval; + return JavaScriptGrammar::T_NUMERIC_LITERAL; + case Bad: + return -1; + default: + Q_ASSERT(!"unhandled numeration value in switch"); + return -1; + } +} + +bool JavaScript::Lexer::isWhiteSpace() const +{ + return (current == ' ' || current == '\t' || + current == 0x0b || current == 0x0c); +} + +bool JavaScript::Lexer::isLineTerminator() const +{ + return (current == '\n' || current == '\r'); +} + +bool JavaScript::Lexer::isIdentLetter(ushort c) +{ + /* TODO: allow other legitimate unicode chars */ + return ((c >= 'a' && c <= 'z') + || (c >= 'A' && c <= 'Z') + || c == '$' + || c == '_'); +} + +bool JavaScript::Lexer::isDecimalDigit(ushort c) +{ + return (c >= '0' && c <= '9'); +} + +bool JavaScript::Lexer::isHexDigit(ushort c) const +{ + return ((c >= '0' && c <= '9') + || (c >= 'a' && c <= 'f') + || (c >= 'A' && c <= 'F')); +} + +bool JavaScript::Lexer::isOctalDigit(ushort c) const +{ + return (c >= '0' && c <= '7'); +} + +int JavaScript::Lexer::matchPunctuator(ushort c1, ushort c2, + ushort c3, ushort c4) +{ + if (c1 == '>' && c2 == '>' && c3 == '>' && c4 == '=') { + shift(4); + return JavaScriptGrammar::T_GT_GT_GT_EQ; + } else if (c1 == '=' && c2 == '=' && c3 == '=') { + shift(3); + return JavaScriptGrammar::T_EQ_EQ_EQ; + } else if (c1 == '!' && c2 == '=' && c3 == '=') { + shift(3); + return JavaScriptGrammar::T_NOT_EQ_EQ; + } else if (c1 == '>' && c2 == '>' && c3 == '>') { + shift(3); + return JavaScriptGrammar::T_GT_GT_GT; + } else if (c1 == '<' && c2 == '<' && c3 == '=') { + shift(3); + return JavaScriptGrammar::T_LT_LT_EQ; + } else if (c1 == '>' && c2 == '>' && c3 == '=') { + shift(3); + return JavaScriptGrammar::T_GT_GT_EQ; + } else if (c1 == '<' && c2 == '=') { + shift(2); + return JavaScriptGrammar::T_LE; + } else if (c1 == '>' && c2 == '=') { + shift(2); + return JavaScriptGrammar::T_GE; + } else if (c1 == '!' && c2 == '=') { + shift(2); + return JavaScriptGrammar::T_NOT_EQ; + } else if (c1 == '+' && c2 == '+') { + shift(2); + return JavaScriptGrammar::T_PLUS_PLUS; + } else if (c1 == '-' && c2 == '-') { + shift(2); + return JavaScriptGrammar::T_MINUS_MINUS; + } else if (c1 == '=' && c2 == '=') { + shift(2); + return JavaScriptGrammar::T_EQ_EQ; + } else if (c1 == '+' && c2 == '=') { + shift(2); + return JavaScriptGrammar::T_PLUS_EQ; + } else if (c1 == '-' && c2 == '=') { + shift(2); + return JavaScriptGrammar::T_MINUS_EQ; + } else if (c1 == '*' && c2 == '=') { + shift(2); + return JavaScriptGrammar::T_STAR_EQ; + } else if (c1 == '/' && c2 == '=') { + shift(2); + return JavaScriptGrammar::T_DIVIDE_EQ; + } else if (c1 == '&' && c2 == '=') { + shift(2); + return JavaScriptGrammar::T_AND_EQ; + } else if (c1 == '^' && c2 == '=') { + shift(2); + return JavaScriptGrammar::T_XOR_EQ; + } else if (c1 == '%' && c2 == '=') { + shift(2); + return JavaScriptGrammar::T_REMAINDER_EQ; + } else if (c1 == '|' && c2 == '=') { + shift(2); + return JavaScriptGrammar::T_OR_EQ; + } else if (c1 == '<' && c2 == '<') { + shift(2); + return JavaScriptGrammar::T_LT_LT; + } else if (c1 == '>' && c2 == '>') { + shift(2); + return JavaScriptGrammar::T_GT_GT; + } else if (c1 == '&' && c2 == '&') { + shift(2); + return JavaScriptGrammar::T_AND_AND; + } else if (c1 == '|' && c2 == '|') { + shift(2); + return JavaScriptGrammar::T_OR_OR; + } + + switch(c1) { + case '=': shift(1); return JavaScriptGrammar::T_EQ; + case '>': shift(1); return JavaScriptGrammar::T_GT; + case '<': shift(1); return JavaScriptGrammar::T_LT; + case ',': shift(1); return JavaScriptGrammar::T_COMMA; + case '!': shift(1); return JavaScriptGrammar::T_NOT; + case '~': shift(1); return JavaScriptGrammar::T_TILDE; + case '?': shift(1); return JavaScriptGrammar::T_QUESTION; + case ':': shift(1); return JavaScriptGrammar::T_COLON; + case '.': shift(1); return JavaScriptGrammar::T_DOT; + case '+': shift(1); return JavaScriptGrammar::T_PLUS; + case '-': shift(1); return JavaScriptGrammar::T_MINUS; + case '*': shift(1); return JavaScriptGrammar::T_STAR; + case '/': shift(1); return JavaScriptGrammar::T_DIVIDE_; + case '&': shift(1); return JavaScriptGrammar::T_AND; + case '|': shift(1); return JavaScriptGrammar::T_OR; + case '^': shift(1); return JavaScriptGrammar::T_XOR; + case '%': shift(1); return JavaScriptGrammar::T_REMAINDER; + case '(': shift(1); return JavaScriptGrammar::T_LPAREN; + case ')': shift(1); return JavaScriptGrammar::T_RPAREN; + case '{': shift(1); return JavaScriptGrammar::T_LBRACE; + case '}': shift(1); return JavaScriptGrammar::T_RBRACE; + case '[': shift(1); return JavaScriptGrammar::T_LBRACKET; + case ']': shift(1); return JavaScriptGrammar::T_RBRACKET; + case ';': shift(1); return JavaScriptGrammar::T_SEMICOLON; + + default: return -1; + } +} + +ushort JavaScript::Lexer::singleEscape(ushort c) const +{ + switch(c) { + case 'b': + return 0x08; + case 't': + return 0x09; + case 'n': + return 0x0A; + case 'v': + return 0x0B; + case 'f': + return 0x0C; + case 'r': + return 0x0D; + case '"': + return 0x22; + case '\'': + return 0x27; + case '\\': + return 0x5C; + default: + return c; + } +} + +ushort JavaScript::Lexer::convertOctal(ushort c1, ushort c2, + ushort c3) const +{ + return ((c1 - '0') * 64 + (c2 - '0') * 8 + c3 - '0'); +} + +unsigned char JavaScript::Lexer::convertHex(ushort c) +{ + if (c >= '0' && c <= '9') + return (c - '0'); + else if (c >= 'a' && c <= 'f') + return (c - 'a' + 10); + else + return (c - 'A' + 10); +} + +unsigned char JavaScript::Lexer::convertHex(ushort c1, ushort c2) +{ + return ((convertHex(c1) << 4) + convertHex(c2)); +} + +QChar JavaScript::Lexer::convertUnicode(ushort c1, ushort c2, + ushort c3, ushort c4) +{ + return QChar((convertHex(c3) << 4) + convertHex(c4), + (convertHex(c1) << 4) + convertHex(c2)); +} + +void JavaScript::Lexer::record8(ushort c) +{ + Q_ASSERT(c <= 0xff); + + // enlarge buffer if full + if (pos8 >= size8 - 1) { + char *tmp = new char[2 * size8]; + memcpy(tmp, buffer8, size8 * sizeof(char)); + delete [] buffer8; + buffer8 = tmp; + size8 *= 2; + } + + buffer8[pos8++] = (char) c; +} + +void JavaScript::Lexer::record16(QChar c) +{ + // enlarge buffer if full + if (pos16 >= size16 - 1) { + QChar *tmp = new QChar[2 * size16]; + memcpy(tmp, buffer16, size16 * sizeof(QChar)); + delete [] buffer16; + buffer16 = tmp; + size16 *= 2; + } + + buffer16[pos16++] = c; +} + +void JavaScript::Lexer::recordStartPos() +{ + startpos = pos; + startlineno = yylineno; + startcolumn = yycolumn; +} + +bool JavaScript::Lexer::scanRegExp(RegExpBodyPrefix prefix) +{ + pos16 = 0; + bool lastWasEscape = false; + + if (prefix == EqualPrefix) + record16(QLatin1Char('=')); + + while (1) { + if (isLineTerminator() || current == 0) { + errmsg = QLatin1String("Unterminated regular expression literal"); + return false; + } + else if (current != '/' || lastWasEscape == true) + { + record16(current); + lastWasEscape = !lastWasEscape && (current == '\\'); + } + else { + if (driver) + pattern = driver->intern(buffer16, pos16); + else + pattern = 0; + pos16 = 0; + shift(1); + break; + } + shift(1); + } + + flags = 0; + while (isIdentLetter(current)) { + int flag = JavaScript::Ecma::RegExp::flagFromChar(current); + if (flag == 0) { + errmsg = QString::fromLatin1("Invalid regular expression flag '%0'") + .arg(QChar(current)); + return false; + } + flags |= flag; + record16(current); + shift(1); + } + + return true; +} + +void JavaScript::Lexer::syncProhibitAutomaticSemicolon() +{ + if (parenthesesState == BalancedParentheses) { + // we have seen something like "if (foo)", which means we should + // never insert an automatic semicolon at this point, since it would + // then be expanded into an empty statement (ECMA-262 7.9.1) + prohibitAutomaticSemicolon = true; + parenthesesState = IgnoreParentheses; + } else { + prohibitAutomaticSemicolon = false; + } +} + +QT_END_NAMESPACE + + diff --git a/src/declarative/qml/parser/javascriptlexer_p.h b/src/declarative/qml/parser/javascriptlexer_p.h new file mode 100644 index 0000000..e71c10c --- /dev/null +++ b/src/declarative/qml/parser/javascriptlexer_p.h @@ -0,0 +1,250 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtScript 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 JAVASCRIPTLEXER_P_H +#define JAVASCRIPTLEXER_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include + + + +QT_BEGIN_NAMESPACE + +class JavaScriptEnginePrivate; +class JavaScriptNameIdImpl; + +namespace JavaScript { + +class Lexer +{ +public: + Lexer(JavaScriptEnginePrivate *eng); + ~Lexer(); + + void setCode(const QString &c, int lineno); + int lex(); + + int currentLineNo() const { return yylineno; } + int currentColumnNo() const { return yycolumn; } + + int tokenOffset() const { return startpos; } + int tokenLength() const { return pos - startpos; } + + int startLineNo() const { return startlineno; } + int startColumnNo() const { return startcolumn; } + + int endLineNo() const { return currentLineNo(); } + int endColumnNo() const + { int col = currentColumnNo(); return (col > 0) ? col - 1 : col; } + + bool prevTerminator() const { return terminator; } + + enum State { Start, + Identifier, + InIdentifier, + InSingleLineComment, + InMultiLineComment, + InNum, + InNum0, + InHex, + InOctal, + InDecimal, + InExponentIndicator, + InExponent, + Hex, + Octal, + Number, + String, + Eof, + InString, + InEscapeSequence, + InHexEscape, + InUnicodeEscape, + Other, + Bad }; + + enum Error { + NoError, + IllegalCharacter, + UnclosedStringLiteral, + IllegalEscapeSequence, + IllegalUnicodeEscapeSequence, + UnclosedComment, + IllegalExponentIndicator, + IllegalIdentifier + }; + + enum ParenthesesState { + IgnoreParentheses, + CountParentheses, + BalancedParentheses + }; + + enum RegExpBodyPrefix { + NoPrefix, + EqualPrefix + }; + + bool scanRegExp(RegExpBodyPrefix prefix = NoPrefix); + + JavaScriptNameIdImpl *pattern; + int flags; + + State lexerState() const + { return state; } + + QString errorMessage() const + { return errmsg; } + void setErrorMessage(const QString &err) + { errmsg = err; } + void setErrorMessage(const char *err) + { setErrorMessage(QString::fromLatin1(err)); } + + Error error() const + { return err; } + void clearError() + { err = NoError; } + +private: + JavaScriptEnginePrivate *driver; + int yylineno; + bool done; + char *buffer8; + QChar *buffer16; + uint size8, size16; + uint pos8, pos16; + bool terminator; + bool restrKeyword; + // encountered delimiter like "'" and "}" on last run + bool delimited; + int stackToken; + + State state; + void setDone(State s); + uint pos; + void shift(uint p); + int lookupKeyword(const char *); + + bool isWhiteSpace() const; + bool isLineTerminator() const; + bool isHexDigit(ushort c) const; + bool isOctalDigit(ushort c) const; + + int matchPunctuator(ushort c1, ushort c2, + ushort c3, ushort c4); + ushort singleEscape(ushort c) const; + ushort convertOctal(ushort c1, ushort c2, + ushort c3) const; +public: + static unsigned char convertHex(ushort c1); + static unsigned char convertHex(ushort c1, ushort c2); + static QChar convertUnicode(ushort c1, ushort c2, + ushort c3, ushort c4); + static bool isIdentLetter(ushort c); + static bool isDecimalDigit(ushort c); + + inline int ival() const { return qsyylval.ival; } + inline double dval() const { return qsyylval.dval; } + inline JavaScriptNameIdImpl *ustr() const { return qsyylval.ustr; } + + const QChar *characterBuffer() const { return buffer16; } + int characterCount() const { return pos16; } + +private: + void record8(ushort c); + void record16(QChar c); + void recordStartPos(); + + int findReservedWord(const QChar *buffer, int size) const; + + void syncProhibitAutomaticSemicolon(); + + const QChar *code; + uint length; + int yycolumn; + int startpos; + int startlineno; + int startcolumn; + int bol; // begin of line + + union { + int ival; + double dval; + JavaScriptNameIdImpl *ustr; + } qsyylval; + + // current and following unicode characters + ushort current, next1, next2, next3; + + struct keyword { + const char *name; + int token; + }; + + QString errmsg; + Error err; + + bool wantRx; + bool check_reserved; + + ParenthesesState parenthesesState; + int parenthesesCount; + bool prohibitAutomaticSemicolon; +}; + +} // namespace JavaScript + +QT_END_NAMESPACE + + + +#endif diff --git a/src/declarative/qml/parser/javascriptmemorypool_p.h b/src/declarative/qml/parser/javascriptmemorypool_p.h new file mode 100644 index 0000000..cff7677 --- /dev/null +++ b/src/declarative/qml/parser/javascriptmemorypool_p.h @@ -0,0 +1,130 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtScript 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 JAVASCRIPTMEMORYPOOL_P_H +#define JAVASCRIPTMEMORYPOOL_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include +#include +#include + +QT_BEGIN_NAMESPACE + +namespace JavaScript { + +class MemoryPool : public QSharedData +{ +public: + enum { maxBlockCount = -1 }; + enum { defaultBlockSize = 1 << 12 }; + + MemoryPool() { + m_blockIndex = maxBlockCount; + m_currentIndex = 0; + m_storage = 0; + m_currentBlock = 0; + m_currentBlockSize = 0; + } + + virtual ~MemoryPool() { + for (int index = 0; index < m_blockIndex + 1; ++index) + qFree(m_storage[index]); + + qFree(m_storage); + } + + char *allocate(int bytes) { + bytes += (8 - bytes) & 7; // ensure multiple of 8 bytes (maintain alignment) + if (m_currentBlock == 0 || m_currentBlockSize < m_currentIndex + bytes) { + ++m_blockIndex; + m_currentBlockSize = defaultBlockSize << m_blockIndex; + + m_storage = reinterpret_cast(qRealloc(m_storage, sizeof(char*) * (1 + m_blockIndex))); + m_currentBlock = m_storage[m_blockIndex] = reinterpret_cast(qMalloc(m_currentBlockSize)); + ::memset(m_currentBlock, 0, m_currentBlockSize); + + m_currentIndex = (8 - quintptr(m_currentBlock)) & 7; // ensure first chunk is 64-bit aligned + Q_ASSERT(m_currentIndex + bytes <= m_currentBlockSize); + } + + char *p = reinterpret_cast + (m_currentBlock + m_currentIndex); + + m_currentIndex += bytes; + + return p; + } + + int bytesAllocated() const { + int bytes = 0; + for (int index = 0; index < m_blockIndex; ++index) + bytes += (defaultBlockSize << index); + bytes += m_currentIndex; + return bytes; + } + +private: + int m_blockIndex; + int m_currentIndex; + char *m_currentBlock; + int m_currentBlockSize; + char **m_storage; + +private: + Q_DISABLE_COPY(MemoryPool) +}; + +} // namespace JavaScript + +QT_END_NAMESPACE + +#endif diff --git a/src/declarative/qml/parser/javascriptnodepool_p.h b/src/declarative/qml/parser/javascriptnodepool_p.h new file mode 100644 index 0000000..3f59123 --- /dev/null +++ b/src/declarative/qml/parser/javascriptnodepool_p.h @@ -0,0 +1,139 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtScript 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 JAVASCRIPTNODEPOOL_P_H +#define JAVASCRIPTNODEPOOL_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include +#include + +#include "javascriptmemorypool_p.h" + +QT_BEGIN_NAMESPACE + +class JavaScriptEnginePrivate; + +namespace JavaScript { + +namespace AST { +class Node; +} // namespace AST + +class Code; +class CompilationUnit; + +template +inline NodeType *makeAstNode(MemoryPool *storage) +{ + NodeType *node = new (storage->allocate(sizeof(NodeType))) NodeType(); + return node; +} + +template +inline NodeType *makeAstNode(MemoryPool *storage, Arg1 arg1) +{ + NodeType *node = new (storage->allocate(sizeof(NodeType))) NodeType(arg1); + return node; +} + +template +inline NodeType *makeAstNode(MemoryPool *storage, Arg1 arg1, Arg2 arg2) +{ + NodeType *node = new (storage->allocate(sizeof(NodeType))) NodeType(arg1, arg2); + return node; +} + +template +inline NodeType *makeAstNode(MemoryPool *storage, Arg1 arg1, Arg2 arg2, Arg3 arg3) +{ + NodeType *node = new (storage->allocate(sizeof(NodeType))) NodeType(arg1, arg2, arg3); + return node; +} + +template +inline NodeType *makeAstNode(MemoryPool *storage, Arg1 arg1, Arg2 arg2, Arg3 arg3, Arg4 arg4) +{ + NodeType *node = new (storage->allocate(sizeof(NodeType))) NodeType(arg1, arg2, arg3, arg4); + return node; +} + +class NodePool : public MemoryPool +{ +public: + NodePool(const QString &fileName, JavaScriptEnginePrivate *engine); + virtual ~NodePool(); + + Code *createCompiledCode(AST::Node *node, CompilationUnit &compilation); + + inline QString fileName() const { return m_fileName; } + inline JavaScriptEnginePrivate *engine() const { return m_engine; } +#ifndef J_SCRIPT_NO_EVENT_NOTIFY + inline qint64 id() const { return m_id; } +#endif + +private: + QHash m_codeCache; + QString m_fileName; + JavaScriptEnginePrivate *m_engine; +#ifndef J_SCRIPT_NO_EVENT_NOTIFY + qint64 m_id; +#endif + +private: + Q_DISABLE_COPY(NodePool) +}; + +} // namespace JavaScript + +QT_END_NAMESPACE + +#endif diff --git a/src/declarative/qml/parser/javascriptparser.cpp b/src/declarative/qml/parser/javascriptparser.cpp new file mode 100644 index 0000000..0b87500 --- /dev/null +++ b/src/declarative/qml/parser/javascriptparser.cpp @@ -0,0 +1,1207 @@ +// 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 QtScript 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 + +#include + +#include "javascriptengine_p.h" +#include "javascriptlexer_p.h" +#include "javascriptast_p.h" +#include "javascriptnodepool_p.h" + + + +#include "javascriptparser_p.h" + +// +// This file is automatically generated from javascript.g. +// Changes will be lost. +// + +using namespace JavaScript; + +QT_BEGIN_NAMESPACE + +void JavaScriptParser::reallocateStack() +{ + if (! stack_size) + stack_size = 128; + else + stack_size <<= 1; + + sym_stack = reinterpret_cast (qRealloc(sym_stack, stack_size * sizeof(Value))); + state_stack = reinterpret_cast (qRealloc(state_stack, stack_size * sizeof(int))); + location_stack = reinterpret_cast (qRealloc(location_stack, stack_size * sizeof(AST::SourceLocation))); +} + +inline static bool automatic(JavaScriptEnginePrivate *driver, int token) +{ + return token == JavaScriptGrammar::T_RBRACE + || token == 0 + || driver->lexer()->prevTerminator(); +} + + +JavaScriptParser::JavaScriptParser(): + tos(0), + stack_size(0), + sym_stack(0), + state_stack(0), + location_stack(0), + first_token(0), + last_token(0) +{ +} + +JavaScriptParser::~JavaScriptParser() +{ + if (stack_size) { + qFree(sym_stack); + qFree(state_stack); + qFree(location_stack); + } +} + +static inline AST::SourceLocation location(Lexer *lexer) +{ + AST::SourceLocation loc; + loc.offset = lexer->tokenOffset(); + loc.length = lexer->tokenLength(); + loc.startLine = lexer->startLineNo(); + loc.startColumn = lexer->startColumnNo(); + return loc; +} + +bool JavaScriptParser::parse(JavaScriptEnginePrivate *driver) +{ + Lexer *lexer = driver->lexer(); + bool hadErrors = false; + int yytoken = -1; + int action = 0; + + first_token = last_token = 0; + + tos = -1; + + do { + if (++tos == stack_size) + reallocateStack(); + + state_stack[tos] = action; + + _Lcheck_token: + if (yytoken == -1 && -TERMINAL_COUNT != action_index[action]) { + yyprevlloc = yylloc; + + if (first_token == last_token) { + yytoken = lexer->lex(); + yylval = lexer->dval(); + yylloc = location(lexer); + } else { + yytoken = first_token->token; + yylval = first_token->dval; + yylloc = first_token->loc; + ++first_token; + } + } + + action = t_action(action, yytoken); + if (action > 0) { + if (action != ACCEPT_STATE) { + yytoken = -1; + sym(1).dval = yylval; + loc(1) = yylloc; + } else { + --tos; + return ! hadErrors; + } + } else if (action < 0) { + const int r = -action - 1; + tos -= rhs[r]; + + switch (r) { + +case 0: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).UiObjectMemberList->finish()); +} break; + +case 2: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).UiObjectMember); +} break; +case 3: +case 4: { + AST::UiObjectMemberList *node = makeAstNode (driver->nodePool(), + sym(1).UiObjectMemberList, sym(3).UiObjectMember); + sym(1).Node = node; +} break; + +case 5: { + AST::UiObjectInitializer *node = makeAstNode (driver->nodePool(), sym(2).UiObjectMemberList->finish()); + node->lbraceToken = loc(1); + node->rbraceToken = loc(3); + sym(1).Node = node; +} break; + +case 6: { + AST::UiObjectBinding *node = makeAstNode (driver->nodePool(), sym(1).UiQualifiedId->finish(), + sym(3).sval, sym(4).UiObjectInitializer); + node->colonToken = loc(2); + node->identifierToken = loc(3); + sym(1).Node = node; +} break; + +case 7: { + AST::UiObjectDefinition *node = makeAstNode (driver->nodePool(), sym(1).sval, + sym(2).UiObjectInitializer); + node->identifierToken = loc(1); + sym(1).Node = node; +} break; + +case 8: { + AST::UiArrayBinding *node = makeAstNode (driver->nodePool(), sym(1).UiQualifiedId->finish(), + sym(4).UiObjectMemberList->finish()); + node->colonToken = loc(2); + node->lbracketToken = loc(3); + node->rbraceToken = loc(5); + sym(1).Node = node; +} break; + +case 9: { + AST::UiScriptBinding *node = makeAstNode (driver->nodePool(), sym(1).UiQualifiedId->finish(), + sym(3).Statement); + node->colonToken = loc(2); + sym(1).Node = node; +} break; + +case 10: { + AST::UiPublicMember *node = makeAstNode (driver->nodePool(), sym(2).sval, sym(3).sval, + sym(5).Expression, sym(6).UiObjectInitializer); + node->publicToken = loc(1); + node->attributeTypeToken = loc(2); + node->identifierToken = loc(3); + node->colonToken = loc(4); + sym(1).Node = node; +} break; + +case 11: { + AST::UiPublicMember *node = makeAstNode (driver->nodePool(), sym(2).sval, sym(3).sval); + node->publicToken = loc(1); + node->attributeTypeToken = loc(2); + node->identifierToken = loc(3); + sym(1).Node = node; +} break; + +case 12: { + AST::UiPublicMember *node = makeAstNode (driver->nodePool(), sym(2).sval, sym(3).sval, + sym(5).Expression, static_cast(0)); + node->publicToken = loc(1); + node->attributeTypeToken = loc(2); + node->identifierToken = loc(3); + node->colonToken = loc(4); + sym(1).Node = node; +} break; + +case 13: { + AST::UiQualifiedId *node = makeAstNode (driver->nodePool(), sym(1).sval); + node->identifierToken = loc(1); + sym(1).Node = node; +} break; + +case 14: + AST::UiQualifiedId *node = makeAstNode (driver->nodePool(), sym(1).UiQualifiedId, sym(3).sval); + node->identifierToken = loc(3); + sym(1).Node = node; + break; + +case 15: { + AST::ThisExpression *node = makeAstNode (driver->nodePool()); + node->thisToken = loc(1); + sym(1).Node = node; +} break; + +case 16: { + AST::IdentifierExpression *node = makeAstNode (driver->nodePool(), sym(1).sval); + node->identifierToken = loc(1); + sym(1).Node = node; +} break; + +case 17: { + AST::NullExpression *node = makeAstNode (driver->nodePool()); + node->nullToken = loc(1); + sym(1).Node = node; +} break; + +case 18: { + AST::TrueLiteral *node = makeAstNode (driver->nodePool()); + node->trueToken = loc(1); + sym(1).Node = node; +} break; + +case 19: { + AST::FalseLiteral *node = makeAstNode (driver->nodePool()); + node->falseToken = loc(1); + sym(1).Node = node; +} break; + +case 20: { + AST::NumericLiteral *node = makeAstNode (driver->nodePool(), sym(1).dval); + node->literalToken = loc(1); + sym(1).Node = node; +} break; + +case 21: { + AST::StringLiteral *node = makeAstNode (driver->nodePool(), sym(1).sval); + node->literalToken = loc(1); + sym(1).Node = node; +} break; + +case 22: { + bool rx = lexer->scanRegExp(Lexer::NoPrefix); + if (!rx) { + diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, lexer->startLineNo(), + lexer->startColumnNo(), lexer->errorMessage())); + return false; + } + AST::RegExpLiteral *node = makeAstNode (driver->nodePool(), lexer->pattern, lexer->flags); + node->literalToken = loc(1); + sym(1).Node = node; +} break; + +case 23: { + bool rx = lexer->scanRegExp(Lexer::EqualPrefix); + if (!rx) { + diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, lexer->startLineNo(), + lexer->startColumnNo(), lexer->errorMessage())); + return false; + } + AST::RegExpLiteral *node = makeAstNode (driver->nodePool(), lexer->pattern, lexer->flags); + node->literalToken = loc(1); + sym(1).Node = node; +} break; + +case 24: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Elision); +} break; + +case 25: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(2).ElementList->finish ()); +} break; + +case 26: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(2).ElementList->finish (), sym(4).Elision); +} break; + +case 27: { + if (sym(2).Node) + sym(1).Node = makeAstNode (driver->nodePool(), sym(2).PropertyNameAndValueList->finish ()); + else + sym(1).Node = makeAstNode (driver->nodePool()); +} break; + +case 28: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(2).PropertyNameAndValueList->finish ()); +} break; + +case 29: { + sym(1) = sym(2); +} break; + +case 30: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Elision, sym(2).Expression); +} break; + +case 31: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).ElementList, sym(3).Elision, sym(4).Expression); +} break; + +case 32: { + sym(1).Node = makeAstNode (driver->nodePool()); +} break; + +case 33: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Elision); +} break; + +case 34: { + sym(1).Node = 0; +} break; + +case 35: { + sym(1).Elision = sym(1).Elision->finish (); +} break; + +case 36: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).PropertyName, sym(3).Expression); +} break; + +case 37: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).PropertyNameAndValueList, sym(3).PropertyName, sym(5).Expression); +} break; + +case 38: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).sval); +} break; + +case 39: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).sval); +} break; + +case 40: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).dval); +} break; + +case 41: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).sval); +} break; + +case 42: + +case 43: + +case 44: + +case 45: + +case 46: + +case 47: + +case 48: + +case 49: + +case 50: + +case 51: + +case 52: + +case 53: + +case 54: + +case 55: + +case 56: + +case 57: + +case 58: + +case 59: + +case 60: + +case 61: + +case 62: + +case 63: + +case 64: + +case 65: + +case 66: + +case 67: + +case 68: + +case 69: + +case 70: + +case 71: + +case 72: +{ + sym(1).sval = driver->intern(lexer->characterBuffer(), lexer->characterCount()); +} break; + +case 77: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression); +} break; + +case 78: { + AST::FieldMemberExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).sval); + node->dotToken = loc(2); + node->identifierToken = loc(3); + sym(1).Node = node; +} break; + +case 79: { + AST::NewMemberExpression *node = makeAstNode (driver->nodePool(), sym(2).Expression, sym(4).ArgumentList); + node->newToken = loc(1); + node->lparenToken = loc(3); + node->rparenToken = loc(5); + sym(1).Node = node; +} break; + +case 81: { + AST::NewExpression *node = makeAstNode (driver->nodePool(), sym(2).Expression); + node->newToken = loc(1); + sym(1).Node = node; +} break; + +case 82: { + AST::CallExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).ArgumentList); + node->lparenToken = loc(2); + node->rparenToken = loc(4); + sym(1).Node = node; +} break; + +case 83: { + AST::CallExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).ArgumentList); + node->lparenToken = loc(2); + node->rparenToken = loc(4); + sym(1).Node = node; +} break; + +case 84: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression); +} break; + +case 85: { + AST::FieldMemberExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).sval); + node->dotToken = loc(2); + node->identifierToken = loc(3); + sym(1).Node = node; +} break; + +case 86: { + sym(1).Node = 0; +} break; + +case 87: { + sym(1).Node = sym(1).ArgumentList->finish(); +} break; + +case 88: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression); +} break; + +case 89: { + AST::ArgumentList *node = makeAstNode (driver->nodePool(), sym(1).ArgumentList, sym(3).Expression); + node->commaToken = loc(2); + sym(1).Node = node; +} break; + +case 93: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression); +} break; + +case 94: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression); +} break; + +case 96: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); +} break; + +case 97: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); +} break; + +case 98: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); +} break; + +case 99: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); +} break; + +case 100: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); +} break; + +case 101: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); +} break; + +case 102: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); +} break; + +case 103: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); +} break; + +case 104: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); +} break; + +case 106: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Mul, sym(3).Expression); +} break; + +case 107: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Div, sym(3).Expression); +} break; + +case 108: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Mod, sym(3).Expression); +} break; + +case 110: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Add, sym(3).Expression); +} break; + +case 111: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Sub, sym(3).Expression); +} break; + +case 113: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::LShift, sym(3).Expression); +} break; + +case 114: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::RShift, sym(3).Expression); +} break; + +case 115: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::URShift, sym(3).Expression); +} break; + +case 117: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Lt, sym(3).Expression); +} break; + +case 118: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Gt, sym(3).Expression); +} break; + +case 119: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Le, sym(3).Expression); +} break; + +case 120: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Ge, sym(3).Expression); +} break; + +case 121: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::InstanceOf, sym(3).Expression); +} break; + +case 122: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::In, sym(3).Expression); +} break; + +case 124: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Lt, sym(3).Expression); +} break; + +case 125: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Gt, sym(3).Expression); +} break; + +case 126: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Le, sym(3).Expression); +} break; + +case 127: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Ge, sym(3).Expression); +} break; + +case 128: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::InstanceOf, sym(3).Expression); +} break; + +case 130: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Equal, sym(3).Expression); +} break; + +case 131: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::NotEqual, sym(3).Expression); +} break; + +case 132: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::StrictEqual, sym(3).Expression); +} break; + +case 133: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::StrictNotEqual, sym(3).Expression); +} break; + +case 135: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Equal, sym(3).Expression); +} break; + +case 136: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::NotEqual, sym(3).Expression); +} break; + +case 137: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::StrictEqual, sym(3).Expression); +} break; + +case 138: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::StrictNotEqual, sym(3).Expression); +} break; + +case 140: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::BitAnd, sym(3).Expression); +} break; + +case 142: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::BitAnd, sym(3).Expression); +} break; + +case 144: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::BitXor, sym(3).Expression); +} break; + +case 146: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::BitXor, sym(3).Expression); +} break; + +case 148: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::BitOr, sym(3).Expression); +} break; + +case 150: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::BitOr, sym(3).Expression); +} break; + +case 152: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::And, sym(3).Expression); +} break; + +case 154: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::And, sym(3).Expression); +} break; + +case 156: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Or, sym(3).Expression); +} break; + +case 158: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Or, sym(3).Expression); +} break; + +case 160: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression, sym(5).Expression); +} break; + +case 162: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression, sym(5).Expression); +} break; + +case 164: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(2).ival, sym(3).Expression); +} break; + +case 166: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(2).ival, sym(3).Expression); +} break; + +case 167: { + sym(1).ival = QSOperator::Assign; +} break; + +case 168: { + sym(1).ival = QSOperator::InplaceMul; +} break; + +case 169: { + sym(1).ival = QSOperator::InplaceDiv; +} break; + +case 170: { + sym(1).ival = QSOperator::InplaceMod; +} break; + +case 171: { + sym(1).ival = QSOperator::InplaceAdd; +} break; + +case 172: { + sym(1).ival = QSOperator::InplaceSub; +} break; + +case 173: { + sym(1).ival = QSOperator::InplaceLeftShift; +} break; + +case 174: { + sym(1).ival = QSOperator::InplaceRightShift; +} break; + +case 175: { + sym(1).ival = QSOperator::InplaceURightShift; +} break; + +case 176: { + sym(1).ival = QSOperator::InplaceAnd; +} break; + +case 177: { + sym(1).ival = QSOperator::InplaceXor; +} break; + +case 178: { + sym(1).ival = QSOperator::InplaceOr; +} break; + +case 180: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression); +} break; + +case 181: { + sym(1).Node = 0; +} break; + +case 184: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression); +} break; + +case 185: { + sym(1).Node = 0; +} break; + +case 202: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(2).StatementList); +} break; + +case 203: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Statement); +} break; + +case 204: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).StatementList, sym(2).Statement); +} break; + +case 205: { + sym(1).Node = 0; +} break; + +case 206: { + sym(1).Node = sym(1).StatementList->finish (); +} break; + +case 208: { + AST::VariableStatement *node = makeAstNode (driver->nodePool(), sym(2).VariableDeclarationList->finish (/*readOnly=*/sym(1).ival == T_CONST)); + node->declarationKindToken = loc(1); + node->semicolonToken = loc(3); + sym(1).Node = node; +} break; + +case 209: { + sym(1).ival = T_CONST; +} break; + +case 210: { + sym(1).ival = T_VAR; +} break; + +case 211: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).VariableDeclaration); +} break; + +case 212: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).VariableDeclarationList, sym(3).VariableDeclaration); +} break; + +case 213: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).VariableDeclaration); +} break; + +case 214: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).VariableDeclarationList, sym(3).VariableDeclaration); +} break; + +case 215: { + AST::VariableDeclaration *node = makeAstNode (driver->nodePool(), sym(1).sval, sym(2).Expression); + node->identifierToken = loc(1); + sym(1).Node = node; +} break; + +case 216: { + AST::VariableDeclaration *node = makeAstNode (driver->nodePool(), sym(1).sval, sym(2).Expression); + node->identifierToken = loc(1); + sym(1).Node = node; +} break; + +case 217: { + sym(1) = sym(2); +} break; + +case 218: { + sym(1).Node = 0; +} break; + +case 220: { + sym(1) = sym(2); +} break; + +case 221: { + sym(1).Node = 0; +} break; + +case 223: { + sym(1).Node = makeAstNode (driver->nodePool()); +} break; + +case 225: { + AST::ExpressionStatement *node = makeAstNode (driver->nodePool(), sym(1).Expression); + node->semicolonToken = loc(2); + sym(1).Node = node; +} break; + +case 226: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Statement, sym(7).Statement); +} break; + +case 227: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Statement); +} break; + +case 229: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Statement, sym(5).Expression); +} break; + +case 230: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Statement); +} break; + +case 231: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Expression, sym(7).Expression, sym(9).Statement); +} break; + +case 232: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(4).VariableDeclarationList->finish (/*readOnly=*/false), sym(6).Expression, sym(8).Expression, sym(10).Statement); +} break; + +case 233: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Expression, sym(7).Statement); +} break; + +case 234: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(4).VariableDeclaration, sym(6).Expression, sym(8).Statement); +} break; + +case 236: { + sym(1).Node = makeAstNode (driver->nodePool()); +} break; + +case 238: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(2).sval); +} break; + +case 240: { + sym(1).Node = makeAstNode (driver->nodePool()); +} break; + +case 242: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(2).sval); +} break; + +case 244: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); +} break; + +case 245: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Statement); +} break; + +case 246: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).CaseBlock); +} break; + +case 247: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(2).CaseClauses); +} break; + +case 248: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(2).CaseClauses, sym(3).DefaultClause, sym(4).CaseClauses); +} break; + +case 249: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).CaseClause); +} break; + +case 250: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).CaseClauses, sym(2).CaseClause); +} break; + +case 251: { + sym(1).Node = 0; +} break; + +case 252: { + sym(1).Node = sym(1).CaseClauses->finish (); +} break; + +case 253: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression, sym(4).StatementList); +} break; + +case 254: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(3).StatementList); +} break; + +case 255: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).sval, sym(3).Statement); +} break; + +case 257: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); +} break; + +case 258: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Statement, sym(3).Catch); +} break; + +case 259: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Statement, sym(3).Finally); +} break; + +case 260: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Statement, sym(3).Catch, sym(4).Finally); +} break; + +case 261: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(3).sval, sym(5).Statement); +} break; + +case 262: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Statement); +} break; + +case 264: { + sym(1).Node = makeAstNode (driver->nodePool()); +} break; + +case 265: { + AST::FunctionDeclaration *node = makeAstNode (driver->nodePool(), sym(2).sval, sym(4).FormalParameterList, sym(7).FunctionBody); + node->functionToken = loc(1); + node->identifierToken = loc(2); + node->lparenToken = loc(3); + node->rparenToken = loc(5); + node->lbraceToken = loc(6); + node->rbraceToken = loc(8); + sym(1).Node = node; +} break; + +case 266: { + AST::FunctionExpression *node = makeAstNode (driver->nodePool(), sym(2).sval, sym(4).FormalParameterList, sym(7).FunctionBody); + node->functionToken = loc(1); + if (sym(2).sval) + node->identifierToken = loc(2); + node->lparenToken = loc(3); + node->rparenToken = loc(5); + node->lbraceToken = loc(6); + node->rbraceToken = loc(8); + sym(1).Node = node; +} break; + +case 267: { + AST::FormalParameterList *node = makeAstNode (driver->nodePool(), sym(1).sval); + node->identifierToken = loc(1); + sym(1).Node = node; +} break; + +case 268: { + AST::FormalParameterList *node = makeAstNode (driver->nodePool(), sym(1).FormalParameterList, sym(3).sval); + node->commaToken = loc(2); + node->identifierToken = loc(3); + sym(1).Node = node; +} break; + +case 269: { + sym(1).Node = 0; +} break; + +case 270: { + sym(1).Node = sym(1).FormalParameterList->finish (); +} break; + +case 271: { + sym(1).Node = 0; +} break; + +case 273: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).SourceElements->finish ()); +} break; + +case 274: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).SourceElement); +} break; + +case 275: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).SourceElements, sym(2).SourceElement); +} break; + +case 276: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Statement); +} break; + +case 277: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).FunctionDeclaration); +} break; + +case 278: { + sym(1).sval = 0; +} break; + +case 280: { + sym(1).Node = 0; +} break; + + } // switch + action = nt_action(state_stack[tos], lhs[r] - TERMINAL_COUNT); + } // if + } while (action != 0); + + if (first_token == last_token) { + const int errorState = state_stack[tos]; + + // automatic insertion of `;' + if (t_action(errorState, T_AUTOMATIC_SEMICOLON) && automatic(driver, yytoken)) { + SavedToken &tk = token_buffer[0]; + tk.token = yytoken; + tk.dval = yylval; + tk.loc = yylloc; + + const QString msg = QString::fromUtf8("Missing `;'"); + + diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Warning, + yyprevlloc.startLine, yyprevlloc.startColumn, msg)); + + first_token = &token_buffer[0]; + last_token = &token_buffer[1]; + + yytoken = T_SEMICOLON; + yylval = 0; + + action = errorState; + + goto _Lcheck_token; + } + + hadErrors = true; + + token_buffer[0].token = yytoken; + token_buffer[0].dval = yylval; + token_buffer[0].loc = yylloc; + + token_buffer[1].token = yytoken = lexer->lex(); + token_buffer[1].dval = yylval = lexer->dval(); + token_buffer[1].loc = yylloc = location(lexer); + + if (t_action(errorState, yytoken)) { + const QString msg = QString::fromUtf8("Removed token: `%1'").arg(spell[token_buffer[0].token]); + + diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, + token_buffer[0].loc.startLine, token_buffer[0].loc.startColumn, msg)); + + action = errorState; + goto _Lcheck_token; + } + + static int tokens[] = { + T_PLUS, + T_EQ, + + T_COMMA, + T_COLON, + T_SEMICOLON, + + T_RPAREN, T_RBRACKET, T_RBRACE, + + T_NUMERIC_LITERAL, + T_IDENTIFIER, + + T_LPAREN, T_LBRACKET, T_LBRACE, + + EOF_SYMBOL + }; + + for (int *tk = tokens; *tk != EOF_SYMBOL; ++tk) { + int a = t_action(errorState, *tk); + if (a > 0 && t_action(a, yytoken)) { + const QString msg = QString::fromUtf8("Inserted token: `%1'").arg(spell[*tk]); + + diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, + token_buffer[0].loc.startLine, token_buffer[0].loc.startColumn, msg)); + + yytoken = *tk; + yylval = 0; + yylloc = token_buffer[0].loc; + + first_token = &token_buffer[0]; + last_token = &token_buffer[2]; + + action = errorState; + goto _Lcheck_token; + } + } + + for (int tk = 1; tk < TERMINAL_COUNT; ++tk) { + int a = t_action(errorState, tk); + if (a > 0 && t_action(a, yytoken)) { + const QString msg = QString::fromUtf8("Inserted token: `%1'").arg(spell[tk]); + diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, + token_buffer[0].loc.startLine, token_buffer[0].loc.startColumn, msg)); + + yytoken = tk; + yylval = 0; + yylloc = token_buffer[0].loc; + + action = errorState; + goto _Lcheck_token; + } + } + + const QString msg = QString::fromUtf8("Unexpected token"); + diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, + token_buffer[0].loc.startLine, token_buffer[0].loc.startColumn, msg)); + } + + return false; +} + +QT_END_NAMESPACE + + diff --git a/src/declarative/qml/parser/javascriptparser_p.h b/src/declarative/qml/parser/javascriptparser_p.h new file mode 100644 index 0000000..5a47cb0 --- /dev/null +++ b/src/declarative/qml/parser/javascriptparser_p.h @@ -0,0 +1,212 @@ +// 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 QtScript 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 purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +// +// This file is automatically generated from javascript.g. +// Changes will be lost. +// + +#ifndef JAVASCRIPTPARSER_P_H +#define JAVASCRIPTPARSER_P_H + +#include "javascriptgrammar_p.h" +#include "javascriptast_p.h" +#include + +QT_BEGIN_NAMESPACE + +class QString; +class JavaScriptEnginePrivate; +class JavaScriptNameIdImpl; + +class JavaScriptParser: protected JavaScriptGrammar +{ +public: + union Value { + int ival; + double dval; + JavaScriptNameIdImpl *sval; + JavaScript::AST::ArgumentList *ArgumentList; + JavaScript::AST::CaseBlock *CaseBlock; + JavaScript::AST::CaseClause *CaseClause; + JavaScript::AST::CaseClauses *CaseClauses; + JavaScript::AST::Catch *Catch; + JavaScript::AST::DefaultClause *DefaultClause; + JavaScript::AST::ElementList *ElementList; + JavaScript::AST::Elision *Elision; + JavaScript::AST::ExpressionNode *Expression; + JavaScript::AST::Finally *Finally; + JavaScript::AST::FormalParameterList *FormalParameterList; + JavaScript::AST::FunctionBody *FunctionBody; + JavaScript::AST::FunctionDeclaration *FunctionDeclaration; + JavaScript::AST::Node *Node; + JavaScript::AST::PropertyName *PropertyName; + JavaScript::AST::PropertyNameAndValueList *PropertyNameAndValueList; + JavaScript::AST::SourceElement *SourceElement; + JavaScript::AST::SourceElements *SourceElements; + JavaScript::AST::Statement *Statement; + JavaScript::AST::StatementList *StatementList; + JavaScript::AST::VariableDeclaration *VariableDeclaration; + JavaScript::AST::VariableDeclarationList *VariableDeclarationList; + + JavaScript::AST::UiProgram *UiProgram; + JavaScript::AST::UiPublicMember *UiPublicMember; + JavaScript::AST::UiObjectDefinition *UiObjectDefinition; + JavaScript::AST::UiObjectInitializer *UiObjectInitializer; + JavaScript::AST::UiObjectBinding *UiObjectBinding; + JavaScript::AST::UiScriptBinding *UiScriptBinding; + JavaScript::AST::UiArrayBinding *UiArrayBinding; + JavaScript::AST::UiObjectMember *UiObjectMember; + JavaScript::AST::UiObjectMemberList *UiObjectMemberList; + JavaScript::AST::UiQualifiedId *UiQualifiedId; + }; + + struct DiagnosticMessage { + enum Kind { Warning, Error }; + + DiagnosticMessage() + : kind(Error), line(0), column(0) {} + + DiagnosticMessage(Kind kind, int line, int column, const QString &message) + : kind(kind), line(line), column(column), message(message) {} + + bool isWarning() const + { return kind == Warning; } + + bool isError() const + { return kind == Error; } + + Kind kind; + int line; + int column; + QString message; + }; + +public: + JavaScriptParser(); + ~JavaScriptParser(); + + bool parse(JavaScriptEnginePrivate *driver); + + JavaScript::AST::UiProgram *ast() + { return sym(1).UiProgram; } + + QList diagnosticMessages() const + { return diagnostic_messages; } + + inline DiagnosticMessage diagnosticMessage() const + { + foreach (const DiagnosticMessage &d, diagnostic_messages) { + if (! d.kind == DiagnosticMessage::Warning) + return d; + } + + return DiagnosticMessage(); + } + + inline QString errorMessage() const + { return diagnosticMessage().message; } + + inline int errorLineNumber() const + { return diagnosticMessage().line; } + + inline int errorColumnNumber() const + { return diagnosticMessage().column; } + +protected: + void reallocateStack(); + + inline Value &sym(int index) + { return sym_stack [tos + index - 1]; } + + inline JavaScript::AST::SourceLocation &loc(int index) + { return location_stack [tos + index - 1]; } + +protected: + int tos; + int stack_size; + Value *sym_stack; + int *state_stack; + JavaScript::AST::SourceLocation *location_stack; + + // error recovery + enum { TOKEN_BUFFER_SIZE = 3 }; + + struct SavedToken { + int token; + double dval; + JavaScript::AST::SourceLocation loc; + }; + + double yylval; + JavaScript::AST::SourceLocation yylloc; + JavaScript::AST::SourceLocation yyprevlloc; + + SavedToken token_buffer[TOKEN_BUFFER_SIZE]; + SavedToken *first_token; + SavedToken *last_token; + + QList diagnostic_messages; +}; + + +#define J_SCRIPT_REGEXPLITERAL_RULE1 22 + +#define J_SCRIPT_REGEXPLITERAL_RULE2 23 + +QT_END_NAMESPACE + + + +#endif // JAVASCRIPTPARSER_P_H diff --git a/src/declarative/qml/parser/javascriptprettypretty.cpp b/src/declarative/qml/parser/javascriptprettypretty.cpp new file mode 100644 index 0000000..6e632b7 --- /dev/null +++ b/src/declarative/qml/parser/javascriptprettypretty.cpp @@ -0,0 +1,1334 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtScript 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 "javascriptprettypretty_p.h" + + + +#include "javascriptengine_p.h" + + + + +#include "javascriptast_p.h" + +#include +#include +#include + +QT_BEGIN_NAMESPACE + +namespace JavaScript { +QString numberToString(qjsreal value); +} + +using namespace JavaScript; + +PrettyPretty::PrettyPretty(QTextStream &o): + out(o), m_indentLevel(0) +{ +} + +PrettyPretty::~PrettyPretty() +{ +} + +void PrettyPretty::acceptAsBlock(AST::Node *node) +{ + out << "{"; + pushIndentLevel(); + newlineAndIndent(); + accept(node); + popIndentLevel(); + newlineAndIndent(); + out << "}"; +} + +int PrettyPretty::operatorPrecedenceLevel(int op) +{ + switch (op) { + case QSOperator::Div: + case QSOperator::Mod: + case QSOperator::Mul: + return 5; + case QSOperator::Add: + case QSOperator::Sub: + return 6; + case QSOperator::LShift: + case QSOperator::RShift: + case QSOperator::URShift: + return 7; + case QSOperator::Ge: + case QSOperator::Gt: + case QSOperator::In: + case QSOperator::InstanceOf: + case QSOperator::Le: + case QSOperator::Lt: + return 8; + case QSOperator::Equal: + case QSOperator::NotEqual: + case QSOperator::StrictEqual: + case QSOperator::StrictNotEqual: + return 9; + case QSOperator::BitAnd: + return 10; + case QSOperator::BitXor: + return 11; + case QSOperator::BitOr: + return 12; + case QSOperator::And: + return 13; + case QSOperator::Or: + return 14; + case QSOperator::InplaceAnd: + case QSOperator::InplaceSub: + case QSOperator::InplaceDiv: + case QSOperator::InplaceAdd: + case QSOperator::InplaceLeftShift: + case QSOperator::InplaceMod: + case QSOperator::InplaceMul: + case QSOperator::InplaceOr: + case QSOperator::InplaceRightShift: + case QSOperator::InplaceURightShift: + case QSOperator::InplaceXor: + case QSOperator::Assign: + return 16; + default: + Q_ASSERT_X(false, "PrettyPretty::operatorPrecedenceLevel()", "bad operator"); + } + return 0; +} + +int PrettyPretty::compareOperatorPrecedence(int op1, int op2) +{ + int prec1 = operatorPrecedenceLevel(op1); + int prec2 = operatorPrecedenceLevel(op2); + if (prec1 == prec2) + return 0; + if (prec1 > prec2) + return -1; + return 1; +} + +QTextStream &PrettyPretty::operator () (AST::Node *node, int level) +{ + int was = indentLevel(level); + accept(node); + indentLevel(was); + return out; +} + +QTextStream &PrettyPretty::newlineAndIndent() +{ + enum { IND = 4 }; + out << endl << QString().fill(QLatin1Char(' '), m_indentLevel * IND); + return out; +} + +void PrettyPretty::accept(AST::Node *node) +{ + AST::Node::acceptChild(node, this); +} + +bool PrettyPretty::visit(AST::ThisExpression *node) +{ + Q_UNUSED(node); + out << "this"; + return true; +} + +void PrettyPretty::endVisit(AST::ThisExpression *node) +{ + Q_UNUSED(node); +} + +bool PrettyPretty::visit(AST::IdentifierExpression *node) +{ + out << JavaScriptEnginePrivate::toString(node->name); + return true; +} + +void PrettyPretty::endVisit(AST::IdentifierExpression *node) +{ + Q_UNUSED(node); +} + +bool PrettyPretty::visit(AST::NullExpression *node) +{ + Q_UNUSED(node); + out << "null"; + return false; +} + +void PrettyPretty::endVisit(AST::NullExpression *node) +{ + Q_UNUSED(node); +} + +bool PrettyPretty::visit(AST::TrueLiteral *node) +{ + Q_UNUSED(node); + out << "true"; + return false; +} + +void PrettyPretty::endVisit(AST::TrueLiteral *node) +{ + Q_UNUSED(node); +} + +bool PrettyPretty::visit(AST::FalseLiteral *node) +{ + Q_UNUSED(node); + out << "false"; + return false; +} + +void PrettyPretty::endVisit(AST::FalseLiteral *node) +{ + Q_UNUSED(node); +} + +bool PrettyPretty::visit(AST::StringLiteral *node) +{ + QString lit = JavaScriptEnginePrivate::toString(node->value); + lit.replace(QLatin1String("\\"), QLatin1String("\\\\")); + out << "\"" << lit << "\""; + return false; +} + +void PrettyPretty::endVisit(AST::StringLiteral *node) +{ + Q_UNUSED(node); +} + +bool PrettyPretty::visit(AST::NumericLiteral *node) +{ + out << JavaScript::numberToString(node->value); + return true; +} + +void PrettyPretty::endVisit(AST::NumericLiteral *node) +{ + Q_UNUSED(node); +} + +bool PrettyPretty::visit(AST::RegExpLiteral *node) +{ + out << "/" << JavaScriptEnginePrivate::toString(node->pattern) << "/"; + if (node->flags) + out << JavaScript::Ecma::RegExp::flagsToString(node->flags); + + return true; +} + +void PrettyPretty::endVisit(AST::RegExpLiteral *node) +{ + Q_UNUSED(node); +} + +bool PrettyPretty::visit(AST::ArrayLiteral *node) +{ + out << "["; + accept(node->elements); + accept(node->elision); + out << "]"; + return false; +} + +void PrettyPretty::endVisit(AST::ArrayLiteral *node) +{ + Q_UNUSED(node); +} + +bool PrettyPretty::visit(AST::ObjectLiteral *node) +{ + out << "{"; + if (node->properties) { + pushIndentLevel(); + AST::PropertyNameAndValueList *prop; + for (prop = node->properties; prop != 0; prop = prop->next) { + newlineAndIndent(); + accept(prop); + if (prop->next) + out << ","; + } + popIndentLevel(); + newlineAndIndent(); + } + out << "}"; + return false; +} + +void PrettyPretty::endVisit(AST::ObjectLiteral *node) +{ + Q_UNUSED(node); +} + +bool PrettyPretty::visit(AST::ElementList *node) +{ + accept(node->elision); + accept(node->expression); + for (node = node->next; node != 0; node = node->next) { + out << ", "; + accept(node->elision); + accept(node->expression); + } + return false; +} + +void PrettyPretty::endVisit(AST::ElementList *node) +{ + Q_UNUSED(node); +} + +bool PrettyPretty::visit(AST::Elision *node) +{ + out << ", "; + for (AST::Elision *eit = node->next; eit != 0; eit = eit->next) + out << ", "; + return false; +} + +void PrettyPretty::endVisit(AST::Elision *node) +{ + Q_UNUSED(node); +} + +bool PrettyPretty::visit(AST::PropertyNameAndValueList *node) +{ + accept(node->name); + out << ": "; + accept(node->value); + return false; +} + +void PrettyPretty::endVisit(AST::PropertyNameAndValueList *node) +{ + Q_UNUSED(node); +} + +bool PrettyPretty::visit(AST::IdentifierPropertyName *node) +{ + out << JavaScriptEnginePrivate::toString(node->id); + return false; +} + +void PrettyPretty::endVisit(AST::IdentifierPropertyName *node) +{ + Q_UNUSED(node); +} + +bool PrettyPretty::visit(AST::StringLiteralPropertyName *node) +{ + QString lit = JavaScriptEnginePrivate::toString(node->id); + lit.replace(QLatin1String("\\"), QLatin1String("\\\\")); + out << lit; + return false; +} + +void PrettyPretty::endVisit(AST::StringLiteralPropertyName *node) +{ + Q_UNUSED(node); +} + +bool PrettyPretty::visit(AST::NumericLiteralPropertyName *node) +{ + out << node->id; + return false; +} + +void PrettyPretty::endVisit(AST::NumericLiteralPropertyName *node) +{ + Q_UNUSED(node); +} + +bool PrettyPretty::visit(AST::ArrayMemberExpression *node) +{ + accept(node->base); + out << "["; + accept(node->expression); + out << "]"; + return false; +} + +void PrettyPretty::endVisit(AST::ArrayMemberExpression *node) +{ + Q_UNUSED(node); +} + +bool PrettyPretty::visit(AST::FieldMemberExpression *node) +{ + accept(node->base); + out << "." << JavaScriptEnginePrivate::toString(node->name); + return false; +} + +void PrettyPretty::endVisit(AST::FieldMemberExpression *node) +{ + Q_UNUSED(node); +} + +bool PrettyPretty::visit(AST::NewMemberExpression *node) +{ + out << "new "; + accept(node->base); + out << "("; + accept(node->arguments); + out << ")"; + return false; +} + +void PrettyPretty::endVisit(AST::NewMemberExpression *node) +{ + Q_UNUSED(node); +} + +bool PrettyPretty::visit(AST::NewExpression *node) +{ + Q_UNUSED(node); + out << "new "; + return true; +} + +void PrettyPretty::endVisit(AST::NewExpression *node) +{ + Q_UNUSED(node); +} + +bool PrettyPretty::visit(AST::CallExpression *node) +{ + accept(node->base); + out << "("; + accept(node->arguments); + out << ")"; + return false; +} + +void PrettyPretty::endVisit(AST::CallExpression *node) +{ + Q_UNUSED(node); +} + +bool PrettyPretty::visit(AST::ArgumentList *node) +{ + accept(node->expression); + for (node = node->next; node != 0; node = node->next) { + out << ", "; + accept(node->expression); + } + return false; +} + +void PrettyPretty::endVisit(AST::ArgumentList *node) +{ + Q_UNUSED(node); +} + +bool PrettyPretty::visit(AST::PostIncrementExpression *node) +{ + Q_UNUSED(node); + return true; +} + +void PrettyPretty::endVisit(AST::PostIncrementExpression *node) +{ + Q_UNUSED(node); + out << "++"; +} + +bool PrettyPretty::visit(AST::PostDecrementExpression *node) +{ + Q_UNUSED(node); + return true; +} + +void PrettyPretty::endVisit(AST::PostDecrementExpression *node) +{ + Q_UNUSED(node); + out << "--"; +} + +bool PrettyPretty::visit(AST::DeleteExpression *node) +{ + Q_UNUSED(node); + out << "delete "; + return true; +} + +void PrettyPretty::endVisit(AST::DeleteExpression *node) +{ + Q_UNUSED(node); +} + +bool PrettyPretty::visit(AST::VoidExpression *node) +{ + Q_UNUSED(node); + out << "void "; + return true; +} + +void PrettyPretty::endVisit(AST::VoidExpression *node) +{ + Q_UNUSED(node); +} + +bool PrettyPretty::visit(AST::TypeOfExpression *node) +{ + Q_UNUSED(node); + out << "typeof "; + return true; +} + +void PrettyPretty::endVisit(AST::TypeOfExpression *node) +{ + Q_UNUSED(node); +} + +bool PrettyPretty::visit(AST::PreIncrementExpression *node) +{ + Q_UNUSED(node); + out << "++"; + return true; +} + +void PrettyPretty::endVisit(AST::PreIncrementExpression *node) +{ + Q_UNUSED(node); +} + +bool PrettyPretty::visit(AST::PreDecrementExpression *node) +{ + Q_UNUSED(node); + out << "--"; + return true; +} + +void PrettyPretty::endVisit(AST::PreDecrementExpression *node) +{ + Q_UNUSED(node); +} + +bool PrettyPretty::visit(AST::UnaryPlusExpression *node) +{ + out << "+"; + bool needParens = (node->expression->binaryExpressionCast() != 0); + if (needParens) + out << "("; + accept(node->expression); + if (needParens) + out << ")"; + return false; +} + +void PrettyPretty::endVisit(AST::UnaryPlusExpression *node) +{ + Q_UNUSED(node); +} + +bool PrettyPretty::visit(AST::UnaryMinusExpression *node) +{ + out << "-"; + bool needParens = (node->expression->binaryExpressionCast() != 0); + if (needParens) + out << "("; + accept(node->expression); + if (needParens) + out << ")"; + return false; +} + +void PrettyPretty::endVisit(AST::UnaryMinusExpression *node) +{ + Q_UNUSED(node); +} + +bool PrettyPretty::visit(AST::TildeExpression *node) +{ + out << "~"; + bool needParens = (node->expression->binaryExpressionCast() != 0); + if (needParens) + out << "("; + accept(node->expression); + if (needParens) + out << ")"; + return false; +} + +void PrettyPretty::endVisit(AST::TildeExpression *node) +{ + Q_UNUSED(node); +} + +bool PrettyPretty::visit(AST::NotExpression *node) +{ + out << "!"; + bool needParens = (node->expression->binaryExpressionCast() != 0); + if (needParens) + out << "("; + accept(node->expression); + if (needParens) + out << ")"; + return false; +} + +void PrettyPretty::endVisit(AST::NotExpression *node) +{ + Q_UNUSED(node); +} + +bool PrettyPretty::visit(AST::BinaryExpression *node) +{ + bool needParens = node->left->binaryExpressionCast() + && (compareOperatorPrecedence(node->left->binaryExpressionCast()->op, node->op) < 0); + if (needParens) + out << "("; + accept(node->left); + if (needParens) + out << ")"; + QString s; + switch (node->op) { + case QSOperator::Add: + s = QLatin1String("+"); break; + case QSOperator::And: + s = QLatin1String("&&"); break; + case QSOperator::InplaceAnd: + s = QLatin1String("&="); break; + case QSOperator::Assign: + s = QLatin1String("="); break; + case QSOperator::BitAnd: + s = QLatin1String("&"); break; + case QSOperator::BitOr: + s = QLatin1String("|"); break; + case QSOperator::BitXor: + s = QLatin1String("^"); break; + case QSOperator::InplaceSub: + s = QLatin1String("-="); break; + case QSOperator::Div: + s = QLatin1String("/"); break; + case QSOperator::InplaceDiv: + s = QLatin1String("/="); break; + case QSOperator::Equal: + s = QLatin1String("=="); break; + case QSOperator::Ge: + s = QLatin1String(">="); break; + case QSOperator::Gt: + s = QLatin1String(">"); break; + case QSOperator::In: + s = QLatin1String("in"); break; + case QSOperator::InplaceAdd: + s = QLatin1String("+="); break; + case QSOperator::InstanceOf: + s = QLatin1String("instanceof"); break; + case QSOperator::Le: + s = QLatin1String("<="); break; + case QSOperator::LShift: + s = QLatin1String("<<"); break; + case QSOperator::InplaceLeftShift: + s = QLatin1String("<<="); break; + case QSOperator::Lt: + s = QLatin1String("<"); break; + case QSOperator::Mod: + s = QLatin1String("%"); break; + case QSOperator::InplaceMod: + s = QLatin1String("%="); break; + case QSOperator::Mul: + s = QLatin1String("*"); break; + case QSOperator::InplaceMul: + s = QLatin1String("*="); break; + case QSOperator::NotEqual: + s = QLatin1String("!="); break; + case QSOperator::Or: + s = QLatin1String("||"); break; + case QSOperator::InplaceOr: + s = QLatin1String("|="); break; + case QSOperator::RShift: + s = QLatin1String(">>"); break; + case QSOperator::InplaceRightShift: + s = QLatin1String(">>="); break; + case QSOperator::StrictEqual: + s = QLatin1String("==="); break; + case QSOperator::StrictNotEqual: + s = QLatin1String("!=="); break; + case QSOperator::Sub: + s = QLatin1String("-"); break; + case QSOperator::URShift: + s = QLatin1String(">>>"); break; + case QSOperator::InplaceURightShift: + s = QLatin1String(">>>="); break; + case QSOperator::InplaceXor: + s = QLatin1String("^="); break; + default: + Q_ASSERT (0); + } + out << " " << s << " "; + needParens = node->right->binaryExpressionCast() + && (compareOperatorPrecedence(node->right->binaryExpressionCast()->op, node->op) <= 0); + if (needParens) + out << "("; + accept(node->right); + if (needParens) + out << ")"; + return false; +} + +void PrettyPretty::endVisit(AST::BinaryExpression *node) +{ + Q_UNUSED(node); +} + +bool PrettyPretty::visit(AST::ConditionalExpression *node) +{ + accept(node->expression); + out << " ? "; + accept(node->ok); + out << " : "; + accept(node->ko); + return false; +} + +void PrettyPretty::endVisit(AST::ConditionalExpression *node) +{ + Q_UNUSED(node); +} + +bool PrettyPretty::visit(AST::Expression *node) +{ + accept(node->left); + out << ", "; + accept(node->right); + return false; +} + +void PrettyPretty::endVisit(AST::Expression *node) +{ + Q_UNUSED(node); +} + +bool PrettyPretty::visit(AST::Block *node) +{ + Q_UNUSED(node); + return true; +} + +void PrettyPretty::endVisit(AST::Block *node) +{ + Q_UNUSED(node); +} + +bool PrettyPretty::visit(AST::StatementList *node) +{ + accept(node->statement); + for (node = node->next; node != 0; node = node->next) { + newlineAndIndent(); + accept(node->statement); + } + return false; +} + +void PrettyPretty::endVisit(AST::StatementList *node) +{ + Q_UNUSED(node); +} + +bool PrettyPretty::visit(AST::VariableDeclarationList *node) +{ + AST::VariableDeclarationList *it = node; + + do { + it->declaration->accept(this); + it = it->next; + if (it) + out << ", "; + } while (it); + + return false; +} + +void PrettyPretty::endVisit(AST::VariableDeclarationList *node) +{ + Q_UNUSED(node); +} + +bool PrettyPretty::visit(AST::VariableStatement *node) +{ + out << "var "; + Q_UNUSED(node); + return true; +} + +void PrettyPretty::endVisit(AST::VariableStatement *node) +{ + Q_UNUSED(node); + out << ";"; +} + +bool PrettyPretty::visit(AST::VariableDeclaration *node) +{ + out << JavaScriptEnginePrivate::toString(node->name); + if (node->expression) { + out << " = "; + accept(node->expression); + } + return false; +} + +void PrettyPretty::endVisit(AST::VariableDeclaration *node) +{ + Q_UNUSED(node); +} + +bool PrettyPretty::visit(AST::EmptyStatement *node) +{ + Q_UNUSED(node); + out << ";"; + return true; +} + +void PrettyPretty::endVisit(AST::EmptyStatement *node) +{ + Q_UNUSED(node); +} + +bool PrettyPretty::visit(AST::ExpressionStatement *node) +{ + accept(node->expression); + out << ";"; + return false; +} + +void PrettyPretty::endVisit(AST::ExpressionStatement *node) +{ + Q_UNUSED(node); +} + +bool PrettyPretty::visit(AST::IfStatement *node) +{ + out << "if ("; + accept(node->expression); + out << ") "; + acceptAsBlock(node->ok); + if (node->ko) { + out << " else "; + acceptAsBlock(node->ko); + } + return false; +} + +void PrettyPretty::endVisit(AST::IfStatement *node) +{ + Q_UNUSED(node); +} + +bool PrettyPretty::visit(AST::DoWhileStatement *node) +{ + out << "do "; + acceptAsBlock(node->statement); + out << " while ("; + accept(node->expression); + out << ");"; + return false; +} + +void PrettyPretty::endVisit(AST::DoWhileStatement *node) +{ + Q_UNUSED(node); +} + +bool PrettyPretty::visit(AST::WhileStatement *node) +{ + out << "while ("; + accept(node->expression); + out << ") "; + acceptAsBlock(node->statement); + return false; +} + +void PrettyPretty::endVisit(AST::WhileStatement *node) +{ + Q_UNUSED(node); +} + +bool PrettyPretty::visit(AST::ForStatement *node) +{ + out << "for ("; + accept(node->initialiser); + out << "; "; + accept(node->condition); + out << "; "; + accept(node->expression); + out << ") "; + acceptAsBlock(node->statement); + return false; +} + +void PrettyPretty::endVisit(AST::ForStatement *node) +{ + Q_UNUSED(node); +} + +bool PrettyPretty::visit(AST::LocalForStatement *node) +{ + out << "for (var "; + accept(node->declarations); + out << "; "; + accept(node->condition); + out << "; "; + accept(node->expression); + out << ") "; + acceptAsBlock(node->statement); + return false; +} + +void PrettyPretty::endVisit(AST::LocalForStatement *node) +{ + Q_UNUSED(node); +} + +bool PrettyPretty::visit(AST::ForEachStatement *node) +{ + out << "for ("; + accept(node->initialiser); + out << " in "; + accept(node->expression); + out << ") "; + acceptAsBlock(node->statement); + return false; +} + +void PrettyPretty::endVisit(AST::ForEachStatement *node) +{ + Q_UNUSED(node); +} + +bool PrettyPretty::visit(AST::LocalForEachStatement *node) +{ + out << "for (var "; + accept(node->declaration); + out << " in "; + accept(node->expression); + out << ") "; + acceptAsBlock(node->statement); + return false; +} + +void PrettyPretty::endVisit(AST::LocalForEachStatement *node) +{ + Q_UNUSED(node); +} + +bool PrettyPretty::visit(AST::ContinueStatement *node) +{ + out << "continue"; + if (node->label) { + out << " " << JavaScriptEnginePrivate::toString(node->label); + } + out << ";"; + return false; +} + +void PrettyPretty::endVisit(AST::ContinueStatement *node) +{ + Q_UNUSED(node); +} + +bool PrettyPretty::visit(AST::BreakStatement *node) +{ + out << "break"; + if (node->label) { + out << " " << JavaScriptEnginePrivate::toString(node->label); + } + out << ";"; + return false; +} + +void PrettyPretty::endVisit(AST::BreakStatement *node) +{ + Q_UNUSED(node); +} + +bool PrettyPretty::visit(AST::ReturnStatement *node) +{ + out << "return"; + if (node->expression) { + out << " "; + accept(node->expression); + } + out << ";"; + return false; +} + +void PrettyPretty::endVisit(AST::ReturnStatement *node) +{ + Q_UNUSED(node); +} + +bool PrettyPretty::visit(AST::WithStatement *node) +{ + out << "with ("; + accept(node->expression); + out << ") "; + acceptAsBlock(node->statement); + return false; +} + +void PrettyPretty::endVisit(AST::WithStatement *node) +{ + Q_UNUSED(node); +} + +bool PrettyPretty::visit(AST::SwitchStatement *node) +{ + out << "switch ("; + accept(node->expression); + out << ") "; + acceptAsBlock(node->block); + return false; +} + +void PrettyPretty::endVisit(AST::SwitchStatement *node) +{ + Q_UNUSED(node); +} + +bool PrettyPretty::visit(AST::CaseBlock *node) +{ + accept(node->clauses); + if (node->defaultClause) { + newlineAndIndent(); + accept(node->defaultClause); + } + if (node->moreClauses) { + newlineAndIndent(); + accept(node->moreClauses); + } + return false; +} + +void PrettyPretty::endVisit(AST::CaseBlock *node) +{ + Q_UNUSED(node); +} + +bool PrettyPretty::visit(AST::CaseClauses *node) +{ + accept(node->clause); + for (node = node->next; node != 0; node = node->next) { + newlineAndIndent(); + accept(node->clause); + } + return false; +} + +void PrettyPretty::endVisit(AST::CaseClauses *node) +{ + Q_UNUSED(node); +} + +bool PrettyPretty::visit(AST::CaseClause *node) +{ + out << "case "; + accept(node->expression); + out << ":"; + if (node->statements) { + newlineAndIndent(); + accept(node->statements); + } + return false; +} + +void PrettyPretty::endVisit(AST::CaseClause *node) +{ + Q_UNUSED(node); +} + +bool PrettyPretty::visit(AST::DefaultClause *node) +{ + Q_UNUSED(node); + out << "default:"; + newlineAndIndent(); + return true; +} + +void PrettyPretty::endVisit(AST::DefaultClause *node) +{ + Q_UNUSED(node); +} + +bool PrettyPretty::visit(AST::LabelledStatement *node) +{ + out << JavaScriptEnginePrivate::toString(node->label) << ": "; + return true; +} + +void PrettyPretty::endVisit(AST::LabelledStatement *node) +{ + Q_UNUSED(node); +} + +bool PrettyPretty::visit(AST::ThrowStatement *node) +{ + Q_UNUSED(node); + out << "throw "; + accept(node->expression); + out << ";"; + return false; +} + +void PrettyPretty::endVisit(AST::ThrowStatement *node) +{ + Q_UNUSED(node); +} + +bool PrettyPretty::visit(AST::TryStatement *node) +{ + out << "try "; + acceptAsBlock(node->statement); + if (node->catchExpression) { + out << " catch (" << JavaScriptEnginePrivate::toString(node->catchExpression->name) << ") "; + acceptAsBlock(node->catchExpression->statement); + } + if (node->finallyExpression) { + out << " finally "; + acceptAsBlock(node->finallyExpression->statement); + } + return false; +} + +void PrettyPretty::endVisit(AST::TryStatement *node) +{ + Q_UNUSED(node); +} + +bool PrettyPretty::visit(AST::Catch *node) +{ + Q_UNUSED(node); + return true; +} + +void PrettyPretty::endVisit(AST::Catch *node) +{ + Q_UNUSED(node); +} + +bool PrettyPretty::visit(AST::Finally *node) +{ + Q_UNUSED(node); + out << "finally "; + return true; +} + +void PrettyPretty::endVisit(AST::Finally *node) +{ + Q_UNUSED(node); +} + +bool PrettyPretty::visit(AST::FunctionDeclaration *node) +{ + out << "function"; + + if (node->name) + out << " " << JavaScriptEnginePrivate::toString(node->name); + + // the arguments + out << "("; + for (AST::FormalParameterList *it = node->formals; it; it = it->next) { + if (it->name) + out << JavaScriptEnginePrivate::toString(it->name); + + if (it->next) + out << ", "; + } + out << ")"; + + // the function body + out << " {"; + + if (node->body) { + pushIndentLevel(); + newlineAndIndent(); + accept(node->body); + popIndentLevel(); + newlineAndIndent(); + } + + out << "}"; + + return false; +} + +void PrettyPretty::endVisit(AST::FunctionDeclaration *node) +{ + Q_UNUSED(node); +} + +bool PrettyPretty::visit(AST::FunctionExpression *node) +{ + out << "function"; + + if (node->name) + out << " " << JavaScriptEnginePrivate::toString(node->name); + + // the arguments + out << "("; + for (AST::FormalParameterList *it = node->formals; it; it = it->next) { + if (it->name) + out << JavaScriptEnginePrivate::toString(it->name); + + if (it->next) + out << ", "; + } + out << ")"; + + // the function body + out << " {"; + + if (node->body) { + pushIndentLevel(); + newlineAndIndent(); + accept(node->body); + popIndentLevel(); + newlineAndIndent(); + } + + out << "}"; + + return false; +} + +void PrettyPretty::endVisit(AST::FunctionExpression *node) +{ + Q_UNUSED(node); +} + +bool PrettyPretty::visit(AST::FormalParameterList *node) +{ + Q_UNUSED(node); + return true; +} + +void PrettyPretty::endVisit(AST::FormalParameterList *node) +{ + Q_UNUSED(node); +} + +bool PrettyPretty::visit(AST::FunctionBody *node) +{ + Q_UNUSED(node); + return true; +} + +void PrettyPretty::endVisit(AST::FunctionBody *node) +{ + Q_UNUSED(node); +} + +bool PrettyPretty::visit(AST::Program *node) +{ + Q_UNUSED(node); + return true; +} + +void PrettyPretty::endVisit(AST::Program *node) +{ + Q_UNUSED(node); +} + +bool PrettyPretty::visit(AST::SourceElements *node) +{ + Q_UNUSED(node); + accept(node->element); + for (node = node->next; node != 0; node = node->next) { + newlineAndIndent(); + accept(node->element); + } + return false; +} + +void PrettyPretty::endVisit(AST::SourceElements *node) +{ + Q_UNUSED(node); +} + +bool PrettyPretty::visit(AST::FunctionSourceElement *node) +{ + Q_UNUSED(node); + return true; +} + +void PrettyPretty::endVisit(AST::FunctionSourceElement *node) +{ + Q_UNUSED(node); +} + +bool PrettyPretty::visit(AST::StatementSourceElement *node) +{ + Q_UNUSED(node); + return true; +} + +void PrettyPretty::endVisit(AST::StatementSourceElement *node) +{ + Q_UNUSED(node); +} + +bool PrettyPretty::visit(AST::DebuggerStatement *node) +{ + Q_UNUSED(node); + out << "debugger"; + return true; +} + +void PrettyPretty::endVisit(AST::DebuggerStatement *node) +{ + Q_UNUSED(node); + out << ";"; +} + +bool PrettyPretty::preVisit(AST::Node *node) +{ + Q_UNUSED(node); + return true; +} + +QT_END_NAMESPACE + + diff --git a/src/declarative/qml/parser/javascriptprettypretty_p.h b/src/declarative/qml/parser/javascriptprettypretty_p.h new file mode 100644 index 0000000..c692da5 --- /dev/null +++ b/src/declarative/qml/parser/javascriptprettypretty_p.h @@ -0,0 +1,329 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtScript 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 JAVASCRIPTPRETTYPRETTY_P_H +#define JAVASCRIPTPRETTYPRETTY_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include + +#include "javascriptastvisitor_p.h" + +QT_BEGIN_NAMESPACE + +class QTextStream; + +namespace JavaScript { + +class PrettyPretty: protected AST::Visitor +{ +public: + PrettyPretty(QTextStream &out); + virtual ~PrettyPretty(); + + QTextStream &operator () (AST::Node *node, int level = 0); + +protected: + void accept(AST::Node *node); + + virtual bool preVisit(AST::Node *node); + + virtual bool visit(AST::ThisExpression *node); + virtual void endVisit(AST::ThisExpression *node); + + virtual bool visit(AST::IdentifierExpression *node); + virtual void endVisit(AST::IdentifierExpression *node); + + virtual bool visit(AST::NullExpression *node); + virtual void endVisit(AST::NullExpression *node); + + virtual bool visit(AST::TrueLiteral *node); + virtual void endVisit(AST::TrueLiteral *node); + + virtual bool visit(AST::FalseLiteral *node); + virtual void endVisit(AST::FalseLiteral *node); + + virtual bool visit(AST::StringLiteral *node); + virtual void endVisit(AST::StringLiteral *node); + + virtual bool visit(AST::NumericLiteral *node); + virtual void endVisit(AST::NumericLiteral *node); + + virtual bool visit(AST::RegExpLiteral *node); + virtual void endVisit(AST::RegExpLiteral *node); + + virtual bool visit(AST::ArrayLiteral *node); + virtual void endVisit(AST::ArrayLiteral *node); + + virtual bool visit(AST::ObjectLiteral *node); + virtual void endVisit(AST::ObjectLiteral *node); + + virtual bool visit(AST::ElementList *node); + virtual void endVisit(AST::ElementList *node); + + virtual bool visit(AST::Elision *node); + virtual void endVisit(AST::Elision *node); + + virtual bool visit(AST::PropertyNameAndValueList *node); + virtual void endVisit(AST::PropertyNameAndValueList *node); + + virtual bool visit(AST::IdentifierPropertyName *node); + virtual void endVisit(AST::IdentifierPropertyName *node); + + virtual bool visit(AST::StringLiteralPropertyName *node); + virtual void endVisit(AST::StringLiteralPropertyName *node); + + virtual bool visit(AST::NumericLiteralPropertyName *node); + virtual void endVisit(AST::NumericLiteralPropertyName *node); + + virtual bool visit(AST::ArrayMemberExpression *node); + virtual void endVisit(AST::ArrayMemberExpression *node); + + virtual bool visit(AST::FieldMemberExpression *node); + virtual void endVisit(AST::FieldMemberExpression *node); + + virtual bool visit(AST::NewMemberExpression *node); + virtual void endVisit(AST::NewMemberExpression *node); + + virtual bool visit(AST::NewExpression *node); + virtual void endVisit(AST::NewExpression *node); + + virtual bool visit(AST::CallExpression *node); + virtual void endVisit(AST::CallExpression *node); + + virtual bool visit(AST::ArgumentList *node); + virtual void endVisit(AST::ArgumentList *node); + + virtual bool visit(AST::PostIncrementExpression *node); + virtual void endVisit(AST::PostIncrementExpression *node); + + virtual bool visit(AST::PostDecrementExpression *node); + virtual void endVisit(AST::PostDecrementExpression *node); + + virtual bool visit(AST::DeleteExpression *node); + virtual void endVisit(AST::DeleteExpression *node); + + virtual bool visit(AST::VoidExpression *node); + virtual void endVisit(AST::VoidExpression *node); + + virtual bool visit(AST::TypeOfExpression *node); + virtual void endVisit(AST::TypeOfExpression *node); + + virtual bool visit(AST::PreIncrementExpression *node); + virtual void endVisit(AST::PreIncrementExpression *node); + + virtual bool visit(AST::PreDecrementExpression *node); + virtual void endVisit(AST::PreDecrementExpression *node); + + virtual bool visit(AST::UnaryPlusExpression *node); + virtual void endVisit(AST::UnaryPlusExpression *node); + + virtual bool visit(AST::UnaryMinusExpression *node); + virtual void endVisit(AST::UnaryMinusExpression *node); + + virtual bool visit(AST::TildeExpression *node); + virtual void endVisit(AST::TildeExpression *node); + + virtual bool visit(AST::NotExpression *node); + virtual void endVisit(AST::NotExpression *node); + + virtual bool visit(AST::BinaryExpression *node); + virtual void endVisit(AST::BinaryExpression *node); + + virtual bool visit(AST::ConditionalExpression *node); + virtual void endVisit(AST::ConditionalExpression *node); + + virtual bool visit(AST::Expression *node); + virtual void endVisit(AST::Expression *node); + + virtual bool visit(AST::Block *node); + virtual void endVisit(AST::Block *node); + + virtual bool visit(AST::StatementList *node); + virtual void endVisit(AST::StatementList *node); + + virtual bool visit(AST::VariableStatement *node); + virtual void endVisit(AST::VariableStatement *node); + + virtual bool visit(AST::VariableDeclarationList *node); + virtual void endVisit(AST::VariableDeclarationList *node); + + virtual bool visit(AST::VariableDeclaration *node); + virtual void endVisit(AST::VariableDeclaration *node); + + virtual bool visit(AST::EmptyStatement *node); + virtual void endVisit(AST::EmptyStatement *node); + + virtual bool visit(AST::ExpressionStatement *node); + virtual void endVisit(AST::ExpressionStatement *node); + + virtual bool visit(AST::IfStatement *node); + virtual void endVisit(AST::IfStatement *node); + + virtual bool visit(AST::DoWhileStatement *node); + virtual void endVisit(AST::DoWhileStatement *node); + + virtual bool visit(AST::WhileStatement *node); + virtual void endVisit(AST::WhileStatement *node); + + virtual bool visit(AST::ForStatement *node); + virtual void endVisit(AST::ForStatement *node); + + virtual bool visit(AST::LocalForStatement *node); + virtual void endVisit(AST::LocalForStatement *node); + + virtual bool visit(AST::ForEachStatement *node); + virtual void endVisit(AST::ForEachStatement *node); + + virtual bool visit(AST::LocalForEachStatement *node); + virtual void endVisit(AST::LocalForEachStatement *node); + + virtual bool visit(AST::ContinueStatement *node); + virtual void endVisit(AST::ContinueStatement *node); + + virtual bool visit(AST::BreakStatement *node); + virtual void endVisit(AST::BreakStatement *node); + + virtual bool visit(AST::ReturnStatement *node); + virtual void endVisit(AST::ReturnStatement *node); + + virtual bool visit(AST::WithStatement *node); + virtual void endVisit(AST::WithStatement *node); + + virtual bool visit(AST::SwitchStatement *node); + virtual void endVisit(AST::SwitchStatement *node); + + virtual bool visit(AST::CaseBlock *node); + virtual void endVisit(AST::CaseBlock *node); + + virtual bool visit(AST::CaseClauses *node); + virtual void endVisit(AST::CaseClauses *node); + + virtual bool visit(AST::CaseClause *node); + virtual void endVisit(AST::CaseClause *node); + + virtual bool visit(AST::DefaultClause *node); + virtual void endVisit(AST::DefaultClause *node); + + virtual bool visit(AST::LabelledStatement *node); + virtual void endVisit(AST::LabelledStatement *node); + + virtual bool visit(AST::ThrowStatement *node); + virtual void endVisit(AST::ThrowStatement *node); + + virtual bool visit(AST::TryStatement *node); + virtual void endVisit(AST::TryStatement *node); + + virtual bool visit(AST::Catch *node); + virtual void endVisit(AST::Catch *node); + + virtual bool visit(AST::Finally *node); + virtual void endVisit(AST::Finally *node); + + virtual bool visit(AST::FunctionDeclaration *node); + virtual void endVisit(AST::FunctionDeclaration *node); + + virtual bool visit(AST::FunctionExpression *node); + virtual void endVisit(AST::FunctionExpression *node); + + virtual bool visit(AST::FormalParameterList *node); + virtual void endVisit(AST::FormalParameterList *node); + + virtual bool visit(AST::FunctionBody *node); + virtual void endVisit(AST::FunctionBody *node); + + virtual bool visit(AST::Program *node); + virtual void endVisit(AST::Program *node); + + virtual bool visit(AST::SourceElements *node); + virtual void endVisit(AST::SourceElements *node); + + virtual bool visit(AST::FunctionSourceElement *node); + virtual void endVisit(AST::FunctionSourceElement *node); + + virtual bool visit(AST::StatementSourceElement *node); + virtual void endVisit(AST::StatementSourceElement *node); + + virtual bool visit(AST::DebuggerStatement *node); + virtual void endVisit(AST::DebuggerStatement *node); + + int indentLevel(int level) + { + int was = m_indentLevel; + m_indentLevel = level; + return was; + } + + void pushIndentLevel() + { ++m_indentLevel; } + + void popIndentLevel() + { --m_indentLevel; } + + QTextStream &newlineAndIndent(); + + void acceptAsBlock(AST::Node *node); + + static int operatorPrecedenceLevel(int op); + static int compareOperatorPrecedence(int op1, int op2); + +private: + QTextStream &out; + int m_indentLevel; + + Q_DISABLE_COPY(PrettyPretty) +}; + +} // namespace JavaScript + +QT_END_NAMESPACE + +#endif diff --git a/src/declarative/qml/parser/javascriptvalue.h b/src/declarative/qml/parser/javascriptvalue.h new file mode 100644 index 0000000..c68b817 --- /dev/null +++ b/src/declarative/qml/parser/javascriptvalue.h @@ -0,0 +1,6 @@ +#ifndef JAVASCRIPTVALUE_H +#define JAVASCRIPTVALUE_H + +typedef double qjsreal; + +#endif // JAVASCRIPTVALUE_H diff --git a/src/declarative/qml/parser/parser.pri b/src/declarative/qml/parser/parser.pri new file mode 100644 index 0000000..130aeaf --- /dev/null +++ b/src/declarative/qml/parser/parser.pri @@ -0,0 +1,21 @@ + +HEADERS += $$PWD/javascriptast_p.h \ + $$PWD/javascriptastfwd_p.h \ + $$PWD/javascriptastvisitor_p.h \ + $$PWD/javascriptengine_p.h \ + $$PWD/javascriptgrammar_p.h \ + $$PWD/javascriptlexer_p.h \ + $$PWD/javascriptmemorypool_p.h \ + $$PWD/javascriptnodepool_p.h \ + $$PWD/javascriptparser_p.h \ + $$PWD/javascriptprettypretty_p.h \ + $$PWD/javascriptvalue.h \ + +SOURCES += $$PWD/javascriptast.cpp \ + $$PWD/javascriptastvisitor.cpp \ + $$PWD/javascriptengine_p.cpp \ + $$PWD/javascriptgrammar.cpp \ + $$PWD/javascriptlexer.cpp \ + $$PWD/javascriptprettypretty.cpp \ + $$PWD/javascriptparser.cpp + diff --git a/src/declarative/qml/qml.pri b/src/declarative/qml/qml.pri index 65e6763..523a31b 100644 --- a/src/declarative/qml/qml.pri +++ b/src/declarative/qml/qml.pri @@ -61,3 +61,10 @@ HEADERS += qml/qmlparser_p.h \ # for qtscript debugger QT += scripttools include(script/script.pri) + +# new language front-end +include(parser/parser.pri) + +HEADERS += qml/qmlscriptparser_p.h + +SOURCES += qml/qmlscriptparser.cpp diff --git a/src/declarative/qml/qmlcompiler.cpp b/src/declarative/qml/qmlcompiler.cpp index f03ce20..e1a88bb 100644 --- a/src/declarative/qml/qmlcompiler.cpp +++ b/src/declarative/qml/qmlcompiler.cpp @@ -60,6 +60,8 @@ #include #include +#include "qmlscriptparser_p.h" + QT_BEGIN_NAMESPACE /* New properties and signals can be added to any QObject type from QML. diff --git a/src/declarative/qml/qmlcompiler_p.h b/src/declarative/qml/qmlcompiler_p.h index 754e284..79d788e 100644 --- a/src/declarative/qml/qmlcompiler_p.h +++ b/src/declarative/qml/qmlcompiler_p.h @@ -51,6 +51,7 @@ class QStringList; QT_BEGIN_NAMESPACE class QmlXmlParser; +class QmlScriptParser; class QmlEngine; class QmlComponent; class QmlCompiledComponent; diff --git a/src/declarative/qml/qmlcomponent.cpp b/src/declarative/qml/qmlcomponent.cpp index 83d500c..590f23f 100644 --- a/src/declarative/qml/qmlcomponent.cpp +++ b/src/declarative/qml/qmlcomponent.cpp @@ -56,6 +56,7 @@ #include #include +#include "qmlscriptparser_p.h" QT_BEGIN_NAMESPACE class QByteArray; diff --git a/src/declarative/qml/qmldom.cpp b/src/declarative/qml/qmldom.cpp index 274b542..0fe9111 100644 --- a/src/declarative/qml/qmldom.cpp +++ b/src/declarative/qml/qmldom.cpp @@ -47,6 +47,8 @@ #include #include +#include "qmlscriptparser_p.h" + QT_BEGIN_NAMESPACE QmlDomDocumentPrivate::QmlDomDocumentPrivate() @@ -150,7 +152,11 @@ bool QmlDomDocument::load(QmlEngine *engine, const QByteArray &data) { d->error = QString(); - QmlXmlParser parser; +#ifdef QML_WITH_XML_PARSER + QmlXmlParser parser; +#else + QmlScriptParser parser; +#endif if(!parser.parse(data)) { d->error = parser.errorDescription(); return false; -- cgit v0.12 From 78e71084a29facdc5d2a81383b0f5bb1f78440bf Mon Sep 17 00:00:00 2001 From: Roberto Raggi Date: Thu, 9 Apr 2009 16:54:50 +0200 Subject: Compile with gcc 4.x --- src/declarative/qml/parser/javascript.g | 4 ++-- src/declarative/qml/parser/javascriptparser.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/declarative/qml/parser/javascript.g b/src/declarative/qml/parser/javascript.g index 24467dd..af12a73 100644 --- a/src/declarative/qml/parser/javascript.g +++ b/src/declarative/qml/parser/javascript.g @@ -590,11 +590,11 @@ case $rule_number: { UiQualifiedId: UiQualifiedId T_DOT T_IDENTIFIER ; /. -case $rule_number: +case $rule_number: { AST::UiQualifiedId *node = makeAstNode (driver->nodePool(), sym(1).UiQualifiedId, sym(3).sval); node->identifierToken = loc(3); sym(1).Node = node; - break; +} break; ./ diff --git a/src/declarative/qml/parser/javascriptparser.cpp b/src/declarative/qml/parser/javascriptparser.cpp index 0b87500..7e95ec7 100644 --- a/src/declarative/qml/parser/javascriptparser.cpp +++ b/src/declarative/qml/parser/javascriptparser.cpp @@ -248,11 +248,11 @@ case 13: { sym(1).Node = node; } break; -case 14: +case 14: { AST::UiQualifiedId *node = makeAstNode (driver->nodePool(), sym(1).UiQualifiedId, sym(3).sval); node->identifierToken = loc(3); sym(1).Node = node; - break; +} break; case 15: { AST::ThisExpression *node = makeAstNode (driver->nodePool()); -- cgit v0.12 From d4bc83a09d29a9f28f7d453eb9e0693225c3a32e Mon Sep 17 00:00:00 2001 From: Roberto Raggi Date: Thu, 9 Apr 2009 17:45:59 +0200 Subject: Added missing files. --- src/declarative/qml/qmlscriptparser.cpp | 339 ++++++++++++++++++++++++++++++++ src/declarative/qml/qmlscriptparser_p.h | 43 ++++ 2 files changed, 382 insertions(+) create mode 100644 src/declarative/qml/qmlscriptparser.cpp create mode 100644 src/declarative/qml/qmlscriptparser_p.h diff --git a/src/declarative/qml/qmlscriptparser.cpp b/src/declarative/qml/qmlscriptparser.cpp new file mode 100644 index 0000000..c74f4cb --- /dev/null +++ b/src/declarative/qml/qmlscriptparser.cpp @@ -0,0 +1,339 @@ + +#include "qmlscriptparser_p.h" + +#include "parser/javascriptengine_p.h" +#include "parser/javascriptparser_p.h" +#include "parser/javascriptlexer_p.h" +#include "parser/javascriptnodepool_p.h" +#include "parser/javascriptastvisitor_p.h" +#include "parser/javascriptast_p.h" +#include "parser/javascriptprettypretty_p.h" + +#include +#include + +QT_BEGIN_NAMESPACE + +using namespace JavaScript; +using namespace QmlParser; + +namespace { + +class ProcessAST: protected AST::Visitor +{ + struct State { + State() : object(0), property(0) {} + State(Object *o) : object(o), property(0) {} + State(Object *o, Property *p) : object(o), property(p) {} + + Object *object; + Property *property; + }; + + struct StateStack : public QStack + { + void pushObject(Object *obj) + { + push(State(obj)); + } + + void pushProperty(const QString &name, int lineNumber) + { + const State &state = top(); + if (state.property) { + State s(state.property->getValue(), + state.property->getValue()->getProperty(name.toLatin1())); + s.property->line = lineNumber; + push(s); + } else { + State s(state.object, + state.object->getProperty(name.toLatin1())); + s.property->line = lineNumber; + push(s); + } + } + }; + +public: + ProcessAST(QmlScriptParser *parser); + virtual ~ProcessAST(); + + void operator()(AST::Node *node); + +protected: + using AST::Visitor::visit; + using AST::Visitor::endVisit; + + virtual bool visit(AST::UiObjectDefinition *node); + virtual void endVisit(AST::UiObjectDefinition *node); + + virtual bool visit(AST::UiPublicMember *node); + virtual bool visit(AST::UiObjectBinding *node); + virtual bool visit(AST::UiScriptBinding *node); + virtual bool visit(AST::UiArrayBinding *node); + + void accept(AST::Node *node); + + QString asString(AST::UiQualifiedId *node) const; + + const State state() const; + Object *currentObject() const; + Property *currentProperty() const; + + QString qualifiedNameId() const; + +private: + QmlScriptParser *_parser; + StateStack _stateStack; + QStringList _scope; +}; + +ProcessAST::ProcessAST(QmlScriptParser *parser) + : _parser(parser) +{ +} + +ProcessAST::~ProcessAST() +{ +} + +void ProcessAST::operator()(AST::Node *node) +{ + accept(node); +} + +void ProcessAST::accept(AST::Node *node) +{ + AST::Node::acceptChild(node, this); +} + +const ProcessAST::State ProcessAST::state() const +{ + if (_stateStack.isEmpty()) + return State(); + + return _stateStack.back(); +} + +Object *ProcessAST::currentObject() const +{ + return state().object; +} + +Property *ProcessAST::currentProperty() const +{ + return state().property; +} + +QString ProcessAST::qualifiedNameId() const +{ + return _scope.join(QLatin1String("/")); +} + +QString ProcessAST::asString(AST::UiQualifiedId *node) const +{ + QString s; + + for (AST::UiQualifiedId *it = node; it; it = it->next) { + s.append(it->name->asString()); + + if (it->next) + s.append(QLatin1Char('.')); + } + + return s; +} + +// UiObjectMember: T_PUBLIC T_IDENTIFIER T_IDENTIFIER T_COLON Expression UiObjectInitializer ; +bool ProcessAST::visit(AST::UiPublicMember *node) +{ + qWarning() << Q_FUNC_INFO << "not implemented"; + return false; +} + +// UiObjectMember: T_IDENTIFIER UiObjectInitializer ; +bool ProcessAST::visit(AST::UiObjectDefinition *node) +{ + const QString name = node->name->asString(); + bool isType = name.at(0).isUpper() && !name.contains(QLatin1Char('.')); + + _scope.append(name); + + if (! isType) { + qWarning() << "bad name for a class"; // ### FIXME + return false; + } + + // Class + const int typeId = _parser->findOrCreateTypeId(name); + int line = node->identifierToken.startLine; + + Object *obj = new Object; + obj->type = typeId; + obj->typeName = qualifiedNameId().toLatin1(); + obj->line = line; + + if (! _parser->tree()) { + _parser->setTree(obj); + _stateStack.pushObject(obj); + } else { + const State state = _stateStack.top(); + Value *v = new Value; + v->object = obj; + v->line = line; + if(state.property) + state.property->addValue(v); + else + state.object->getDefaultProperty()->addValue(v); + _stateStack.pushObject(obj); + } + + return true; +} + +// UiObjectMember: T_IDENTIFIER UiObjectInitializer ; +void ProcessAST::endVisit(AST::UiObjectDefinition *) +{ + _stateStack.pop(); + _scope.removeLast(); +} + +// UiObjectMember: UiQualifiedId T_COLON T_IDENTIFIER UiObjectInitializer ; +bool ProcessAST::visit(AST::UiObjectBinding *node) +{ + qWarning() << Q_FUNC_INFO << "not implemented"; + return false; +} + +// UiObjectMember: UiQualifiedId T_COLON Statement ; +bool ProcessAST::visit(AST::UiScriptBinding *node) +{ + const QString qualifiedId = asString(node->qualifiedId); + const QStringList str = qualifiedId.split(QLatin1Char('.')); + int line = node->colonToken.startLine; + + for(int ii = 0; ii < str.count(); ++ii) { + const QString s = str.at(ii); + _stateStack.pushProperty(s, line); + } + + QString primitive; + QTextStream out(&primitive); + PrettyPretty pp(out); + + if (node->statement->kind == AST::Node::Kind_ExpressionStatement) { + AST::ExpressionStatement *stmt = static_cast(node->statement); + + if (stmt->expression && stmt->expression->kind == AST::Node::Kind_IdentifierExpression) + primitive = static_cast(stmt->expression)->name->asString(); + else { + out << "{"; + pp(stmt->expression); + out << "}"; + } + } else { + pp(node->statement); + } + + + + + const State s = state(); + Value *v = new Value; + v->primitive = primitive; + v->line = line; + s.property->addValue(v); + + for(int ii = str.count() - 1; ii >= 0; --ii) + _stateStack.pop(); + + return false; +} + +// UiObjectMember: UiQualifiedId T_COLON T_LBRACKET UiObjectMemberList T_RBRACKET ; +bool ProcessAST::visit(AST::UiArrayBinding *node) +{ + qWarning() << Q_FUNC_INFO << "not implemented"; + return false; +} + +} // end of anonymous namespace + + +QmlScriptParser::QmlScriptParser() + : root(0) +{ +} + +QmlScriptParser::~QmlScriptParser() +{ +} + +bool QmlScriptParser::parse(const QByteArray &data, const QUrl &url) +{ + const QString fileName = url.toString(); + const QString code = QString::fromUtf8(data); // ### FIXME + + JavaScriptParser parser; + JavaScriptEnginePrivate driver; + + NodePool nodePool(fileName, &driver); + driver.setNodePool(&nodePool); + + Lexer lexer(&driver); + lexer.setCode(code, /*line = */ 1); + driver.setLexer(&lexer); + + if (! parser.parse(&driver)) { + _error = parser.errorMessage(); + return false; + } + + ProcessAST process(this); + process(parser.ast()); + + return true; +} + +QString QmlScriptParser::errorDescription() const +{ + return _error; +} + +QMap QmlScriptParser::nameSpacePaths() const +{ + qWarning() << Q_FUNC_INFO << "not implemented"; + return _nameSpacePaths; +} + +QStringList QmlScriptParser::types() const +{ + return _typeNames; +} + +Object *QmlScriptParser::tree() const +{ + return root; +} + +int QmlScriptParser::findOrCreateTypeId(const QString &name) +{ + int index = _typeNames.indexOf(name); + + if (index == -1) { + index = _typeNames.size(); + _typeNames.append(name); + } + + return index; +} + +void QmlScriptParser::setTree(Object *tree) +{ + Q_ASSERT(! root); + + root = tree; +} + + +QT_END_NAMESPACE diff --git a/src/declarative/qml/qmlscriptparser_p.h b/src/declarative/qml/qmlscriptparser_p.h new file mode 100644 index 0000000..d9a557f --- /dev/null +++ b/src/declarative/qml/qmlscriptparser_p.h @@ -0,0 +1,43 @@ +#ifndef QMLSCRIPTPARSER_P_H +#define QMLSCRIPTPARSER_P_H + +#include +#include +#include + +QT_BEGIN_HEADER +QT_BEGIN_NAMESPACE + +QT_MODULE(Declarative) + +class QByteArray; + +class QmlScriptParser +{ +public: + QmlScriptParser(); + ~QmlScriptParser(); + + bool parse(const QByteArray &data, const QUrl &url = QUrl()); + QString errorDescription() const; + + QMap nameSpacePaths() const; + QStringList types() const; + + QmlParser::Object *tree() const; + +// ### private: + int findOrCreateTypeId(const QString &name); + void setTree(QmlParser::Object *tree); + +private: + QMap _nameSpacePaths; + QmlParser::Object *root; + QStringList _typeNames; + QString _error; +}; + +QT_END_NAMESPACE +QT_END_HEADER + +#endif // QMLSCRIPTPARSER_P_H -- cgit v0.12 From b080c837c4c63b1cd0fdea9ae483cad824aef0d1 Mon Sep 17 00:00:00 2001 From: Roberto Raggi Date: Thu, 9 Apr 2009 18:37:40 +0200 Subject: Enable the "old" XML parser when the qgetenv("QML_XML") is not empty. --- src/declarative/qml/qmldom.cpp | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/src/declarative/qml/qmldom.cpp b/src/declarative/qml/qmldom.cpp index 0fe9111..54cc2e4 100644 --- a/src/declarative/qml/qmldom.cpp +++ b/src/declarative/qml/qmldom.cpp @@ -152,16 +152,6 @@ bool QmlDomDocument::load(QmlEngine *engine, const QByteArray &data) { d->error = QString(); -#ifdef QML_WITH_XML_PARSER - QmlXmlParser parser; -#else - QmlScriptParser parser; -#endif - if(!parser.parse(data)) { - d->error = parser.errorDescription(); - return false; - } - QmlCompiledComponent component; QmlCompiler compiler; // ### @@ -172,9 +162,9 @@ bool QmlDomDocument::load(QmlEngine *engine, const QByteArray &data) return false; } - if(parser.tree()) { - component.dump(0, parser.tree()); - d->root = parser.tree(); + if(tree) { + component.dump(0, tree); + d->root = tree; d->root->addref(); } -- cgit v0.12 From ab83f16fd07300342d786f48a82b4d81f77f670d Mon Sep 17 00:00:00 2001 From: mae Date: Fri, 17 Apr 2009 19:32:32 +0200 Subject: support both *.qml and *.whatever with autodetection. Some debug output, some fixes. Some stuff works now, biggest omission is UiObjectBinding to get the more complex examples working. --- src/declarative/qml/qmlcompiler.cpp | 2 ++ src/declarative/qml/qmlcomponent.cpp | 25 +++++++++++++++++++++++ src/declarative/qml/qmlcomponent_p.h | 1 + src/declarative/qml/qmlparser.cpp | 2 ++ src/declarative/qml/qmlscriptparser.cpp | 35 +++++++++++++++++++++++++++------ 5 files changed, 59 insertions(+), 6 deletions(-) diff --git a/src/declarative/qml/qmlcompiler.cpp b/src/declarative/qml/qmlcompiler.cpp index e1a88bb..dd42581 100644 --- a/src/declarative/qml/qmlcompiler.cpp +++ b/src/declarative/qml/qmlcompiler.cpp @@ -747,6 +747,8 @@ bool QmlCompiler::compileSignal(Property *prop, Object *obj) if(isBinding(script)) COMPILE_EXCEPTION("Cannot assign binding to signal property"); + qDebug() << "and here we go..."; + int idx = output->indexForString(script); int pr = output->indexForByteArray(prop->name); diff --git a/src/declarative/qml/qmlcomponent.cpp b/src/declarative/qml/qmlcomponent.cpp index 590f23f..4a3f9b0 100644 --- a/src/declarative/qml/qmlcomponent.cpp +++ b/src/declarative/qml/qmlcomponent.cpp @@ -61,6 +61,17 @@ QT_BEGIN_NAMESPACE class QByteArray; +bool QmlComponentPrivate::isXml(const QByteArray &ba) +{ + for (int i = 0; i < ba.size(); ++i) { + char c = ba.at(i); + if (c == ' ' || c == '\n' || c == '\r' || c == '\t') + continue; + return (c == '<'); + } + return true; +} + /*! \class QmlComponent \brief The QmlComponent class encapsulates a QML component description. @@ -334,6 +345,20 @@ void QmlComponent::loadUrl(const QUrl &url) d->fromTypeData(data); +<<<<<<< HEAD:src/declarative/qml/qmlcomponent.cpp +======= + // Compile data + QmlCompiler compiler; + if(!compiler.compile(d->engine, parser, d->cc)) { + qWarning().nospace() +#ifdef QML_VERBOSEERRORS_ENABLED + << "QmlComponent: " +#endif + << compiler.errorDescription().toLatin1().constData() << " @" + << d->name.toLatin1().constData() << ":" + << compiler.errorLine(); + } +>>>>>>> support both *.qml and *.whatever with autodetection. Some debug output, some fixes.:src/declarative/qml/qmlcomponent.cpp } emit statusChanged(status()); diff --git a/src/declarative/qml/qmlcomponent_p.h b/src/declarative/qml/qmlcomponent_p.h index 8074775..bb5f7bb 100644 --- a/src/declarative/qml/qmlcomponent_p.h +++ b/src/declarative/qml/qmlcomponent_p.h @@ -81,6 +81,7 @@ public: QmlEngine *engine; void clear(); + static bool isXml(const QByteArray &); }; #endif // QMLCOMPONENT_P_H diff --git a/src/declarative/qml/qmlparser.cpp b/src/declarative/qml/qmlparser.cpp index 54db32e..6c71a97 100644 --- a/src/declarative/qml/qmlparser.cpp +++ b/src/declarative/qml/qmlparser.cpp @@ -57,6 +57,7 @@ #include #include "private/qmlxmlparser_p.h" #include +#include QT_BEGIN_NAMESPACE @@ -151,6 +152,7 @@ Object *QmlParser::Property::getValue() void QmlParser::Property::addValue(Value *v) { + qDebug() << "Property" << name << "addValue" << v->primitive; values << v; } diff --git a/src/declarative/qml/qmlscriptparser.cpp b/src/declarative/qml/qmlscriptparser.cpp index c74f4cb..9f4ff05 100644 --- a/src/declarative/qml/qmlscriptparser.cpp +++ b/src/declarative/qml/qmlscriptparser.cpp @@ -221,12 +221,38 @@ bool ProcessAST::visit(AST::UiScriptBinding *node) QTextStream out(&primitive); PrettyPretty pp(out); + Property *prop = currentProperty(); + if (node->statement->kind == AST::Node::Kind_ExpressionStatement) { AST::ExpressionStatement *stmt = static_cast(node->statement); - if (stmt->expression && stmt->expression->kind == AST::Node::Kind_IdentifierExpression) + if(prop->name.length() >= 3 && prop->name.startsWith("on") && + ('A' <= prop->name.at(2) && 'Z' >= prop->name.at(2))) { + pp(stmt->expression); + + // here comes a cruel hack until we support functions properly with arguments for signal properties + if (primitive.startsWith(QLatin1String("function("))) { + int brace = 0; + for (;brace < primitive.size(); ++brace) + if (primitive.at(brace) == QLatin1Char('{')) + break; + primitive = primitive.mid(brace + 1, primitive.size() - brace - 2); + } + //end of hack + + } else if (prop->name == "id" && stmt->expression && stmt->expression->kind == AST::Node::Kind_IdentifierExpression) { primitive = static_cast(stmt->expression)->name->asString(); - else { + } else if (stmt->expression->kind == AST::Node::Kind_StringLiteral) { + // hack: emulate weird XML feature that string literals are not quoted. + //This needs to be fixed in the qmlcompiler once xml goes away. + primitive = static_cast(stmt->expression)->value->asString(); + } else if (stmt->expression->kind == AST::Node::Kind_TrueLiteral + || stmt->expression->kind == AST::Node::Kind_FalseLiteral + || stmt->expression->kind == AST::Node::Kind_NumericLiteral + ) { + pp(stmt->expression); + } else { + // create a binding out << "{"; pp(stmt->expression); out << "}"; @@ -236,13 +262,10 @@ bool ProcessAST::visit(AST::UiScriptBinding *node) } - - - const State s = state(); Value *v = new Value; v->primitive = primitive; v->line = line; - s.property->addValue(v); + prop->addValue(v); for(int ii = str.count() - 1; ii >= 0; --ii) _stateStack.pop(); -- cgit v0.12 From 89684b4e52d7fd0485ef12a4554f88439037e6bb Mon Sep 17 00:00:00 2001 From: mae Date: Sun, 19 Apr 2009 17:06:05 +0200 Subject: implement UiObjectBinding (UiObjectMember: UiQualifiedId T_COLON T_IDENTIFIER UiObjectInitializer) --- src/declarative/qml/qmlscriptparser.cpp | 68 +++++++++++++++++++++++++++++++-- 1 file changed, 65 insertions(+), 3 deletions(-) diff --git a/src/declarative/qml/qmlscriptparser.cpp b/src/declarative/qml/qmlscriptparser.cpp index 9f4ff05..2f62cfd 100644 --- a/src/declarative/qml/qmlscriptparser.cpp +++ b/src/declarative/qml/qmlscriptparser.cpp @@ -68,7 +68,10 @@ protected: virtual void endVisit(AST::UiObjectDefinition *node); virtual bool visit(AST::UiPublicMember *node); + virtual bool visit(AST::UiObjectBinding *node); + virtual void endVisit(AST::UiObjectBinding *node); + virtual bool visit(AST::UiScriptBinding *node); virtual bool visit(AST::UiArrayBinding *node); @@ -201,8 +204,67 @@ void ProcessAST::endVisit(AST::UiObjectDefinition *) // UiObjectMember: UiQualifiedId T_COLON T_IDENTIFIER UiObjectInitializer ; bool ProcessAST::visit(AST::UiObjectBinding *node) { - qWarning() << Q_FUNC_INFO << "not implemented"; - return false; +// qWarning() << Q_FUNC_INFO << "not implemented"; + const QString qualifiedId = asString(node->qualifiedId); + const QStringList str = qualifiedId.split(QLatin1Char('.')); + int line = node->colonToken.startLine; + + for(int ii = 0; ii < str.count(); ++ii) { + const QString s = str.at(ii); + _stateStack.pushProperty(s, line); + } + + const QString name = node->name->asString(); + bool isType = name.at(0).isUpper() && !name.contains(QLatin1Char('.')); + + _scope.append(name); + + if (! isType) { + qWarning() << "bad name for a class"; // ### FIXME + return false; + } + + // Class + const int typeId = _parser->findOrCreateTypeId(name); + line = node->identifierToken.startLine; + + Object *obj = new Object; + obj->type = typeId; + obj->typeName = qualifiedNameId().toLatin1(); + obj->line = line; + + Property *prop = currentProperty(); + Value *v = new Value; + v->object = obj; + v->line = line; + prop->addValue(v); + + for(int ii = str.count() - 1; ii >= 0; --ii) + _stateStack.pop(); + + if (! _parser->tree()) { + _parser->setTree(obj); + _stateStack.pushObject(obj); + } else { + const State state = _stateStack.top(); + Value *v = new Value; + v->object = obj; + v->line = line; + if(state.property) + state.property->addValue(v); + else + state.object->getDefaultProperty()->addValue(v); + _stateStack.pushObject(obj); + } + + return true; +} + +// UiObjectMember: UiQualifiedId T_COLON T_IDENTIFIER UiObjectInitializer ; +void ProcessAST::endVisit(AST::UiObjectBinding *node) +{ + _stateStack.pop(); + _scope.removeLast(); } // UiObjectMember: UiQualifiedId T_COLON Statement ; @@ -270,7 +332,7 @@ bool ProcessAST::visit(AST::UiScriptBinding *node) for(int ii = str.count() - 1; ii >= 0; --ii) _stateStack.pop(); - return false; + return true; } // UiObjectMember: UiQualifiedId T_COLON T_LBRACKET UiObjectMemberList T_RBRACKET ; -- cgit v0.12 From 3b60326ce12dcbac1dfeba3c6ba73fa04c15d16e Mon Sep 17 00:00:00 2001 From: Roberto Raggi Date: Mon, 20 Apr 2009 12:04:31 +0200 Subject: Introduced `import' statements. --- src/declarative/qml/parser/javascript.g | 56 +- src/declarative/qml/parser/javascriptast.cpp | 17 + src/declarative/qml/parser/javascriptast_p.h | 46 + src/declarative/qml/parser/javascriptastfwd_p.h | 2 + .../qml/parser/javascriptastvisitor_p.h | 4 + src/declarative/qml/parser/javascriptgrammar.cpp | 1107 ++++++++++---------- src/declarative/qml/parser/javascriptgrammar_p.h | 19 +- src/declarative/qml/parser/javascriptlexer.cpp | 4 + src/declarative/qml/parser/javascriptparser.cpp | 417 ++++---- src/declarative/qml/parser/javascriptparser_p.h | 6 +- 10 files changed, 909 insertions(+), 769 deletions(-) diff --git a/src/declarative/qml/parser/javascript.g b/src/declarative/qml/parser/javascript.g index af12a73..db6d898 100644 --- a/src/declarative/qml/parser/javascript.g +++ b/src/declarative/qml/parser/javascript.g @@ -45,7 +45,7 @@ %parser JavaScriptGrammar %decl javascriptparser_p.h %impl javascriptparser.cpp -%expect 3 +%expect 2 %expect-rr 1 %token T_AND "&" T_AND_AND "&&" T_AND_EQ "&=" @@ -81,6 +81,7 @@ --- context keywords. %token T_PUBLIC "public" +%token T_IMPORT "import" %nonassoc SHIFT_THERE %nonassoc T_IDENTIFIER T_COLON @@ -243,6 +244,8 @@ public: JavaScript::AST::VariableDeclarationList *VariableDeclarationList; JavaScript::AST::UiProgram *UiProgram; + JavaScript::AST::UiImportList *UiImportList; + JavaScript::AST::UiImport *UiImport; JavaScript::AST::UiPublicMember *UiPublicMember; JavaScript::AST::UiObjectDefinition *UiObjectDefinition; JavaScript::AST::UiObjectInitializer *UiObjectInitializer; @@ -461,14 +464,55 @@ bool JavaScriptParser::parse(JavaScriptEnginePrivate *driver) -------------------------------------------------------------------------------------------------------- -- Declarative UI -------------------------------------------------------------------------------------------------------- -Program: UiObjectMemberList ; + +Program: UiImportListOpt UiObjectMemberList ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(2).UiObjectMemberList->finish()); +} break; +./ + +UiImportListOpt: Empty ; +UiImportListOpt: UiImportList ; +/. +case $rule_number: { + sym(1).Node = sym(1).UiImportList->finish(); +} break; +./ + +UiImportList: UiImport ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).UiImport); +} break; +./ + +UiImportList: UiImportList UiImport ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).UiObjectMemberList->finish()); + sym(1).Node = makeAstNode (driver->nodePool(), + sym(1).UiImportList, sym(2).UiImport); +} break; +./ + +UiImport: T_IMPORT T_STRING_LITERAL T_AUTOMATIC_SEMICOLON; +UiImport: T_IMPORT T_STRING_LITERAL T_SEMICOLON; +/. +case $rule_number: { + AST::UiImport *node = makeAstNode(driver->nodePool(), sym(2).sval); + node->importToken = loc(1); + node->fileNameToken = loc(2); + node->semicolonToken = loc(3); + sym(1).Node = node; } break; ./ Empty: ; +/. +case $rule_number: { + sym(1).Node = 0; +} break; +./ UiObjectMemberList: UiObjectMember ; /. @@ -477,13 +521,11 @@ case $rule_number: { } break; ./ -UiObjectMemberList: UiObjectMemberList Empty UiObjectMember ; -/.case $rule_number:./ -UiObjectMemberList: UiObjectMemberList T_COMMA UiObjectMember ; +UiObjectMemberList: UiObjectMemberList UiObjectMember ; /. case $rule_number: { AST::UiObjectMemberList *node = makeAstNode (driver->nodePool(), - sym(1).UiObjectMemberList, sym(3).UiObjectMember); + sym(1).UiObjectMemberList, sym(2).UiObjectMember); sym(1).Node = node; } break; ./ diff --git a/src/declarative/qml/parser/javascriptast.cpp b/src/declarative/qml/parser/javascriptast.cpp index 8d8ca7d..f779f04 100644 --- a/src/declarative/qml/parser/javascriptast.cpp +++ b/src/declarative/qml/parser/javascriptast.cpp @@ -871,6 +871,23 @@ void UiQualifiedId::accept0(Visitor *visitor) visitor->endVisit(this); } +void UiImport::accept0(Visitor *visitor) +{ + if (visitor->visit(this)) { + } + + visitor->endVisit(this); +} + +void UiImportList::accept0(Visitor *visitor) +{ + if (visitor->visit(this)) { + acceptChild(next, visitor); + } + + visitor->endVisit(this); +} + } } // namespace JavaScript::AST QT_END_NAMESPACE diff --git a/src/declarative/qml/parser/javascriptast_p.h b/src/declarative/qml/parser/javascriptast_p.h index 1e9256e..4a5f553 100644 --- a/src/declarative/qml/parser/javascriptast_p.h +++ b/src/declarative/qml/parser/javascriptast_p.h @@ -1564,6 +1564,52 @@ public: UiObjectMemberList *members; }; +class UiImport: public Node +{ +public: + UiImport(JavaScriptNameIdImpl *fileName) + : fileName(fileName) + { + } + + virtual void accept0(Visitor *visitor); + +// attributes + JavaScriptNameIdImpl *fileName; + SourceLocation importToken; + SourceLocation fileNameToken; + SourceLocation semicolonToken; +}; + +class UiImportList: public Node +{ +public: + UiImportList(UiImport *import) + : import(import), + next(0) + { } + + UiImportList(UiImportList *previous, UiImport *import) + : import(import) + { + next = previous->next; + previous->next = this; + } + + UiImportList *finish() + { + UiImportList *head = next; + next = 0; + return head; + } + + virtual void accept0(Visitor *visitor); + +// attributes + UiImport *import; + UiImportList *next; +}; + class UiObjectMember: public Node { }; diff --git a/src/declarative/qml/parser/javascriptastfwd_p.h b/src/declarative/qml/parser/javascriptastfwd_p.h index 946879a..f53c0e5 100644 --- a/src/declarative/qml/parser/javascriptastfwd_p.h +++ b/src/declarative/qml/parser/javascriptastfwd_p.h @@ -143,6 +143,8 @@ class DebuggerStatement; // ui elements class UiProgram; +class UiImportList; +class UiImport; class UiPublicMember; class UiObjectDefinition; class UiObjectInitializer; diff --git a/src/declarative/qml/parser/javascriptastvisitor_p.h b/src/declarative/qml/parser/javascriptastvisitor_p.h index 9e428cb..bc9a8a6 100644 --- a/src/declarative/qml/parser/javascriptastvisitor_p.h +++ b/src/declarative/qml/parser/javascriptastvisitor_p.h @@ -70,6 +70,8 @@ public: // Ui virtual bool visit(UiProgram *) { return true; } + virtual bool visit(UiImportList *) { return true; } + virtual bool visit(UiImport *) { return true; } virtual bool visit(UiPublicMember *) { return true; } virtual bool visit(UiObjectDefinition *) { return true; } virtual bool visit(UiObjectInitializer *) { return true; } @@ -80,6 +82,8 @@ public: virtual bool visit(UiQualifiedId *) { return true; } virtual void endVisit(UiProgram *) {} + virtual void endVisit(UiImportList *) {} + virtual void endVisit(UiImport *) {} virtual void endVisit(UiPublicMember *) {} virtual void endVisit(UiObjectDefinition *) {} virtual void endVisit(UiObjectInitializer *) {} diff --git a/src/declarative/qml/parser/javascriptgrammar.cpp b/src/declarative/qml/parser/javascriptgrammar.cpp index a8da9a6..51ec48e 100644 --- a/src/declarative/qml/parser/javascriptgrammar.cpp +++ b/src/declarative/qml/parser/javascriptgrammar.cpp @@ -10,557 +10,563 @@ const char *const JavaScriptGrammar::spell [] = { "||", "+", "+=", "++", "?", "}", "]", "%", "%=", "return", ")", ";", 0, "*", "*=", "string literal", "switch", "this", "throw", "~", "try", "typeof", "var", "void", "while", "with", "^", "^=", "null", "true", - "false", "const", "debugger", "reserved word", "public", 0, 0}; + "false", "const", "debugger", "reserved word", "public", "import", 0, 0}; const int JavaScriptGrammar::lhs [] = { - 87, 89, 88, 88, 88, 91, 90, 90, 90, 90, - 90, 90, 90, 92, 92, 95, 95, 95, 95, 95, - 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, - 97, 97, 101, 101, 96, 96, 99, 99, 102, 102, - 102, 102, 103, 103, 103, 103, 103, 103, 103, 103, - 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, - 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, - 103, 103, 103, 104, 104, 105, 105, 105, 105, 105, - 108, 108, 109, 109, 109, 109, 107, 107, 110, 110, - 111, 111, 112, 112, 112, 113, 113, 113, 113, 113, - 113, 113, 113, 113, 113, 114, 114, 114, 114, 115, - 115, 115, 116, 116, 116, 116, 117, 117, 117, 117, - 117, 117, 117, 118, 118, 118, 118, 118, 118, 119, - 119, 119, 119, 119, 120, 120, 120, 120, 120, 121, - 121, 122, 122, 123, 123, 124, 124, 125, 125, 126, - 126, 127, 127, 128, 128, 129, 129, 130, 130, 131, - 131, 132, 132, 100, 100, 133, 133, 134, 134, 134, - 134, 134, 134, 134, 134, 134, 134, 134, 134, 94, - 94, 135, 135, 136, 136, 137, 137, 93, 93, 93, - 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, - 93, 93, 138, 154, 154, 153, 153, 139, 139, 155, - 155, 156, 156, 158, 158, 157, 159, 162, 160, 160, - 163, 161, 161, 140, 141, 141, 142, 142, 143, 143, - 143, 143, 143, 143, 143, 144, 144, 144, 144, 145, - 145, 145, 145, 146, 146, 147, 149, 164, 164, 167, - 167, 165, 165, 168, 166, 148, 150, 150, 151, 151, - 151, 169, 170, 152, 152, 171, 106, 175, 175, 172, - 172, 173, 173, 176, 177, 177, 178, 178, 174, 174, - 98, 98, 179}; + 88, 89, 89, 92, 92, 93, 93, 91, 90, 90, + 95, 94, 94, 94, 94, 94, 94, 94, 96, 96, + 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, + 99, 99, 99, 99, 99, 101, 101, 105, 105, 100, + 100, 103, 103, 106, 106, 106, 106, 107, 107, 107, + 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, + 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, + 107, 107, 107, 107, 107, 107, 107, 107, 108, 108, + 109, 109, 109, 109, 109, 112, 112, 113, 113, 113, + 113, 111, 111, 114, 114, 115, 115, 116, 116, 116, + 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, + 118, 118, 118, 118, 119, 119, 119, 120, 120, 120, + 120, 121, 121, 121, 121, 121, 121, 121, 122, 122, + 122, 122, 122, 122, 123, 123, 123, 123, 123, 124, + 124, 124, 124, 124, 125, 125, 126, 126, 127, 127, + 128, 128, 129, 129, 130, 130, 131, 131, 132, 132, + 133, 133, 134, 134, 135, 135, 136, 136, 104, 104, + 137, 137, 138, 138, 138, 138, 138, 138, 138, 138, + 138, 138, 138, 138, 98, 98, 139, 139, 140, 140, + 141, 141, 97, 97, 97, 97, 97, 97, 97, 97, + 97, 97, 97, 97, 97, 97, 97, 142, 158, 158, + 157, 157, 143, 143, 159, 159, 160, 160, 162, 162, + 161, 163, 166, 164, 164, 167, 165, 165, 144, 145, + 145, 146, 146, 147, 147, 147, 147, 147, 147, 147, + 148, 148, 148, 148, 149, 149, 149, 149, 150, 150, + 151, 153, 168, 168, 171, 171, 169, 169, 172, 170, + 152, 154, 154, 155, 155, 155, 173, 174, 156, 156, + 175, 110, 179, 179, 176, 176, 177, 177, 180, 181, + 181, 182, 182, 178, 178, 102, 102, 183}; const int JavaScriptGrammar:: rhs[] = { - 1, 0, 1, 3, 3, 3, 4, 2, 5, 3, - 6, 3, 5, 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, + 2, 1, 1, 1, 2, 3, 3, 0, 1, 2, + 3, 4, 2, 5, 3, 6, 3, 5, 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, - 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, + 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, 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}; + 3, 3, 3, 3, 1, 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}; const int JavaScriptGrammar::action_default [] = { - 0, 0, 14, 0, 3, 2, 0, 283, 0, 8, - 2, 0, 0, 6, 4, 5, 0, 12, 0, 113, - 180, 144, 152, 148, 92, 164, 140, 13, 77, 93, - 156, 160, 81, 110, 91, 96, 76, 130, 117, 0, - 23, 24, 20, 279, 17, 281, 35, 0, 0, 0, - 0, 0, 18, 21, 0, 0, 22, 16, 0, 19, - 0, 0, 106, 0, 0, 93, 112, 95, 94, 0, - 0, 0, 108, 109, 107, 111, 0, 141, 0, 0, - 0, 0, 131, 0, 0, 0, 0, 0, 0, 121, - 0, 0, 0, 115, 116, 114, 119, 123, 122, 120, - 118, 133, 132, 134, 0, 149, 0, 145, 0, 0, - 87, 86, 75, 43, 44, 45, 70, 46, 71, 47, - 48, 49, 50, 51, 52, 53, 54, 74, 55, 56, - 57, 58, 59, 72, 60, 61, 62, 63, 64, 65, - 66, 67, 68, 69, 73, 0, 0, 85, 181, 88, - 0, 89, 0, 90, 84, 11, 0, 177, 170, 168, - 175, 176, 174, 173, 179, 172, 171, 169, 178, 165, - 0, 153, 0, 0, 157, 0, 0, 161, 0, 0, - 87, 79, 0, 78, 0, 83, 97, 0, 280, 270, - 271, 0, 268, 0, 269, 0, 272, 188, 195, 194, - 202, 190, 0, 191, 273, 0, 278, 192, 193, 198, - 196, 275, 274, 277, 199, 0, 210, 0, 0, 0, - 0, 279, 17, 0, 281, 182, 224, 0, 0, 0, - 211, 0, 0, 200, 201, 0, 189, 197, 225, 226, - 267, 276, 240, 0, 241, 242, 243, 236, 0, 237, - 238, 239, 264, 265, 0, 0, 0, 0, 0, 229, - 230, 186, 184, 146, 154, 150, 166, 142, 187, 0, - 93, 158, 162, 135, 124, 0, 0, 143, 0, 0, - 0, 0, 136, 0, 0, 0, 0, 0, 128, 126, - 129, 127, 125, 138, 137, 139, 0, 151, 0, 147, - 0, 185, 93, 0, 167, 182, 183, 0, 182, 0, - 0, 232, 0, 0, 0, 234, 0, 155, 0, 0, - 159, 0, 0, 163, 222, 0, 214, 223, 217, 0, - 221, 0, 182, 215, 0, 182, 0, 0, 233, 0, - 0, 0, 235, 280, 270, 0, 0, 272, 0, 266, - 0, 256, 0, 0, 0, 228, 0, 227, 0, 282, - 0, 42, 204, 207, 0, 43, 70, 46, 71, 48, - 49, 20, 53, 54, 17, 55, 58, 18, 21, 182, - 22, 61, 16, 63, 19, 65, 66, 67, 68, 69, - 73, 0, 37, 0, 0, 39, 41, 29, 40, 0, - 38, 28, 205, 203, 81, 82, 87, 0, 80, 0, - 244, 245, 0, 0, 0, 247, 252, 250, 253, 0, - 0, 251, 252, 0, 248, 0, 249, 206, 255, 0, - 206, 254, 0, 257, 258, 0, 206, 259, 260, 0, - 0, 261, 0, 0, 0, 262, 263, 99, 98, 0, - 0, 0, 231, 0, 0, 0, 246, 219, 212, 0, - 220, 216, 0, 218, 208, 0, 209, 213, 0, 36, - 0, 33, 35, 26, 0, 32, 27, 34, 31, 25, - 0, 30, 103, 101, 105, 102, 100, 104, 0, 0, - 10, 17, 35, 7, 2, 9, 15}; + 8, 2, 0, 0, 4, 3, 0, 288, 0, 6, + 7, 5, 19, 0, 9, 1, 0, 0, 13, 0, + 11, 10, 0, 17, 0, 118, 185, 149, 157, 153, + 97, 169, 145, 18, 82, 98, 161, 165, 86, 115, + 96, 101, 81, 135, 122, 0, 28, 29, 25, 284, + 22, 286, 40, 0, 0, 0, 0, 0, 23, 26, + 0, 0, 27, 21, 0, 24, 0, 0, 111, 0, + 0, 98, 117, 100, 99, 0, 0, 0, 113, 114, + 112, 116, 0, 146, 0, 0, 0, 0, 136, 0, + 0, 0, 0, 0, 0, 126, 0, 0, 0, 120, + 121, 119, 124, 128, 127, 125, 123, 138, 137, 139, + 0, 154, 0, 150, 0, 0, 92, 91, 80, 48, + 49, 50, 75, 51, 76, 52, 53, 54, 55, 56, + 57, 58, 59, 79, 60, 61, 62, 63, 64, 77, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 78, 0, 0, 90, 186, 93, 0, 94, 0, 95, + 89, 16, 0, 182, 175, 173, 180, 181, 179, 178, + 184, 177, 176, 174, 183, 170, 0, 158, 0, 0, + 162, 0, 0, 166, 0, 0, 92, 84, 0, 83, + 0, 88, 102, 0, 285, 275, 276, 0, 273, 0, + 274, 0, 277, 193, 200, 199, 207, 195, 0, 196, + 278, 0, 283, 197, 198, 203, 201, 280, 279, 282, + 204, 0, 215, 0, 0, 0, 0, 284, 22, 0, + 286, 187, 229, 0, 0, 0, 216, 0, 0, 205, + 206, 0, 194, 202, 230, 231, 272, 281, 245, 0, + 246, 247, 248, 241, 0, 242, 243, 244, 269, 270, + 0, 0, 0, 0, 0, 234, 235, 191, 189, 151, + 159, 155, 171, 147, 192, 0, 98, 163, 167, 140, + 129, 0, 0, 148, 0, 0, 0, 0, 141, 0, + 0, 0, 0, 0, 133, 131, 134, 132, 130, 143, + 142, 144, 0, 156, 0, 152, 0, 190, 98, 0, + 172, 187, 188, 0, 187, 0, 0, 237, 0, 0, + 0, 239, 0, 160, 0, 0, 164, 0, 0, 168, + 227, 0, 219, 228, 222, 0, 226, 0, 187, 220, + 0, 187, 0, 0, 238, 0, 0, 0, 240, 285, + 275, 0, 0, 277, 0, 271, 0, 261, 0, 0, + 0, 233, 0, 232, 0, 287, 0, 47, 209, 212, + 0, 48, 75, 51, 76, 53, 54, 25, 58, 59, + 22, 60, 63, 23, 26, 187, 27, 66, 21, 68, + 24, 70, 71, 72, 73, 74, 78, 0, 42, 0, + 0, 44, 46, 34, 45, 0, 43, 33, 210, 208, + 86, 87, 92, 0, 85, 0, 249, 250, 0, 0, + 0, 252, 257, 255, 258, 0, 0, 256, 257, 0, + 253, 0, 254, 211, 260, 0, 211, 259, 0, 262, + 263, 0, 211, 264, 265, 0, 0, 266, 0, 0, + 0, 267, 268, 104, 103, 0, 0, 0, 236, 0, + 0, 0, 251, 224, 217, 0, 225, 221, 0, 223, + 213, 0, 214, 218, 0, 41, 0, 38, 40, 31, + 0, 37, 32, 39, 36, 30, 0, 35, 108, 106, + 110, 107, 105, 109, 0, 0, 15, 22, 40, 12, + 0, 14, 20}; const int JavaScriptGrammar::goto_default [] = { - 1, 5, 11, 4, 9, 6, 362, 202, 36, 470, - 468, 360, 359, 20, 469, 358, 361, 111, 32, 28, - 150, 34, 24, 149, 29, 35, 62, 33, 19, 38, - 37, 273, 26, 267, 21, 263, 23, 265, 22, 264, - 30, 271, 31, 272, 25, 266, 262, 303, 409, 268, - 269, 197, 236, 201, 203, 207, 208, 199, 198, 210, - 237, 209, 214, 233, 234, 200, 364, 363, 235, 459, - 458, 325, 326, 461, 328, 460, 327, 415, 419, 422, - 418, 417, 437, 438, 206, 191, 205, 187, 190, 204, - 212, 211, 0}; + 2, 6, 15, 1, 5, 4, 14, 18, 16, 368, + 208, 42, 476, 474, 366, 365, 26, 475, 364, 367, + 117, 38, 34, 156, 40, 30, 155, 35, 41, 68, + 39, 25, 44, 43, 279, 32, 273, 27, 269, 29, + 271, 28, 270, 36, 277, 37, 278, 31, 272, 268, + 309, 415, 274, 275, 203, 242, 207, 209, 213, 214, + 205, 204, 216, 243, 215, 220, 239, 240, 206, 370, + 369, 241, 465, 464, 331, 332, 467, 334, 466, 333, + 421, 425, 428, 424, 423, 443, 444, 212, 197, 211, + 193, 196, 210, 218, 217, 0}; const int JavaScriptGrammar::action_index [] = { - 107, 43, -3, -8, -87, 144, 165, -87, 122, -87, - 135, 120, 111, -87, -87, -87, -22, 3, 567, 127, - -87, 13, -36, -63, 192, -87, 220, 106, -87, 407, - 81, 78, 195, 177, -87, -87, -87, 317, 259, 567, - -87, -87, -87, 34, -87, 1041, 52, 567, 567, 567, - 349, 567, -87, -87, 567, 567, -87, -87, 567, -87, - 567, 567, -87, 567, 567, 108, 162, -87, -87, 567, - 567, 567, -87, -87, -87, 146, 567, 204, 567, 567, - 567, 567, 280, 567, 567, 567, 567, 567, 567, 154, - 567, 567, 567, 82, 87, 97, 259, 259, 259, 259, - 259, 300, 290, 270, 567, -65, 567, 17, 958, 567, - 567, -87, -87, -87, -87, -87, -87, -87, -87, -87, - -87, -87, -87, -87, -87, -87, -87, -87, -87, -87, - -87, -87, -87, -87, -87, -87, -87, -87, -87, -87, - -87, -87, -87, -87, -87, 113, 567, -87, -87, 49, - -1, -87, 567, -87, -87, -87, 567, -87, -87, -87, - -87, -87, -87, -87, -87, -87, -87, -87, -87, -87, - 567, 38, 567, 567, 64, 58, 567, -87, 958, 567, - 567, -87, 117, -87, 2, -87, -87, 36, -87, 46, - 63, 20, -87, 40, -87, 35, 1373, -87, -87, -87, - -87, -87, 138, -87, -87, 1, -87, -87, -87, -87, - -87, -87, 1373, -87, -87, 136, -87, 153, 109, 1290, - 60, 65, 85, 59, 1456, 567, -87, 48, 567, 57, - -87, 53, 51, -87, -87, 56, -87, -87, -87, -87, - -87, -87, -87, 80, -87, -87, -87, -87, 68, -87, - -87, -87, -87, -87, -57, -16, 567, 197, 115, -87, - -87, 875, -87, 4, -48, -72, -87, 214, -2, -59, - 449, 14, 114, 323, 259, 8, 567, 223, 567, 567, - 567, 567, 238, 567, 567, 567, 567, 567, 259, 259, - 259, 259, 259, 255, 221, 248, 567, -43, 567, 118, - 567, -87, 491, 567, -87, 567, 23, -29, 567, -34, - 1290, -87, 567, 126, 1290, -87, 567, -39, 567, 567, - 6, 32, 567, -87, 11, 99, 7, -87, -87, 567, - -87, 0, 567, -87, -38, 567, -33, 1290, -87, 567, - 103, 1290, -87, -11, 5, -24, 9, 1373, -10, -87, - 1290, -87, 567, 94, 1290, 30, 1290, -87, 37, 33, - -20, -87, -87, 1290, -15, 159, -5, 155, 62, 567, - 1290, -4, -35, 79, 15, -17, 375, 67, 41, 799, - 70, 61, 84, 567, 86, 66, 567, 69, 567, 16, - 22, 567, -87, 1124, 54, -87, -87, -87, -87, 567, - -87, -87, -87, -87, 160, -87, 567, -9, -87, 55, - -87, -87, 567, 102, -18, -87, 73, -87, 77, 90, - 567, -87, 83, 74, -87, 24, -87, 1290, -87, 105, - 1290, -87, 175, -87, -87, 100, 1290, 29, -87, 19, - 21, -87, 44, 10, 31, -87, -87, -87, -87, 567, - 95, 1290, -87, 567, 96, 1290, -87, 50, -87, 151, - -87, -87, 567, -87, -87, 47, -87, -87, 101, 45, - 719, -87, 42, -87, 643, -87, -87, -87, -87, -87, - 93, -87, -87, -87, -87, -87, -87, -87, 1207, 18, - -87, 98, 179, -87, 110, -87, -87, + -7, -88, 41, -25, -88, -43, 87, -88, 102, -88, + -88, -88, 12, 18, -88, 124, 113, 92, -88, 186, + -88, -88, 9, 29, 534, 122, -88, 28, -16, -41, + 213, -88, 307, 91, -88, 457, 60, 82, 237, 156, + -88, -88, -88, 372, 157, 534, -88, -88, -88, 32, + -88, 1014, 43, 534, 534, 534, 321, 534, -88, -88, + 534, 534, -88, -88, 534, -88, 534, 534, -88, 534, + 534, 103, 148, -88, -88, 534, 534, 534, -88, -88, + -88, 225, 534, 307, 534, 534, 534, 534, 372, 534, + 534, 534, 534, 534, 534, 158, 534, 534, 534, 101, + 100, 74, 229, 189, 193, 207, 208, 372, 372, 372, + 534, 0, 534, 71, 930, 534, 534, -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, 147, 534, -88, -88, 23, 7, -88, 534, -88, + -88, -88, 534, -88, -88, -88, -88, -88, -88, -88, + -88, -88, -88, -88, -88, -88, 534, 57, 534, 534, + 80, 78, 534, -88, 930, 534, 534, -88, 136, -88, + 31, -88, -88, 37, -88, 42, 66, 33, -88, 46, + -88, 67, 1350, -88, -88, -88, -88, -88, 218, -88, + -88, 56, -88, -88, -88, -88, -88, -88, 1350, -88, + -88, 132, -88, 168, 81, 1266, 53, 52, 72, 54, + 1434, 534, -88, 58, 534, 47, -88, 61, 62, -88, + -88, 55, -88, -88, -88, -88, -88, -88, -88, 73, + -88, -88, -88, -88, 69, -88, -88, -88, -88, -88, + 39, 51, 534, 94, 104, -88, -88, 769, -88, 76, + 35, 34, -88, 244, 164, 68, 389, 48, 83, 260, + 179, 4, 534, 240, 534, 534, 534, 534, 276, 534, + 534, 534, 534, 534, 223, 217, 153, 152, 185, 286, + 270, 292, 534, -75, 534, 1, 534, -88, 457, 534, + -88, 534, 11, -48, 534, -42, 1266, -88, 534, 114, + 1266, -88, 534, -31, 534, 534, 19, 8, 534, -88, + -1, 96, -19, -88, -88, 534, -88, 4, 534, -88, + 27, 534, -36, 1266, -88, 534, 109, 1266, -88, -11, + -6, -38, -22, 1350, -35, -88, 1266, -88, 534, 98, + 1266, -2, 1266, -88, -4, 84, -49, -88, -88, 1266, + -55, 160, -24, 138, 77, 534, 1266, 2, -28, 90, + 3, -29, 347, -3, 20, 692, 21, 24, 49, 534, + 50, 26, 534, 25, 534, 22, -10, 534, -88, 1098, + 45, -88, -88, -88, -88, 534, -88, -88, -88, -88, + 173, -88, 534, -5, -88, 85, -88, -88, 534, 99, + 30, -88, 63, -88, 65, 93, 534, -88, 64, 59, + -88, 10, -88, 1266, -88, 88, 1266, -88, 178, -88, + -88, 95, 1266, 44, -88, 17, 16, -88, 5, -23, + 6, -88, -88, -88, -88, 534, 142, 1266, -88, 534, + 141, 1266, -88, 13, -88, 216, -88, -88, 534, -88, + -88, 15, -88, -88, 119, 38, 846, -88, 40, -88, + 611, -88, -88, -88, -88, -88, 110, -88, -88, -88, + -88, -88, -88, -88, 1182, 14, -88, 79, 228, -88, + 169, -88, -88, - -93, -93, -93, -93, -93, -93, -93, -93, 23, -93, - -93, 16, 18, -93, -93, -93, -93, -93, 28, -93, - -93, -93, -93, -93, -93, -93, -93, 29, -93, -31, - -93, -93, -93, -93, -93, -93, -93, -93, -93, 107, - -93, -93, -93, -93, -93, -93, -93, -1, 126, 123, - 118, 98, -93, -93, 138, 218, -93, -93, 97, -93, - 93, 88, -93, 81, 143, -93, -93, -93, -93, 149, - 101, 120, -93, -93, -93, -93, 110, -93, 102, 150, - 142, 141, -93, 127, 66, 64, 67, 68, 74, -93, - 49, 55, 58, -93, -93, -93, -93, -93, -93, -93, - -93, -93, -93, -93, 77, -93, 70, -93, 46, 52, - 35, -93, -93, -93, -93, -93, -93, -93, -93, -93, - -93, -93, -93, -93, -93, -93, -93, -93, -93, -93, - -93, -93, -93, -93, -93, -93, -93, -93, -93, -93, - -93, -93, -93, -93, -93, -93, -4, -93, -93, -93, - -93, -93, 45, -93, -93, -93, 42, -93, -93, -93, - -93, -93, -93, -93, -93, -93, -93, -93, -93, -93, - 61, -93, 144, 33, -93, -93, -9, -93, 112, 5, - 117, -93, -93, -93, -93, -93, -93, -93, -93, -93, - -93, -93, -93, -93, -93, -93, 25, -93, -93, -93, - -93, -93, -93, -93, -93, -93, -93, -93, -93, -93, - -93, -93, 69, -93, -93, -93, -93, -93, -93, 11, - -93, -93, -93, -93, -93, 34, -93, -93, 30, -23, - -93, -93, -93, -93, -93, -93, -93, -93, -93, -93, - -93, -93, -93, -93, -93, -93, -93, -93, -93, -93, - -93, -93, -93, -93, -93, -93, 57, -93, -93, -93, - -93, 114, -93, -93, -93, -93, -93, -93, -93, -93, - -93, -93, -93, -93, -93, -93, 162, -93, 191, 192, - 175, 201, -93, 60, 82, 91, 124, 116, -93, -93, - -93, -93, -93, -93, -93, -93, 153, -93, 172, -93, - 164, -93, -93, 154, -93, 128, -93, -93, 62, -93, - 20, -93, 15, -93, 14, -93, 174, -93, 188, 165, - -93, -93, 163, -93, -93, -93, -93, -93, -93, 173, - -93, -57, 111, -93, -93, 59, -93, -6, -93, 56, - -93, 38, -93, -93, -49, -93, -93, 72, -93, -93, - 54, -93, 44, -93, 47, -93, 48, -93, -93, -93, - -93, -93, -93, 51, -93, -93, -93, -93, -93, 76, - 43, -93, -93, -93, -93, -93, 50, -93, -93, 36, - -93, -93, -93, 40, -93, -22, 137, -93, 131, -93, - -93, 39, -93, 41, -93, -93, -93, -93, -93, 37, - -93, -93, -93, -93, -93, -93, 96, -93, -93, -93, - -93, -93, 27, -93, -93, -93, -93, -93, -80, -93, - 80, -93, -65, -93, -93, -93, -93, -55, -93, -93, - -56, -93, -93, -93, -93, -93, -93, -75, -93, -93, - -44, -93, -93, -93, -37, -93, -93, -93, -93, -5, - -93, -3, -93, -2, -93, 12, -93, -93, -93, -93, - -93, -93, 26, -93, -93, -43, -93, -93, -93, -93, - 32, -93, 31, -93, 19, -93, -93, -93, -93, -93, - -93, -93, -93, -93, -93, -93, -93, -93, 24, -93, - -93, 21, 22, -93, -93, -93, -93}; + -96, -96, -96, -96, -96, 24, -96, -96, -96, -96, + -96, -96, -96, -96, -96, 10, -96, 9, -96, 22, + -96, -96, -96, -96, 12, -96, -96, -96, -96, -96, + -96, -96, -96, 27, -96, -17, -96, -96, -96, -96, + -96, -96, -96, -96, -96, 140, -96, -96, -96, -96, + -96, -96, -96, -1, 96, 122, 72, 82, -96, -96, + 116, 119, -96, -96, 109, -96, 106, 49, -96, 104, + 110, -96, -96, -96, -96, 101, 100, 86, -96, -96, + -96, -96, 79, -96, 147, 139, 149, 128, -96, 127, + 138, 130, 136, 90, 70, -96, 41, 77, 54, -96, + -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, + 59, -96, 64, -96, 19, 33, 44, -96, -96, -96, + -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, + -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, + -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, + -96, -96, 47, -96, -96, -96, -96, -96, 37, -96, + -96, -96, 31, -96, -96, -96, -96, -96, -96, -96, + -96, -96, -96, -96, -96, -96, 91, -96, 146, -14, + -96, -96, -4, -96, 209, 21, 148, -96, -96, -96, + -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, + -96, -96, 23, -96, -96, -96, -96, -96, -96, -96, + -96, -96, -96, -96, -96, -96, -96, -96, 58, -96, + -96, -96, -96, -96, -96, 17, -96, -96, -96, -96, + -96, 11, -96, -96, 5, -41, -96, -96, -96, -96, + -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, + -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, + -96, -96, -5, -96, -96, -96, -96, 115, -96, -96, + -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, + -96, -96, 161, -96, 177, 167, 151, 178, -96, 73, + 67, 63, 57, 60, -96, -96, -96, -96, -96, -96, + -96, -96, 160, -96, 152, -96, 189, -96, -96, 154, + -96, 56, -96, -96, 61, -96, 43, -96, 46, -96, + 48, -96, 164, -96, 187, 188, -96, -96, 181, -96, + -96, -96, -96, -96, -96, 175, -96, -20, 65, -96, + -96, 69, -96, 32, -96, 36, -96, 42, -96, -96, + -49, -96, -96, 55, -96, -96, 35, -96, 30, -96, + 52, -96, 53, -96, -96, -96, -96, -96, -96, 50, + -96, -96, -96, -96, -96, 131, 132, -96, -96, -96, + -96, -96, 129, -96, -96, 38, -96, -96, -96, 39, + -96, -12, 92, -96, 97, -96, -96, 34, -96, 40, + -96, -96, -96, -96, -96, 29, -96, -96, -96, -96, + -96, -96, 87, -96, -96, -96, -96, -96, -7, -96, + -96, -96, -96, -96, -77, -96, 0, -96, -73, -96, + -96, -96, -96, -42, -96, -96, -69, -96, -96, -96, + -96, -96, -96, -72, -96, -96, -24, -96, -96, -96, + -29, -96, -96, -96, -96, 26, -96, 28, -96, 25, + -96, 14, -96, -96, -96, -96, -96, -96, 8, -96, + -96, -53, -96, -96, -96, -96, 2, -96, 7, -96, + 1, -96, -96, -96, -96, -96, -96, -96, -96, -96, + -96, -96, -96, -96, 45, -96, -96, -6, 4, -96, + -2, -96, -96}; const int JavaScriptGrammar::action_info [] = { - 296, 261, 305, -51, 298, 276, 300, 17, 316, 296, - 18, 106, 104, 106, 76, 416, 316, 255, 76, 352, - 256, 16, -39, 335, -210, 344, 310, 337, 329, 324, - 8, 146, 308, 298, 192, 401, 346, 324, 339, 322, - 403, 393, 347, 7, 391, 349, 356, 496, -41, 440, - 471, 408, 449, 477, 436, 442, 240, 152, 453, 154, - 471, 399, 185, 188, 436, 176, 170, 462, 196, 194, - 444, 193, 189, 443, -59, 192, 457, -40, 420, 426, - 195, 427, 420, 170, 412, 457, 104, 453, 420, 449, - 436, -62, 350, -64, 343, 352, 261, 412, -211, 436, - 423, 146, 146, 146, 146, 350, 439, 331, 188, 472, - 146, 146, 430, 146, 146, -279, 411, 410, 12, 276, - 440, 146, 63, 253, 252, 146, 0, 63, 172, 251, - 250, 8, 173, 64, 146, 0, 2, 63, 64, 8, - 2, 246, 245, 12, -1, 424, 146, 0, 64, 2, - 67, 2, 12, 481, 354, 451, 455, 473, 69, 465, - 332, 68, 414, 341, 318, 243, 495, 63, 319, 147, - 253, 252, 488, 183, 69, 178, 260, 259, 64, 90, - 489, 91, 248, 146, 248, 0, 314, 471, 243, 69, - 13, 3, 92, 0, 179, 3, 406, 244, 242, 239, - 238, 0, 0, 70, 3, 146, 3, 108, 2, 71, - 178, 0, 466, 464, 249, 247, 249, 247, 0, 70, - 244, 242, 78, 79, 0, 71, 109, 0, 110, 179, - 0, 180, 278, 279, 70, 0, 434, 433, 78, 79, - 71, 278, 279, 0, 283, 284, 0, 0, 0, 80, - 81, 0, 0, 285, 0, 0, 286, 258, 287, 280, - 281, 283, 284, 3, 0, 80, 81, 0, 280, 281, - 285, 283, 284, 286, 0, 287, 0, 0, 283, 284, - 285, 0, 0, 286, 90, 287, 91, 285, 0, 0, - 286, 0, 287, 83, 84, 0, 0, 92, 0, 0, - 0, 85, 86, 83, 84, 87, 0, 88, 0, 0, - 0, 85, 86, 83, 84, 87, 0, 88, 0, 0, - 0, 85, 86, 83, 84, 87, 0, 88, 0, 0, - 0, 85, 86, 0, 0, 87, 0, 88, 0, 0, - 83, 84, 0, 0, 0, 0, 283, 284, 85, 86, - 0, 0, 87, 0, 88, 285, 0, 0, 286, 0, - 287, 40, 41, 0, 0, 0, 0, 0, 0, 0, - 0, 43, 0, 0, 0, 0, 0, 0, 44, 0, - 0, 0, 45, 46, 0, 47, 0, 40, 41, 0, - 0, 0, 50, 0, 0, 0, 53, 43, 0, 0, - 0, 0, 0, 0, 44, 0, 0, 0, 45, 46, - 157, 47, 0, 0, 56, 0, 57, 0, 50, 0, - 158, 0, 53, 0, 159, 0, 0, 52, 59, 42, - 0, 0, 0, 160, 0, 161, 0, 0, 0, 0, - 56, 0, 57, 0, 0, 0, 162, 0, 163, 67, - 0, 0, 157, 52, 59, 42, 164, 0, 0, 165, - 68, 0, 158, 0, 0, 166, 159, 0, 0, 0, - 0, 167, 0, 0, 0, 160, 0, 161, 0, 0, - 312, 0, 0, 0, 168, 0, 0, 0, 162, 0, - 163, 67, 0, 0, 157, 0, 0, 0, 164, 0, - 0, 165, 68, 0, 158, 0, 0, 166, 159, 0, - 0, 0, 0, 167, 0, 0, 0, 160, 0, 161, - 0, 0, 0, 0, 0, 0, 168, 0, 0, 0, - 162, 0, 163, 67, 0, 0, 0, 0, 0, 0, - 164, 0, 0, 165, 68, 0, 0, 0, 0, 166, - 0, 0, 0, 0, 0, 167, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 168, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 39, 40, - 41, 0, 0, 0, 0, 0, 0, 0, 0, 43, - 0, 0, 0, 0, 0, 0, 44, 0, 0, 0, - 45, 46, 0, 47, 0, 0, 0, 48, 0, 49, - 50, 51, 0, 0, 53, 0, 0, 0, 54, 0, - 55, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 56, 0, 57, 0, 58, 0, 60, 0, - 61, 0, 0, 0, 0, 52, 59, 42, 0, 0, - 0, 0, 0, 0, 39, 40, 41, 0, 0, 0, - 0, 0, 0, 0, 0, 43, 0, 0, 0, 0, - 0, 0, 44, 0, 0, 0, 45, 46, 0, 47, - 0, 0, 0, 48, 0, 49, 50, 51, 0, 0, - 53, 0, 0, 0, 54, 0, 55, 0, 0, 476, - 0, 0, 0, 0, 0, 0, 0, 0, 56, 0, - 57, 0, 58, 0, 60, 0, 61, 0, 0, 0, - 0, 52, 59, 42, 0, 0, 0, 0, 0, 0, - 39, 40, 41, 0, 0, 0, 0, 0, 0, 0, - 0, 43, 0, 0, 0, 0, 0, 0, 44, 0, - 0, 0, 45, 46, 0, 47, 0, 0, 0, 48, - 0, 49, 50, 51, 0, 0, 53, 0, 0, 0, - 54, 0, 55, 0, 0, 479, 0, 0, 0, 0, - 0, 0, 0, 0, 56, 0, 57, 0, 58, 0, - 60, 0, 61, 0, 0, 0, 0, 52, 59, 42, - 0, 0, 0, 0, 0, 0, -60, 0, 0, 0, - 39, 40, 41, 0, 0, 0, 0, 0, 0, 0, - 0, 43, 0, 0, 0, 0, 0, 0, 44, 0, - 0, 0, 45, 46, 0, 47, 0, 0, 0, 48, - 0, 49, 50, 51, 0, 0, 53, 0, 0, 0, - 54, 0, 55, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 56, 0, 57, 0, 58, 0, - 60, 0, 61, 0, 0, 0, 0, 52, 59, 42, - 0, 0, 0, 0, 0, 0, 39, 40, 41, 0, - 0, 0, 0, 0, 0, 0, 0, 43, 0, 0, - 0, 0, 0, 0, 44, 0, 0, 0, 45, 46, - 0, 47, 0, 0, 0, 48, 0, 49, 50, 51, - 0, 0, 53, 0, 0, 0, 54, 0, 55, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 56, 0, 57, 0, 58, 0, 60, 275, 61, 0, - 0, 0, 0, 52, 59, 42, 0, 0, 0, 0, - 0, 0, 113, 114, 115, 0, 0, 117, 119, 120, - 0, 0, 121, 0, 122, 0, 0, 0, 124, 125, - 126, 0, 0, 0, 0, 0, 0, 127, 128, 129, - 130, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 131, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 134, 0, 0, - 0, 0, 0, 0, 135, 136, 137, 0, 139, 140, - 141, 142, 143, 144, 0, 0, 132, 138, 123, 116, - 118, 133, 0, 0, 0, 113, 114, 115, 0, 0, - 117, 119, 120, 0, 0, 121, 0, 122, 0, 0, - 0, 124, 125, 126, 0, 0, 0, 0, 0, 0, - 395, 128, 129, 130, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 131, 0, 0, 0, 396, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 134, 0, 0, 0, 0, 0, 398, 135, 136, 137, - 0, 139, 140, 141, 142, 143, 144, 0, 0, 132, - 138, 123, 116, 118, 133, 0, 0, 0, 113, 114, - 115, 0, 0, 117, 119, 120, 0, 0, 121, 0, - 122, 0, 0, 0, 124, 125, 126, 0, 0, 0, - 0, 0, 0, 395, 128, 129, 130, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 131, 0, 0, - 0, 396, 0, 0, 0, 0, 0, 0, 0, 397, - 0, 0, 0, 134, 0, 0, 0, 0, 0, 398, - 135, 136, 137, 0, 139, 140, 141, 142, 143, 144, - 0, 0, 132, 138, 123, 116, 118, 133, 0, 0, - 0, 215, 0, 0, 0, 0, 217, 0, 39, 40, - 41, 219, 0, 0, 0, 0, 0, 0, 220, 43, - 0, 0, 0, 0, 0, 0, 491, 223, 0, 0, - 224, 492, 0, 47, 0, 0, 0, 48, 0, 49, - 50, 51, 0, 0, 53, 0, 0, 0, 54, 0, - 55, 0, 0, 0, 0, 0, 225, 0, 226, 0, - 0, 0, 56, 227, 57, 228, 58, 229, 60, 230, - 61, 231, 232, 0, 0, 52, 59, 42, 216, 218, - 0, 0, 0, 0, 215, 0, 0, 0, 0, 217, - 0, 39, 40, 41, 219, 0, 0, 0, 0, 0, - 0, 220, 43, 0, 0, 0, 0, 0, 0, 222, - 223, 0, 0, 224, 46, 0, 47, 0, 0, 0, - 48, 0, 49, 50, 51, 0, 0, 53, 0, 0, - 0, 54, 0, 55, 0, 0, 0, 0, 0, 225, - 0, 226, 0, 0, 0, 56, 227, 57, 228, 58, - 229, 60, 230, 61, 231, 232, 0, 0, 52, 59, - 42, 216, 218, 0, 0, 0, 0, 215, 0, 0, - 0, 0, 217, 0, 39, 40, 41, 219, 0, 0, - 0, 0, 0, 0, 220, 221, 0, 0, 0, 0, - 0, 0, 222, 223, 0, 0, 224, 46, 0, 47, - 0, 0, 0, 48, 0, 49, 50, 51, 0, 0, - 53, 0, 0, 0, 54, 0, 55, 0, 0, 0, - 0, 0, 225, 0, 226, 0, 0, 0, 56, 227, - 57, 228, 58, 229, 60, 230, 61, 231, 232, 0, - 0, 52, 59, 42, 216, 218, 0, 0, 0, 0, - 365, 114, 115, 0, 0, 367, 119, 369, 40, 41, - 370, 0, 122, 0, 0, 0, 124, 372, 373, 0, - 0, 0, 0, 0, 0, 374, 375, 129, 130, 224, - 46, 0, 47, 0, 0, 0, 48, 0, 49, 376, - 51, 0, 0, 378, 0, 0, 0, 54, 0, 55, - 0, -206, 0, 0, 0, 379, 0, 226, 0, 0, - 0, 380, 381, 382, 383, 58, 385, 386, 387, 388, - 389, 390, 0, 0, 377, 384, 371, 366, 368, 133, - 0, 0, 0, + 409, 304, 282, 397, -64, -215, 407, 358, 267, -56, + -44, 353, 345, 314, 362, 328, 335, 302, 316, 152, + 355, 322, 352, 198, 343, 350, 459, -46, -45, 82, + 468, 158, 110, 330, 449, 112, 24, 450, 23, 442, + 8, 7, 3, 502, 463, 17, 483, 22, 477, 442, + 322, 477, 405, 448, -216, 414, -67, -69, 455, 442, + 418, 194, 176, 422, 446, 432, 433, 160, 426, 426, + 426, 198, 82, 195, 199, 200, 112, 282, 3, 356, + 442, 349, 176, 302, 463, 182, 356, 262, 341, 267, + 358, 191, 399, 201, 418, 436, 152, 455, 459, 152, + 202, 445, 152, 429, 337, 110, 152, 152, 0, 0, + 304, 246, 17, 261, 69, 446, 12, 152, 152, 194, + 494, 12, 152, 0, 17, 70, -284, 478, 495, 311, + 257, 256, 178, 324, 252, 251, 179, 325, 259, 258, + 69, 69, 259, 258, 152, 73, 417, 416, 430, 152, + 152, 70, 70, 12, 264, 152, 74, 338, 360, 420, + 75, 249, 69, 10, 9, 266, 265, 254, 75, 347, + 487, 13, 306, 70, 320, 479, 13, 96, 96, 97, + 97, 0, 96, 96, 97, 97, 152, 0, 184, 249, + 98, 98, 189, 250, 248, 98, 98, 254, 12, 255, + 253, 461, 457, 153, 96, 76, 97, 185, 13, 412, + 96, 77, 97, 76, 96, 12, 97, 98, 96, 77, + 97, 250, 248, 98, 471, 501, 152, 98, 114, 255, + 253, 98, 96, 96, 97, 97, 477, 75, 0, 440, + 439, 20, 96, 0, 97, 98, 98, 115, 96, 116, + 97, 0, 184, 13, 96, 98, 97, 12, 284, 285, + 0, 98, 284, 285, 0, 0, 0, 98, 0, 0, + 13, 185, 0, 186, 0, 0, 0, 472, 470, 245, + 244, 0, 76, 289, 290, 286, 287, 0, 77, 286, + 287, 0, 291, 289, 290, 292, 0, 293, 0, 289, + 290, 0, 291, 0, 0, 292, 0, 293, 291, 289, + 290, 292, 13, 293, 0, 289, 290, 0, 291, 0, + 0, 292, 0, 293, 291, 84, 85, 292, 0, 293, + 0, 0, 0, 46, 47, 0, 0, 0, 0, 0, + 0, 0, 0, 49, 0, 0, 0, 0, 0, 0, + 50, 0, 86, 87, 51, 52, 0, 53, 0, 46, + 47, 0, 0, 0, 56, 0, 0, 0, 59, 49, + 0, 0, 0, 0, 0, 0, 50, 0, 0, 0, + 51, 52, 0, 53, 0, 0, 62, 0, 63, 0, + 56, 0, 163, 0, 59, 89, 90, 0, 0, 58, + 65, 48, 164, 91, 92, 0, 165, 93, 0, 94, + 0, 0, 62, 0, 63, 166, 0, 167, 0, 0, + 318, 0, 0, 0, 0, 58, 65, 48, 168, 0, + 169, 73, 0, 0, 0, 0, 0, 0, 170, 0, + 0, 171, 74, 0, 0, 0, 0, 172, 0, 0, + 0, 0, 0, 173, 0, 0, 0, 0, 0, 0, + 163, 0, 0, 0, 0, 0, 174, 0, 0, 0, + 164, 0, 0, 0, 165, 0, 0, 0, 0, 0, + 0, 0, 0, 166, 0, 167, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 168, 0, 169, 73, + 0, 0, 0, 0, 0, 0, 170, 0, 0, 171, + 74, 0, 0, 0, 0, 172, 0, 0, 0, 0, + 0, 173, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 174, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 45, 46, 47, 0, 0, + 0, 0, 0, 0, 0, 0, 49, 0, 0, 0, + 0, 0, 0, 50, 0, 0, 0, 51, 52, 0, + 53, 0, 0, 0, 54, 0, 55, 56, 57, 0, + 0, 59, 0, 0, 0, 60, 0, 61, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, + 0, 63, 0, 64, 0, 66, 0, 67, 0, 0, + 0, 0, 58, 65, 48, 0, 0, 0, 0, 0, + 0, 0, 45, 46, 47, 0, 0, 0, 0, 0, + 0, 0, 0, 49, 0, 0, 0, 0, 0, 0, + 50, 0, 0, 0, 51, 52, 0, 53, 0, 0, + 0, 54, 0, 55, 56, 57, 0, 0, 59, 0, + 0, 0, 60, 0, 61, 0, 0, 482, 0, 0, + 0, 0, 0, 0, 0, 0, 62, 0, 63, 0, + 64, 0, 66, 0, 67, 0, 0, 0, 0, 58, + 65, 48, 0, 0, 0, 0, 0, 0, 0, -65, + 0, 0, 0, 45, 46, 47, 0, 0, 0, 0, + 0, 0, 0, 0, 49, 0, 0, 0, 0, 0, + 0, 50, 0, 0, 0, 51, 52, 0, 53, 0, + 0, 0, 54, 0, 55, 56, 57, 0, 0, 59, + 0, 0, 0, 60, 0, 61, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 62, 0, 63, + 0, 64, 0, 66, 0, 67, 0, 0, 0, 0, + 58, 65, 48, 0, 0, 0, 0, 0, 0, 0, + 45, 46, 47, 0, 0, 0, 0, 0, 0, 0, + 0, 49, 0, 0, 0, 0, 0, 0, 50, 0, + 0, 0, 51, 52, 0, 53, 0, 0, 0, 54, + 0, 55, 56, 57, 0, 0, 59, 0, 0, 0, + 60, 0, 61, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 62, 0, 63, 0, 64, 0, + 66, 281, 67, 0, 0, 0, 0, 58, 65, 48, + 0, 0, 0, 0, 0, 0, 0, 45, 46, 47, + 0, 0, 0, 0, 0, 0, 0, 0, 49, 0, + 0, 0, 0, 0, 0, 50, 0, 0, 0, 51, + 52, 0, 53, 0, 0, 0, 54, 0, 55, 56, + 57, 0, 0, 59, 0, 0, 0, 60, 0, 61, + 0, 0, 485, 0, 0, 0, 0, 0, 0, 0, + 0, 62, 0, 63, 0, 64, 0, 66, 0, 67, + 0, 0, 0, 0, 58, 65, 48, 0, 0, 0, + 0, 0, 0, 0, 119, 120, 121, 0, 0, 123, + 125, 126, 0, 0, 127, 0, 128, 0, 0, 0, + 130, 131, 132, 0, 0, 0, 0, 0, 0, 133, + 134, 135, 136, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 137, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 140, + 0, 0, 0, 0, 0, 0, 141, 142, 143, 0, + 145, 146, 147, 148, 149, 150, 0, 0, 138, 144, + 129, 122, 124, 139, 0, 0, 0, 0, 119, 120, + 121, 0, 0, 123, 125, 126, 0, 0, 127, 0, + 128, 0, 0, 0, 130, 131, 132, 0, 0, 0, + 0, 0, 0, 401, 134, 135, 136, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 137, 0, 0, + 0, 402, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 140, 0, 0, 0, 0, 0, 404, + 141, 142, 143, 0, 145, 146, 147, 148, 149, 150, + 0, 0, 138, 144, 129, 122, 124, 139, 0, 0, + 0, 0, 119, 120, 121, 0, 0, 123, 125, 126, + 0, 0, 127, 0, 128, 0, 0, 0, 130, 131, + 132, 0, 0, 0, 0, 0, 0, 401, 134, 135, + 136, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 137, 0, 0, 0, 402, 0, 0, 0, 0, + 0, 0, 0, 403, 0, 0, 0, 140, 0, 0, + 0, 0, 0, 404, 141, 142, 143, 0, 145, 146, + 147, 148, 149, 150, 0, 0, 138, 144, 129, 122, + 124, 139, 0, 0, 0, 0, 221, 0, 0, 0, + 0, 223, 0, 45, 46, 47, 225, 0, 0, 0, + 0, 0, 0, 226, 49, 0, 0, 0, 0, 0, + 0, 497, 229, 0, 0, 230, 498, 0, 53, 0, + 0, 0, 54, 0, 55, 56, 57, 0, 0, 59, + 0, 0, 0, 60, 0, 61, 0, 0, 0, 0, + 0, 231, 0, 232, 0, 0, 0, 62, 233, 63, + 234, 64, 235, 66, 236, 67, 237, 238, 0, 0, + 58, 65, 48, 222, 224, 0, 0, 0, 0, 0, + 221, 0, 0, 0, 0, 223, 0, 45, 46, 47, + 225, 0, 0, 0, 0, 0, 0, 226, 49, 0, + 0, 0, 0, 0, 0, 228, 229, 0, 0, 230, + 52, 0, 53, 0, 0, 0, 54, 0, 55, 56, + 57, 0, 0, 59, 0, 0, 0, 60, 0, 61, + 0, 0, 0, 0, 0, 231, 0, 232, 0, 0, + 0, 62, 233, 63, 234, 64, 235, 66, 236, 67, + 237, 238, 0, 0, 58, 65, 48, 222, 224, 0, + 0, 0, 0, 0, 221, 0, 0, 0, 0, 223, + 0, 45, 46, 47, 225, 0, 0, 0, 0, 0, + 0, 226, 227, 0, 0, 0, 0, 0, 0, 228, + 229, 0, 0, 230, 52, 0, 53, 0, 0, 0, + 54, 0, 55, 56, 57, 0, 0, 59, 0, 0, + 0, 60, 0, 61, 0, 0, 0, 0, 0, 231, + 0, 232, 0, 0, 0, 62, 233, 63, 234, 64, + 235, 66, 236, 67, 237, 238, 0, 0, 58, 65, + 48, 222, 224, 0, 0, 0, 0, 0, 371, 120, + 121, 0, 0, 373, 125, 375, 46, 47, 376, 0, + 128, 0, 0, 0, 130, 378, 379, 0, 0, 0, + 0, 0, 0, 380, 381, 135, 136, 230, 52, 0, + 53, 0, 0, 0, 54, 0, 55, 382, 57, 0, + 0, 384, 0, 0, 0, 60, 0, 61, 0, -211, + 0, 0, 0, 385, 0, 232, 0, 0, 0, 386, + 387, 388, 389, 64, 391, 392, 393, 394, 395, 396, + 0, 0, 383, 390, 377, 372, 374, 139, 0, 0, + 0, 0, - 338, 421, 450, 452, 177, 454, 480, 446, 441, 148, - 431, 428, 182, 425, 445, 333, 156, 254, 456, 14, - 315, 15, 313, 494, 10, 493, 311, 467, 435, 435, - 490, 213, 475, 155, 413, 27, 345, 432, 0, 463, - 474, 306, 0, 306, 342, 478, 175, 432, 151, 254, - 400, 353, 392, 355, 357, 169, 394, 402, 153, 145, - 351, 0, 112, 340, 257, 0, 306, 0, 404, 306, - 0, 405, 0, 65, 0, 213, 0, 93, 213, 65, - 0, 0, 65, 94, 65, 65, 95, 429, 65, 288, - 65, 65, 65, 97, 65, 96, 98, 99, 65, 171, - 65, 65, 186, 100, 107, 65, 65, 336, 66, 151, - 309, 289, 65, 105, 448, 65, 407, 65, 306, 447, - 290, 65, 65, 487, 484, 65, 65, 73, 112, 181, - 151, 65, 82, 186, 65, 306, 404, 184, 270, 405, - 65, 0, 77, 274, 65, 292, 74, 65, 65, 483, - 65, 65, 482, 291, 0, 65, 89, 448, 348, 334, - 241, 65, 65, 447, 485, 65, 65, 65, 65, 0, - 75, 103, 102, 65, 65, 72, 307, 65, 302, 0, - 101, 0, 274, 274, 174, 0, 65, 302, 302, 302, - 297, 274, 274, 274, 274, 277, 65, 302, 65, 65, - 304, 274, 274, 274, 274, 0, 294, 299, 0, 323, - 301, 321, 65, 317, 0, 65, 65, 274, 0, 330, - 274, 274, 282, 293, 0, 65, 0, 0, 0, 320, - 274, 0, 295, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 65, 0, 486, 0, 0, 0, 0, 0, + 437, 499, 181, 419, 21, 263, 500, 427, 431, 486, + 435, 19, 183, 441, 447, 438, 21, 481, 484, 480, + 473, 312, 33, 462, 469, 451, 260, 434, 21, 11, + 452, 188, 219, 162, 161, 460, 456, 458, 118, 351, + 359, 344, 441, 151, 357, 406, 346, 175, 312, 438, + 398, 348, 317, 159, 496, 339, 319, 321, 400, 408, + 157, 361, 363, 154, 219, 0, 312, 219, 71, 0, + 0, 312, 99, 0, 0, 312, 71, 0, 454, 312, + 0, 71, 0, 0, 71, 101, 71, 71, 0, 297, + 71, 71, 298, 410, 71, 296, 411, 71, 111, 295, + 71, 113, 106, 157, 71, 294, 71, 313, 100, 71, + 413, 490, 315, 71, 83, 80, 340, 71, 71, 71, + 342, 453, 105, 71, 71, 488, 454, 71, 71, 79, + 78, 71, 177, 71, 72, 453, 71, 71, 493, 0, + 81, 260, 276, 71, 354, 491, 71, 280, 492, 71, + 410, 489, 247, 411, 71, 71, 0, 71, 71, 95, + 192, 109, 103, 71, 157, 71, 71, 71, 104, 192, + 102, 190, 107, 71, 71, 0, 71, 0, 71, 71, + 88, 308, 108, 280, 280, 300, 280, 71, 71, 180, + 305, 71, 280, 280, 71, 0, 280, 283, 0, 280, + 303, 299, 308, 310, 71, 71, 323, 280, 308, 280, + 280, 288, 301, 280, 71, 308, 308, 0, 0, 280, + 280, 280, 0, 0, 336, 0, 0, 0, 118, 187, + 329, 326, 0, 0, 0, 0, 0, 327, 307, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0}; + 0, 0, 0, 0, 0}; const int JavaScriptGrammar::action_check [] = { - 48, 36, 61, 7, 76, 1, 8, 29, 2, 48, - 7, 76, 48, 76, 1, 33, 2, 74, 1, 36, - 36, 29, 7, 61, 29, 36, 60, 60, 17, 29, - 33, 8, 61, 76, 29, 55, 60, 29, 31, 7, - 55, 8, 33, 0, 7, 55, 16, 29, 7, 20, - 8, 60, 36, 8, 33, 36, 55, 8, 36, 60, - 8, 7, 60, 29, 33, 7, 2, 17, 33, 29, - 60, 8, 36, 29, 7, 29, 29, 7, 5, 55, - 60, 7, 5, 2, 36, 29, 48, 36, 5, 36, - 33, 7, 7, 7, 29, 36, 36, 36, 29, 33, - 10, 8, 8, 8, 8, 7, 6, 8, 29, 8, - 8, 8, 7, 8, 8, 36, 61, 62, 8, 1, - 20, 8, 40, 61, 62, 8, -1, 40, 50, 61, - 62, 33, 54, 51, 8, -1, 29, 40, 51, 33, - 29, 61, 62, 8, 0, 55, 8, -1, 51, 29, - 42, 29, 8, 60, 60, 60, 60, 56, 12, 8, - 61, 53, 60, 60, 50, 29, 56, 40, 54, 56, - 61, 62, 7, 56, 12, 15, 61, 62, 51, 25, - 15, 27, 29, 8, 29, -1, 60, 8, 29, 12, - 55, 84, 38, -1, 34, 84, 36, 61, 62, 61, - 62, -1, -1, 57, 84, 8, 84, 15, 29, 63, - 15, -1, 61, 62, 61, 62, 61, 62, -1, 57, - 61, 62, 18, 19, -1, 63, 34, -1, 36, 34, - -1, 36, 18, 19, 57, -1, 61, 62, 18, 19, - 63, 18, 19, -1, 23, 24, -1, -1, -1, 45, - 46, -1, -1, 32, -1, -1, 35, 60, 37, 45, - 46, 23, 24, 84, -1, 45, 46, -1, 45, 46, - 32, 23, 24, 35, -1, 37, -1, -1, 23, 24, - 32, -1, -1, 35, 25, 37, 27, 32, -1, -1, - 35, -1, 37, 23, 24, -1, -1, 38, -1, -1, - -1, 31, 32, 23, 24, 35, -1, 37, -1, -1, - -1, 31, 32, 23, 24, 35, -1, 37, -1, -1, - -1, 31, 32, 23, 24, 35, -1, 37, -1, -1, - -1, 31, 32, -1, -1, 35, -1, 37, -1, -1, - 23, 24, -1, -1, -1, -1, 23, 24, 31, 32, - -1, -1, 35, -1, 37, 32, -1, -1, 35, -1, - 37, 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, 12, 13, -1, - -1, -1, 43, -1, -1, -1, 47, 22, -1, -1, - -1, -1, -1, -1, 29, -1, -1, -1, 33, 34, - 3, 36, -1, -1, 65, -1, 67, -1, 43, -1, - 13, -1, 47, -1, 17, -1, -1, 78, 79, 80, - -1, -1, -1, 26, -1, 28, -1, -1, -1, -1, - 65, -1, 67, -1, -1, -1, 39, -1, 41, 42, - -1, -1, 3, 78, 79, 80, 49, -1, -1, 52, - 53, -1, 13, -1, -1, 58, 17, -1, -1, -1, - -1, 64, -1, -1, -1, 26, -1, 28, -1, -1, - 31, -1, -1, -1, 77, -1, -1, -1, 39, -1, - 41, 42, -1, -1, 3, -1, -1, -1, 49, -1, - -1, 52, 53, -1, 13, -1, -1, 58, 17, -1, - -1, -1, -1, 64, -1, -1, -1, 26, -1, 28, - -1, -1, -1, -1, -1, -1, 77, -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, 11, 12, - 13, -1, -1, -1, -1, -1, -1, -1, -1, 22, + 55, 76, 1, 7, 7, 29, 55, 36, 36, 7, + 7, 33, 31, 61, 16, 7, 17, 48, 60, 8, + 55, 2, 60, 29, 60, 36, 36, 7, 7, 1, + 17, 8, 48, 29, 29, 76, 7, 60, 29, 33, + 65, 0, 85, 29, 29, 33, 8, 29, 8, 33, + 2, 8, 7, 36, 29, 60, 7, 7, 36, 33, + 36, 29, 2, 33, 20, 55, 7, 60, 5, 5, + 5, 29, 1, 36, 8, 29, 76, 1, 85, 7, + 33, 29, 2, 48, 29, 7, 7, 36, 61, 36, + 36, 60, 8, 60, 36, 7, 8, 36, 36, 8, + 33, 6, 8, 10, 8, 48, 8, 8, -1, -1, + 76, 55, 33, 74, 40, 20, 29, 8, 8, 29, + 7, 29, 8, -1, 33, 51, 36, 8, 15, 61, + 61, 62, 50, 50, 61, 62, 54, 54, 61, 62, + 40, 40, 61, 62, 8, 42, 61, 62, 55, 8, + 8, 51, 51, 29, 60, 8, 53, 61, 60, 60, + 12, 29, 40, 61, 62, 61, 62, 29, 12, 60, + 60, 84, 8, 51, 60, 56, 84, 25, 25, 27, + 27, -1, 25, 25, 27, 27, 8, -1, 15, 29, + 38, 38, 56, 61, 62, 38, 38, 29, 29, 61, + 62, 60, 60, 56, 25, 57, 27, 34, 84, 36, + 25, 63, 27, 57, 25, 29, 27, 38, 25, 63, + 27, 61, 62, 38, 8, 56, 8, 38, 15, 61, + 62, 38, 25, 25, 27, 27, 8, 12, -1, 61, + 62, 55, 25, -1, 27, 38, 38, 34, 25, 36, + 27, -1, 15, 84, 25, 38, 27, 29, 18, 19, + -1, 38, 18, 19, -1, -1, -1, 38, -1, -1, + 84, 34, -1, 36, -1, -1, -1, 61, 62, 61, + 62, -1, 57, 23, 24, 45, 46, -1, 63, 45, + 46, -1, 32, 23, 24, 35, -1, 37, -1, 23, + 24, -1, 32, -1, -1, 35, -1, 37, 32, 23, + 24, 35, 84, 37, -1, 23, 24, -1, 32, -1, + -1, 35, -1, 37, 32, 18, 19, 35, -1, 37, + -1, -1, -1, 12, 13, -1, -1, -1, -1, -1, + -1, -1, -1, 22, -1, -1, -1, -1, -1, -1, + 29, -1, 45, 46, 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, -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, 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, - 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, 7, -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, -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, 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, -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, 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, 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, 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, 4, 5, + 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, 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, 55, + -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, 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, 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, @@ -569,55 +575,46 @@ const int JavaScriptGrammar::action_check [] = { -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, 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, - 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, + 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, - 6, 81, 7, 6, 13, 7, 7, 51, 83, 13, - 66, 66, 7, 78, 51, 72, 47, 6, 6, 3, - 6, 3, 7, 1, 1, 4, 6, 70, 51, 51, - 6, 6, 13, 4, 7, 7, 85, 7, -1, 13, - 9, 7, -1, 7, 6, 13, 13, 7, 13, 6, - 13, 7, 13, 6, 6, 13, 15, 6, 13, 7, - 6, -1, 16, 7, 7, -1, 7, -1, 18, 7, - -1, 21, -1, 24, -1, 6, -1, 28, 6, 24, - -1, -1, 24, 28, 24, 24, 28, 7, 24, 29, - 24, 24, 24, 29, 24, 29, 29, 29, 24, 38, - 24, 24, 26, 29, 34, 24, 24, 48, 27, 13, - 48, 29, 24, 36, 26, 24, 20, 24, 7, 26, - 29, 24, 24, 26, 26, 24, 24, 26, 16, 17, - 13, 24, 30, 26, 24, 7, 18, 20, 24, 21, - 24, -1, 32, 29, 24, 29, 26, 24, 24, 26, - 24, 24, 26, 29, -1, 24, 29, 26, 86, 48, - 91, 24, 24, 26, 26, 24, 24, 24, 24, -1, - 27, 30, 30, 24, 24, 26, 48, 24, 24, -1, - 30, -1, 29, 29, 40, -1, 24, 24, 24, 24, - 37, 29, 29, 29, 29, 33, 24, 24, 24, 24, - 46, 29, 29, 29, 29, -1, 31, 35, -1, 46, - 46, 46, 24, 39, -1, 24, 24, 29, -1, 46, - 29, 29, 31, 31, -1, 24, -1, -1, -1, 41, - 29, -1, 31, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 24, -1, 26, -1, -1, -1, -1, -1, + 69, 7, 16, 10, 6, 10, 2, 84, 81, 10, + 10, 2, 16, 54, 86, 10, 6, 16, 16, 12, + 73, 10, 10, 9, 16, 54, 9, 69, 6, 5, + 54, 10, 9, 50, 7, 10, 10, 9, 19, 88, + 10, 9, 54, 10, 9, 16, 10, 16, 10, 10, + 16, 9, 9, 16, 9, 75, 10, 9, 18, 9, + 16, 9, 9, 16, 9, -1, 10, 9, 27, -1, + -1, 10, 31, -1, -1, 10, 27, -1, 29, 10, + -1, 27, -1, -1, 27, 31, 27, 27, -1, 32, + 27, 27, 32, 21, 27, 32, 24, 27, 39, 32, + 27, 37, 32, 16, 27, 32, 27, 51, 31, 27, + 23, 29, 51, 27, 35, 29, 51, 27, 27, 27, + 51, 29, 32, 27, 27, 29, 29, 27, 27, 29, + 29, 27, 41, 27, 30, 29, 27, 27, 29, -1, + 30, 9, 27, 27, 89, 29, 27, 32, 29, 27, + 21, 29, 94, 24, 27, 27, -1, 27, 27, 32, + 29, 33, 32, 27, 16, 27, 27, 27, 32, 29, + 32, 23, 33, 27, 27, -1, 27, -1, 27, 27, + 33, 27, 33, 32, 32, 34, 32, 27, 27, 43, + 38, 27, 32, 32, 27, -1, 32, 36, -1, 32, + 40, 34, 27, 49, 27, 27, 42, 32, 27, 32, + 32, 34, 34, 32, 27, 27, 27, -1, -1, 32, + 32, 32, -1, -1, 49, -1, -1, -1, 19, 20, + 49, 44, -1, -1, -1, -1, -1, 49, 49, -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, -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 3cc3307..6f2debf 100644 --- a/src/declarative/qml/parser/javascriptgrammar_p.h +++ b/src/declarative/qml/parser/javascriptgrammar_p.h @@ -7,8 +7,8 @@ class JavaScriptGrammar public: enum { EOF_SYMBOL = 0, - REDUCE_HERE = 86, - SHIFT_THERE = 85, + REDUCE_HERE = 87, + SHIFT_THERE = 86, T_AND = 1, T_AND_AND = 2, T_AND_EQ = 3, @@ -43,6 +43,7 @@ public: T_GT_GT_GT_EQ = 28, T_IDENTIFIER = 29, T_IF = 30, + T_IMPORT = 85, T_IN = 31, T_INSTANCEOF = 32, T_LBRACE = 33, @@ -95,14 +96,14 @@ public: T_XOR_EQ = 77, ACCEPT_STATE = 7, - RULE_COUNT = 283, - STATE_COUNT = 497, - TERMINAL_COUNT = 87, - NON_TERMINAL_COUNT = 93, + RULE_COUNT = 288, + STATE_COUNT = 503, + TERMINAL_COUNT = 88, + NON_TERMINAL_COUNT = 96, - GOTO_INDEX_OFFSET = 497, - GOTO_INFO_OFFSET = 1543, - GOTO_CHECK_OFFSET = 1543 + GOTO_INDEX_OFFSET = 503, + GOTO_INFO_OFFSET = 1522, + GOTO_CHECK_OFFSET = 1522 }; static const char *const spell []; diff --git a/src/declarative/qml/parser/javascriptlexer.cpp b/src/declarative/qml/parser/javascriptlexer.cpp index 58d8c53..e1c2960 100644 --- a/src/declarative/qml/parser/javascriptlexer.cpp +++ b/src/declarative/qml/parser/javascriptlexer.cpp @@ -287,6 +287,10 @@ int JavaScript::Lexer::findReservedWord(const QChar *c, int size) const && c[2] == QLatin1Char('p') && c[3] == QLatin1Char('e') && c[4] == QLatin1Char('o') && c[5] == QLatin1Char('f')) return JavaScriptGrammar::T_TYPEOF; + else if (c[0] == QLatin1Char('i') && c[1] == QLatin1Char('m') + && c[2] == QLatin1Char('p') && c[3] == QLatin1Char('o') + && c[4] == QLatin1Char('r') && c[5] == QLatin1Char('t')) + return JavaScriptGrammar::T_IMPORT; else if (check_reserved) { if (c[0] == QLatin1Char('e') && c[1] == QLatin1Char('x') && c[2] == QLatin1Char('p') && c[3] == QLatin1Char('o') diff --git a/src/declarative/qml/parser/javascriptparser.cpp b/src/declarative/qml/parser/javascriptparser.cpp index 7e95ec7..adcd8a3 100644 --- a/src/declarative/qml/parser/javascriptparser.cpp +++ b/src/declarative/qml/parser/javascriptparser.cpp @@ -163,27 +163,52 @@ bool JavaScriptParser::parse(JavaScriptEnginePrivate *driver) switch (r) { case 0: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).UiObjectMemberList->finish()); + sym(1).Node = makeAstNode (driver->nodePool(), sym(2).UiObjectMemberList->finish()); } break; case 2: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).UiObjectMember); + sym(1).Node = sym(1).UiImportList->finish(); +} break; + +case 3: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).UiImport); } break; -case 3: + case 4: { + sym(1).Node = makeAstNode (driver->nodePool(), + sym(1).UiImportList, sym(2).UiImport); +} break; + +case 6: { + AST::UiImport *node = makeAstNode(driver->nodePool(), sym(2).sval); + node->importToken = loc(1); + node->fileNameToken = loc(2); + node->semicolonToken = loc(3); + sym(1).Node = node; +} break; + +case 7: { + sym(1).Node = 0; +} break; + +case 8: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).UiObjectMember); +} break; + +case 9: { AST::UiObjectMemberList *node = makeAstNode (driver->nodePool(), - sym(1).UiObjectMemberList, sym(3).UiObjectMember); + sym(1).UiObjectMemberList, sym(2).UiObjectMember); sym(1).Node = node; } break; -case 5: { +case 10: { AST::UiObjectInitializer *node = makeAstNode (driver->nodePool(), sym(2).UiObjectMemberList->finish()); node->lbraceToken = loc(1); node->rbraceToken = loc(3); sym(1).Node = node; } break; -case 6: { +case 11: { AST::UiObjectBinding *node = makeAstNode (driver->nodePool(), sym(1).UiQualifiedId->finish(), sym(3).sval, sym(4).UiObjectInitializer); node->colonToken = loc(2); @@ -191,14 +216,14 @@ case 6: { sym(1).Node = node; } break; -case 7: { +case 12: { AST::UiObjectDefinition *node = makeAstNode (driver->nodePool(), sym(1).sval, sym(2).UiObjectInitializer); node->identifierToken = loc(1); sym(1).Node = node; } break; -case 8: { +case 13: { AST::UiArrayBinding *node = makeAstNode (driver->nodePool(), sym(1).UiQualifiedId->finish(), sym(4).UiObjectMemberList->finish()); node->colonToken = loc(2); @@ -207,14 +232,14 @@ case 8: { sym(1).Node = node; } break; -case 9: { +case 14: { AST::UiScriptBinding *node = makeAstNode (driver->nodePool(), sym(1).UiQualifiedId->finish(), sym(3).Statement); node->colonToken = loc(2); sym(1).Node = node; } break; -case 10: { +case 15: { AST::UiPublicMember *node = makeAstNode (driver->nodePool(), sym(2).sval, sym(3).sval, sym(5).Expression, sym(6).UiObjectInitializer); node->publicToken = loc(1); @@ -224,7 +249,7 @@ case 10: { sym(1).Node = node; } break; -case 11: { +case 16: { AST::UiPublicMember *node = makeAstNode (driver->nodePool(), sym(2).sval, sym(3).sval); node->publicToken = loc(1); node->attributeTypeToken = loc(2); @@ -232,7 +257,7 @@ case 11: { sym(1).Node = node; } break; -case 12: { +case 17: { AST::UiPublicMember *node = makeAstNode (driver->nodePool(), sym(2).sval, sym(3).sval, sym(5).Expression, static_cast(0)); node->publicToken = loc(1); @@ -242,61 +267,61 @@ case 12: { sym(1).Node = node; } break; -case 13: { +case 18: { AST::UiQualifiedId *node = makeAstNode (driver->nodePool(), sym(1).sval); node->identifierToken = loc(1); sym(1).Node = node; } break; -case 14: { +case 19: { AST::UiQualifiedId *node = makeAstNode (driver->nodePool(), sym(1).UiQualifiedId, sym(3).sval); node->identifierToken = loc(3); sym(1).Node = node; } break; -case 15: { +case 20: { AST::ThisExpression *node = makeAstNode (driver->nodePool()); node->thisToken = loc(1); sym(1).Node = node; } break; -case 16: { +case 21: { AST::IdentifierExpression *node = makeAstNode (driver->nodePool(), sym(1).sval); node->identifierToken = loc(1); sym(1).Node = node; } break; -case 17: { +case 22: { AST::NullExpression *node = makeAstNode (driver->nodePool()); node->nullToken = loc(1); sym(1).Node = node; } break; -case 18: { +case 23: { AST::TrueLiteral *node = makeAstNode (driver->nodePool()); node->trueToken = loc(1); sym(1).Node = node; } break; -case 19: { +case 24: { AST::FalseLiteral *node = makeAstNode (driver->nodePool()); node->falseToken = loc(1); sym(1).Node = node; } break; -case 20: { +case 25: { AST::NumericLiteral *node = makeAstNode (driver->nodePool(), sym(1).dval); node->literalToken = loc(1); sym(1).Node = node; } break; -case 21: { +case 26: { AST::StringLiteral *node = makeAstNode (driver->nodePool(), sym(1).sval); node->literalToken = loc(1); sym(1).Node = node; } break; -case 22: { +case 27: { bool rx = lexer->scanRegExp(Lexer::NoPrefix); if (!rx) { diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, lexer->startLineNo(), @@ -308,7 +333,7 @@ case 22: { sym(1).Node = node; } break; -case 23: { +case 28: { bool rx = lexer->scanRegExp(Lexer::EqualPrefix); if (!rx) { diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, lexer->startLineNo(), @@ -320,91 +345,81 @@ case 23: { sym(1).Node = node; } break; -case 24: { +case 29: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Elision); } break; -case 25: { +case 30: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).ElementList->finish ()); } break; -case 26: { +case 31: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).ElementList->finish (), sym(4).Elision); } break; -case 27: { +case 32: { if (sym(2).Node) sym(1).Node = makeAstNode (driver->nodePool(), sym(2).PropertyNameAndValueList->finish ()); else sym(1).Node = makeAstNode (driver->nodePool()); } break; -case 28: { +case 33: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).PropertyNameAndValueList->finish ()); } break; -case 29: { +case 34: { sym(1) = sym(2); } break; -case 30: { +case 35: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Elision, sym(2).Expression); } break; -case 31: { +case 36: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).ElementList, sym(3).Elision, sym(4).Expression); } break; -case 32: { +case 37: { sym(1).Node = makeAstNode (driver->nodePool()); } break; -case 33: { +case 38: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Elision); } break; -case 34: { +case 39: { sym(1).Node = 0; } break; -case 35: { +case 40: { sym(1).Elision = sym(1).Elision->finish (); } break; -case 36: { +case 41: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).PropertyName, sym(3).Expression); } break; -case 37: { +case 42: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).PropertyNameAndValueList, sym(3).PropertyName, sym(5).Expression); } break; -case 38: { +case 43: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).sval); } break; -case 39: { +case 44: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).sval); } break; -case 40: { +case 45: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).dval); } break; -case 41: { +case 46: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).sval); } break; -case 42: - -case 43: - -case 44: - -case 45: - -case 46: - case 47: case 48: @@ -456,22 +471,32 @@ case 70: case 71: case 72: + +case 73: + +case 74: + +case 75: + +case 76: + +case 77: { sym(1).sval = driver->intern(lexer->characterBuffer(), lexer->characterCount()); } break; -case 77: { +case 82: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression); } break; -case 78: { +case 83: { AST::FieldMemberExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).sval); node->dotToken = loc(2); node->identifierToken = loc(3); sym(1).Node = node; } break; -case 79: { +case 84: { AST::NewMemberExpression *node = makeAstNode (driver->nodePool(), sym(2).Expression, sym(4).ArgumentList); node->newToken = loc(1); node->lparenToken = loc(3); @@ -479,541 +504,541 @@ case 79: { sym(1).Node = node; } break; -case 81: { +case 86: { AST::NewExpression *node = makeAstNode (driver->nodePool(), sym(2).Expression); node->newToken = loc(1); sym(1).Node = node; } break; -case 82: { +case 87: { AST::CallExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).ArgumentList); node->lparenToken = loc(2); node->rparenToken = loc(4); sym(1).Node = node; } break; -case 83: { +case 88: { AST::CallExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).ArgumentList); node->lparenToken = loc(2); node->rparenToken = loc(4); sym(1).Node = node; } break; -case 84: { +case 89: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression); } break; -case 85: { +case 90: { AST::FieldMemberExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).sval); node->dotToken = loc(2); node->identifierToken = loc(3); sym(1).Node = node; } break; -case 86: { +case 91: { sym(1).Node = 0; } break; -case 87: { +case 92: { sym(1).Node = sym(1).ArgumentList->finish(); } break; -case 88: { +case 93: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression); } break; -case 89: { +case 94: { AST::ArgumentList *node = makeAstNode (driver->nodePool(), sym(1).ArgumentList, sym(3).Expression); node->commaToken = loc(2); sym(1).Node = node; } break; -case 93: { +case 98: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression); } break; -case 94: { +case 99: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression); } break; -case 96: { +case 101: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); } break; -case 97: { +case 102: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); } break; -case 98: { +case 103: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); } break; -case 99: { +case 104: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); } break; -case 100: { +case 105: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); } break; -case 101: { +case 106: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); } break; -case 102: { +case 107: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); } break; -case 103: { +case 108: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); } break; -case 104: { +case 109: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); } break; -case 106: { +case 111: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Mul, sym(3).Expression); } break; -case 107: { +case 112: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Div, sym(3).Expression); } break; -case 108: { +case 113: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Mod, sym(3).Expression); } break; -case 110: { +case 115: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Add, sym(3).Expression); } break; -case 111: { +case 116: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Sub, sym(3).Expression); } break; -case 113: { +case 118: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::LShift, sym(3).Expression); } break; -case 114: { +case 119: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::RShift, sym(3).Expression); } break; -case 115: { +case 120: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::URShift, sym(3).Expression); } break; -case 117: { +case 122: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Lt, sym(3).Expression); } break; -case 118: { +case 123: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Gt, sym(3).Expression); } break; -case 119: { +case 124: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Le, sym(3).Expression); } break; -case 120: { +case 125: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Ge, sym(3).Expression); } break; -case 121: { +case 126: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::InstanceOf, sym(3).Expression); } break; -case 122: { +case 127: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::In, sym(3).Expression); } break; -case 124: { +case 129: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Lt, sym(3).Expression); } break; -case 125: { +case 130: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Gt, sym(3).Expression); } break; -case 126: { +case 131: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Le, sym(3).Expression); } break; -case 127: { +case 132: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Ge, sym(3).Expression); } break; -case 128: { +case 133: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::InstanceOf, sym(3).Expression); } break; -case 130: { +case 135: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Equal, sym(3).Expression); } break; -case 131: { +case 136: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::NotEqual, sym(3).Expression); } break; -case 132: { +case 137: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::StrictEqual, sym(3).Expression); } break; -case 133: { +case 138: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::StrictNotEqual, sym(3).Expression); } break; -case 135: { +case 140: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Equal, sym(3).Expression); } break; -case 136: { +case 141: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::NotEqual, sym(3).Expression); } break; -case 137: { +case 142: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::StrictEqual, sym(3).Expression); } break; -case 138: { +case 143: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::StrictNotEqual, sym(3).Expression); } break; -case 140: { +case 145: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::BitAnd, sym(3).Expression); } break; -case 142: { +case 147: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::BitAnd, sym(3).Expression); } break; -case 144: { +case 149: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::BitXor, sym(3).Expression); } break; -case 146: { +case 151: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::BitXor, sym(3).Expression); } break; -case 148: { +case 153: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::BitOr, sym(3).Expression); } break; -case 150: { +case 155: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::BitOr, sym(3).Expression); } break; -case 152: { +case 157: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::And, sym(3).Expression); } break; -case 154: { +case 159: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::And, sym(3).Expression); } break; -case 156: { +case 161: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Or, sym(3).Expression); } break; -case 158: { +case 163: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Or, sym(3).Expression); } break; -case 160: { +case 165: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression, sym(5).Expression); } break; -case 162: { +case 167: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression, sym(5).Expression); } break; -case 164: { +case 169: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(2).ival, sym(3).Expression); } break; -case 166: { +case 171: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(2).ival, sym(3).Expression); } break; -case 167: { +case 172: { sym(1).ival = QSOperator::Assign; } break; -case 168: { +case 173: { sym(1).ival = QSOperator::InplaceMul; } break; -case 169: { +case 174: { sym(1).ival = QSOperator::InplaceDiv; } break; -case 170: { +case 175: { sym(1).ival = QSOperator::InplaceMod; } break; -case 171: { +case 176: { sym(1).ival = QSOperator::InplaceAdd; } break; -case 172: { +case 177: { sym(1).ival = QSOperator::InplaceSub; } break; -case 173: { +case 178: { sym(1).ival = QSOperator::InplaceLeftShift; } break; -case 174: { +case 179: { sym(1).ival = QSOperator::InplaceRightShift; } break; -case 175: { +case 180: { sym(1).ival = QSOperator::InplaceURightShift; } break; -case 176: { +case 181: { sym(1).ival = QSOperator::InplaceAnd; } break; -case 177: { +case 182: { sym(1).ival = QSOperator::InplaceXor; } break; -case 178: { +case 183: { sym(1).ival = QSOperator::InplaceOr; } break; -case 180: { +case 185: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression); } break; -case 181: { +case 186: { sym(1).Node = 0; } break; -case 184: { +case 189: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression); } break; -case 185: { +case 190: { sym(1).Node = 0; } break; -case 202: { +case 207: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).StatementList); } break; -case 203: { +case 208: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Statement); } break; -case 204: { +case 209: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).StatementList, sym(2).Statement); } break; -case 205: { +case 210: { sym(1).Node = 0; } break; -case 206: { +case 211: { sym(1).Node = sym(1).StatementList->finish (); } break; -case 208: { +case 213: { AST::VariableStatement *node = makeAstNode (driver->nodePool(), sym(2).VariableDeclarationList->finish (/*readOnly=*/sym(1).ival == T_CONST)); node->declarationKindToken = loc(1); node->semicolonToken = loc(3); sym(1).Node = node; } break; -case 209: { +case 214: { sym(1).ival = T_CONST; } break; -case 210: { +case 215: { sym(1).ival = T_VAR; } break; -case 211: { +case 216: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).VariableDeclaration); } break; -case 212: { +case 217: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).VariableDeclarationList, sym(3).VariableDeclaration); } break; -case 213: { +case 218: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).VariableDeclaration); } break; -case 214: { +case 219: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).VariableDeclarationList, sym(3).VariableDeclaration); } break; -case 215: { +case 220: { AST::VariableDeclaration *node = makeAstNode (driver->nodePool(), sym(1).sval, sym(2).Expression); node->identifierToken = loc(1); sym(1).Node = node; } break; -case 216: { +case 221: { AST::VariableDeclaration *node = makeAstNode (driver->nodePool(), sym(1).sval, sym(2).Expression); node->identifierToken = loc(1); sym(1).Node = node; } break; -case 217: { +case 222: { sym(1) = sym(2); } break; -case 218: { +case 223: { sym(1).Node = 0; } break; -case 220: { +case 225: { sym(1) = sym(2); } break; -case 221: { +case 226: { sym(1).Node = 0; } break; -case 223: { +case 228: { sym(1).Node = makeAstNode (driver->nodePool()); } break; -case 225: { +case 230: { AST::ExpressionStatement *node = makeAstNode (driver->nodePool(), sym(1).Expression); node->semicolonToken = loc(2); sym(1).Node = node; } break; -case 226: { +case 231: { sym(1).Node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Statement, sym(7).Statement); } break; -case 227: { +case 232: { sym(1).Node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Statement); } break; -case 229: { +case 234: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Statement, sym(5).Expression); } break; -case 230: { +case 235: { sym(1).Node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Statement); } break; -case 231: { +case 236: { sym(1).Node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Expression, sym(7).Expression, sym(9).Statement); } break; -case 232: { +case 237: { sym(1).Node = makeAstNode (driver->nodePool(), sym(4).VariableDeclarationList->finish (/*readOnly=*/false), sym(6).Expression, sym(8).Expression, sym(10).Statement); } break; -case 233: { +case 238: { sym(1).Node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Expression, sym(7).Statement); } break; -case 234: { +case 239: { sym(1).Node = makeAstNode (driver->nodePool(), sym(4).VariableDeclaration, sym(6).Expression, sym(8).Statement); } break; -case 236: { +case 241: { sym(1).Node = makeAstNode (driver->nodePool()); } break; -case 238: { +case 243: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).sval); } break; -case 240: { +case 245: { sym(1).Node = makeAstNode (driver->nodePool()); } break; -case 242: { +case 247: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).sval); } break; -case 244: { +case 249: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); } break; -case 245: { +case 250: { sym(1).Node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Statement); } break; -case 246: { +case 251: { sym(1).Node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).CaseBlock); } break; -case 247: { +case 252: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).CaseClauses); } break; -case 248: { +case 253: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).CaseClauses, sym(3).DefaultClause, sym(4).CaseClauses); } break; -case 249: { +case 254: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).CaseClause); } break; -case 250: { +case 255: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).CaseClauses, sym(2).CaseClause); } break; -case 251: { +case 256: { sym(1).Node = 0; } break; -case 252: { +case 257: { sym(1).Node = sym(1).CaseClauses->finish (); } break; -case 253: { +case 258: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression, sym(4).StatementList); } break; -case 254: { +case 259: { sym(1).Node = makeAstNode (driver->nodePool(), sym(3).StatementList); } break; -case 255: { +case 260: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).sval, sym(3).Statement); } break; -case 257: { +case 262: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); } break; -case 258: { +case 263: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Statement, sym(3).Catch); } break; -case 259: { +case 264: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Statement, sym(3).Finally); } break; -case 260: { +case 265: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Statement, sym(3).Catch, sym(4).Finally); } break; -case 261: { +case 266: { sym(1).Node = makeAstNode (driver->nodePool(), sym(3).sval, sym(5).Statement); } break; -case 262: { +case 267: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Statement); } break; -case 264: { +case 269: { sym(1).Node = makeAstNode (driver->nodePool()); } break; -case 265: { +case 270: { AST::FunctionDeclaration *node = makeAstNode (driver->nodePool(), sym(2).sval, sym(4).FormalParameterList, sym(7).FunctionBody); node->functionToken = loc(1); node->identifierToken = loc(2); @@ -1024,7 +1049,7 @@ case 265: { sym(1).Node = node; } break; -case 266: { +case 271: { AST::FunctionExpression *node = makeAstNode (driver->nodePool(), sym(2).sval, sym(4).FormalParameterList, sym(7).FunctionBody); node->functionToken = loc(1); if (sym(2).sval) @@ -1036,56 +1061,56 @@ case 266: { sym(1).Node = node; } break; -case 267: { +case 272: { AST::FormalParameterList *node = makeAstNode (driver->nodePool(), sym(1).sval); node->identifierToken = loc(1); sym(1).Node = node; } break; -case 268: { +case 273: { AST::FormalParameterList *node = makeAstNode (driver->nodePool(), sym(1).FormalParameterList, sym(3).sval); node->commaToken = loc(2); node->identifierToken = loc(3); sym(1).Node = node; } break; -case 269: { +case 274: { sym(1).Node = 0; } break; -case 270: { +case 275: { sym(1).Node = sym(1).FormalParameterList->finish (); } break; -case 271: { +case 276: { sym(1).Node = 0; } break; -case 273: { +case 278: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).SourceElements->finish ()); } break; -case 274: { +case 279: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).SourceElement); } break; -case 275: { +case 280: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).SourceElements, sym(2).SourceElement); } break; -case 276: { +case 281: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Statement); } break; -case 277: { +case 282: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).FunctionDeclaration); } break; -case 278: { +case 283: { sym(1).sval = 0; } break; -case 280: { +case 285: { sym(1).Node = 0; } break; diff --git a/src/declarative/qml/parser/javascriptparser_p.h b/src/declarative/qml/parser/javascriptparser_p.h index 5a47cb0..071da1f 100644 --- a/src/declarative/qml/parser/javascriptparser_p.h +++ b/src/declarative/qml/parser/javascriptparser_p.h @@ -101,6 +101,8 @@ public: JavaScript::AST::VariableDeclarationList *VariableDeclarationList; JavaScript::AST::UiProgram *UiProgram; + JavaScript::AST::UiImportList *UiImportList; + JavaScript::AST::UiImport *UiImport; JavaScript::AST::UiPublicMember *UiPublicMember; JavaScript::AST::UiObjectDefinition *UiObjectDefinition; JavaScript::AST::UiObjectInitializer *UiObjectInitializer; @@ -201,9 +203,9 @@ protected: }; -#define J_SCRIPT_REGEXPLITERAL_RULE1 22 +#define J_SCRIPT_REGEXPLITERAL_RULE1 27 -#define J_SCRIPT_REGEXPLITERAL_RULE2 23 +#define J_SCRIPT_REGEXPLITERAL_RULE2 28 QT_END_NAMESPACE -- cgit v0.12 From 765166f9aca829391bc2f4ee60b6ea4b5f7ff683 Mon Sep 17 00:00:00 2001 From: mae Date: Mon, 20 Apr 2009 14:51:57 +0200 Subject: code cleanup (helper functions rule) --- src/declarative/qml/qmlscriptparser.cpp | 147 ++++++++++++++++---------------- 1 file changed, 73 insertions(+), 74 deletions(-) diff --git a/src/declarative/qml/qmlscriptparser.cpp b/src/declarative/qml/qmlscriptparser.cpp index 2f62cfd..42cd812 100644 --- a/src/declarative/qml/qmlscriptparser.cpp +++ b/src/declarative/qml/qmlscriptparser.cpp @@ -61,16 +61,17 @@ public: void operator()(AST::Node *node); protected: + Object *defineObjectBinding(int line, + const QString &propertyName, + const QString &objectType, + AST::UiObjectInitializer *initializer = 0); + using AST::Visitor::visit; using AST::Visitor::endVisit; virtual bool visit(AST::UiObjectDefinition *node); - virtual void endVisit(AST::UiObjectDefinition *node); - virtual bool visit(AST::UiPublicMember *node); - virtual bool visit(AST::UiObjectBinding *node); - virtual void endVisit(AST::UiObjectBinding *node); virtual bool visit(AST::UiScriptBinding *node); virtual bool visit(AST::UiArrayBinding *node); @@ -147,35 +148,46 @@ QString ProcessAST::asString(AST::UiQualifiedId *node) const return s; } -// UiObjectMember: T_PUBLIC T_IDENTIFIER T_IDENTIFIER T_COLON Expression UiObjectInitializer ; -bool ProcessAST::visit(AST::UiPublicMember *node) -{ - qWarning() << Q_FUNC_INFO << "not implemented"; - return false; -} - -// UiObjectMember: T_IDENTIFIER UiObjectInitializer ; -bool ProcessAST::visit(AST::UiObjectDefinition *node) +Object *ProcessAST::defineObjectBinding(int line, + const QString &propertyName, + const QString &objectType, + AST::UiObjectInitializer *initializer) { - const QString name = node->name->asString(); - bool isType = name.at(0).isUpper() && !name.contains(QLatin1Char('.')); - - _scope.append(name); - - if (! isType) { + bool isType = !objectType.isEmpty() && objectType.at(0).isUpper() && !objectType.contains(QLatin1Char('.')); + if (!isType) { qWarning() << "bad name for a class"; // ### FIXME return false; } + const QStringList str = propertyName.split(QLatin1Char('.'), QString::SkipEmptyParts); + + for(int ii = 0; ii < str.count(); ++ii) { + const QString s = str.at(ii); + _stateStack.pushProperty(s, line); + } + + // Class - const int typeId = _parser->findOrCreateTypeId(name); - int line = node->identifierToken.startLine; + const int typeId = _parser->findOrCreateTypeId(objectType); Object *obj = new Object; obj->type = typeId; + _scope.append(objectType); obj->typeName = qualifiedNameId().toLatin1(); + _scope.removeLast(); obj->line = line; + if (Property *prop = currentProperty()) { + Value *v = new Value; + v->object = obj; + v->line = line; + prop->addValue(v); + } + + for(int ii = str.count() - 1; ii >= 0; --ii) + _stateStack.pop(); + + if (! _parser->tree()) { _parser->setTree(obj); _stateStack.pushObject(obj); @@ -191,80 +203,67 @@ bool ProcessAST::visit(AST::UiObjectDefinition *node) _stateStack.pushObject(obj); } - return true; -} + accept(initializer); -// UiObjectMember: T_IDENTIFIER UiObjectInitializer ; -void ProcessAST::endVisit(AST::UiObjectDefinition *) -{ _stateStack.pop(); - _scope.removeLast(); + + return obj; } -// UiObjectMember: UiQualifiedId T_COLON T_IDENTIFIER UiObjectInitializer ; -bool ProcessAST::visit(AST::UiObjectBinding *node) +// UiObjectMember: T_PUBLIC T_IDENTIFIER T_IDENTIFIER T_COLON Expression UiObjectInitializer ; +bool ProcessAST::visit(AST::UiPublicMember *node) { -// qWarning() << Q_FUNC_INFO << "not implemented"; - const QString qualifiedId = asString(node->qualifiedId); - const QStringList str = qualifiedId.split(QLatin1Char('.')); - int line = node->colonToken.startLine; - - for(int ii = 0; ii < str.count(); ++ii) { - const QString s = str.at(ii); - _stateStack.pushProperty(s, line); - } - +#if 0 + const QString type = node->type->asString(); const QString name = node->name->asString(); - bool isType = name.at(0).isUpper() && !name.contains(QLatin1Char('.')); - _scope.append(name); + if (type == QLatin1String("property")) { + Object *properties = defineObjectBinding(node->publicToken.startLine, + QLatin1String("properties"), + Q + property = QLatin1("properties"); + _stateStack.pushProperty(QLatin1String("properties"), node->publicToken.startLine); - if (! isType) { - qWarning() << "bad name for a class"; // ### FIXME - return false; - } + const int typeId = _parser->findOrCreateTypeId(QLatin1String("Property")); + int line = node->identifierToken.startLine; - // Class - const int typeId = _parser->findOrCreateTypeId(name); - line = node->identifierToken.startLine; + Object *obj = new Object; + obj->type = typeId; + obj->typeName = qualifiedNameId().toLatin1(); + obj->line = line; - Object *obj = new Object; - obj->type = typeId; - obj->typeName = qualifiedNameId().toLatin1(); - obj->line = line; - Property *prop = currentProperty(); - Value *v = new Value; - v->object = obj; - v->line = line; - prop->addValue(v); + accept(node->initializer); - for(int ii = str.count() - 1; ii >= 0; --ii) _stateStack.pop(); - if (! _parser->tree()) { - _parser->setTree(obj); - _stateStack.pushObject(obj); } else { - const State state = _stateStack.top(); - Value *v = new Value; - v->object = obj; - v->line = line; - if(state.property) - state.property->addValue(v); - else - state.object->getDefaultProperty()->addValue(v); - _stateStack.pushObject(obj); + qWarning << "bad public identifier" << type; // ### FIXME } +#endif + return false; +} - return true; + +// UiObjectMember: T_IDENTIFIER UiObjectInitializer ; +bool ProcessAST::visit(AST::UiObjectDefinition *node) +{ + defineObjectBinding(node->identifierToken.startLine, + QString(), + node->name->asString(), + node->initializer); + return false; } + // UiObjectMember: UiQualifiedId T_COLON T_IDENTIFIER UiObjectInitializer ; -void ProcessAST::endVisit(AST::UiObjectBinding *node) +bool ProcessAST::visit(AST::UiObjectBinding *node) { - _stateStack.pop(); - _scope.removeLast(); + defineObjectBinding(node->identifierToken.startLine, + asString(node->qualifiedId), + node->name->asString(), + node->initializer); + return false; } // UiObjectMember: UiQualifiedId T_COLON Statement ; -- cgit v0.12 From 73db0bebbf27f07faea3b8f71dccecd46cc4bbb7 Mon Sep 17 00:00:00 2001 From: mae Date: Mon, 20 Apr 2009 15:53:01 +0200 Subject: support public property definitions --- src/declarative/qml/parser/javascript.g | 16 +- src/declarative/qml/parser/javascriptgrammar.cpp | 1078 +++++++++++----------- src/declarative/qml/parser/javascriptgrammar_p.h | 10 +- src/declarative/qml/parser/javascriptparser.cpp | 379 ++++---- src/declarative/qml/parser/javascriptparser_p.h | 4 +- src/declarative/qml/qmlparser.cpp | 5 +- src/declarative/qml/qmlscriptparser.cpp | 123 ++- 7 files changed, 840 insertions(+), 775 deletions(-) diff --git a/src/declarative/qml/parser/javascript.g b/src/declarative/qml/parser/javascript.g index db6d898..c7b26e2 100644 --- a/src/declarative/qml/parser/javascript.g +++ b/src/declarative/qml/parser/javascript.g @@ -530,6 +530,16 @@ case $rule_number: { } break; ./ +UiObjectInitializer: T_LBRACE T_RBRACE ; +/. +case $rule_number: { + AST::UiObjectInitializer *node = makeAstNode (driver->nodePool(), (AST::UiObjectMemberList*)0); + node->lbraceToken = loc(1); + node->rbraceToken = loc(2); + sym(1).Node = node; +} break; +./ + UiObjectInitializer: T_LBRACE UiObjectMemberList T_RBRACE ; /. case $rule_number: { @@ -2223,7 +2233,7 @@ PropertyNameAndValueListOpt: PropertyNameAndValueList ; token_buffer[1].loc = yylloc = location(lexer); if (t_action(errorState, yytoken)) { - const QString msg = QString::fromUtf8("Removed token: `%1'").arg(spell[token_buffer[0].token]); + const QString msg = QString::fromUtf8("Removed token: `%1'").arg(QLatin1String(spell[token_buffer[0].token])); diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, token_buffer[0].loc.startLine, token_buffer[0].loc.startColumn, msg)); @@ -2253,7 +2263,7 @@ PropertyNameAndValueListOpt: PropertyNameAndValueList ; for (int *tk = tokens; *tk != EOF_SYMBOL; ++tk) { int a = t_action(errorState, *tk); if (a > 0 && t_action(a, yytoken)) { - const QString msg = QString::fromUtf8("Inserted token: `%1'").arg(spell[*tk]); + const QString msg = QString::fromUtf8("Inserted token: `%1'").arg(QLatin1String(spell[*tk])); diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, token_buffer[0].loc.startLine, token_buffer[0].loc.startColumn, msg)); @@ -2273,7 +2283,7 @@ PropertyNameAndValueListOpt: PropertyNameAndValueList ; for (int tk = 1; tk < TERMINAL_COUNT; ++tk) { int a = t_action(errorState, tk); if (a > 0 && t_action(a, yytoken)) { - const QString msg = QString::fromUtf8("Inserted token: `%1'").arg(spell[tk]); + const QString msg = QString::fromUtf8("Inserted token: `%1'").arg(QLatin1String(spell[tk])); diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, token_buffer[0].loc.startLine, token_buffer[0].loc.startColumn, msg)); diff --git a/src/declarative/qml/parser/javascriptgrammar.cpp b/src/declarative/qml/parser/javascriptgrammar.cpp index 51ec48e..61d033c 100644 --- a/src/declarative/qml/parser/javascriptgrammar.cpp +++ b/src/declarative/qml/parser/javascriptgrammar.cpp @@ -14,479 +14,509 @@ const char *const JavaScriptGrammar::spell [] = { const int JavaScriptGrammar::lhs [] = { 88, 89, 89, 92, 92, 93, 93, 91, 90, 90, - 95, 94, 94, 94, 94, 94, 94, 94, 96, 96, - 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, - 99, 99, 99, 99, 99, 101, 101, 105, 105, 100, - 100, 103, 103, 106, 106, 106, 106, 107, 107, 107, + 95, 95, 94, 94, 94, 94, 94, 94, 94, 96, + 96, 99, 99, 99, 99, 99, 99, 99, 99, 99, + 99, 99, 99, 99, 99, 99, 101, 101, 105, 105, + 100, 100, 103, 103, 106, 106, 106, 106, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, - 107, 107, 107, 107, 107, 107, 107, 107, 108, 108, - 109, 109, 109, 109, 109, 112, 112, 113, 113, 113, - 113, 111, 111, 114, 114, 115, 115, 116, 116, 116, - 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, - 118, 118, 118, 118, 119, 119, 119, 120, 120, 120, - 120, 121, 121, 121, 121, 121, 121, 121, 122, 122, - 122, 122, 122, 122, 123, 123, 123, 123, 123, 124, - 124, 124, 124, 124, 125, 125, 126, 126, 127, 127, - 128, 128, 129, 129, 130, 130, 131, 131, 132, 132, - 133, 133, 134, 134, 135, 135, 136, 136, 104, 104, - 137, 137, 138, 138, 138, 138, 138, 138, 138, 138, - 138, 138, 138, 138, 98, 98, 139, 139, 140, 140, - 141, 141, 97, 97, 97, 97, 97, 97, 97, 97, - 97, 97, 97, 97, 97, 97, 97, 142, 158, 158, - 157, 157, 143, 143, 159, 159, 160, 160, 162, 162, - 161, 163, 166, 164, 164, 167, 165, 165, 144, 145, - 145, 146, 146, 147, 147, 147, 147, 147, 147, 147, - 148, 148, 148, 148, 149, 149, 149, 149, 150, 150, - 151, 153, 168, 168, 171, 171, 169, 169, 172, 170, - 152, 154, 154, 155, 155, 155, 173, 174, 156, 156, - 175, 110, 179, 179, 176, 176, 177, 177, 180, 181, - 181, 182, 182, 178, 178, 102, 102, 183}; + 107, 107, 107, 107, 107, 107, 107, 107, 107, 108, + 108, 109, 109, 109, 109, 109, 112, 112, 113, 113, + 113, 113, 111, 111, 114, 114, 115, 115, 116, 116, + 116, 117, 117, 117, 117, 117, 117, 117, 117, 117, + 117, 118, 118, 118, 118, 119, 119, 119, 120, 120, + 120, 120, 121, 121, 121, 121, 121, 121, 121, 122, + 122, 122, 122, 122, 122, 123, 123, 123, 123, 123, + 124, 124, 124, 124, 124, 125, 125, 126, 126, 127, + 127, 128, 128, 129, 129, 130, 130, 131, 131, 132, + 132, 133, 133, 134, 134, 135, 135, 136, 136, 104, + 104, 137, 137, 138, 138, 138, 138, 138, 138, 138, + 138, 138, 138, 138, 138, 98, 98, 139, 139, 140, + 140, 141, 141, 97, 97, 97, 97, 97, 97, 97, + 97, 97, 97, 97, 97, 97, 97, 97, 142, 158, + 158, 157, 157, 143, 143, 159, 159, 160, 160, 162, + 162, 161, 163, 166, 164, 164, 167, 165, 165, 144, + 145, 145, 146, 146, 147, 147, 147, 147, 147, 147, + 147, 148, 148, 148, 148, 149, 149, 149, 149, 150, + 150, 151, 153, 168, 168, 171, 171, 169, 169, 172, + 170, 152, 154, 154, 155, 155, 155, 173, 174, 156, + 156, 175, 110, 179, 179, 176, 176, 177, 177, 180, + 181, 181, 182, 182, 178, 178, 102, 102, 183}; const int JavaScriptGrammar:: rhs[] = { 2, 1, 1, 1, 2, 3, 3, 0, 1, 2, - 3, 4, 2, 5, 3, 6, 3, 5, 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, + 2, 3, 4, 2, 5, 3, 6, 3, 5, 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, 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, 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, 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, 3, 1, 5, 1, 5, 1, + 3, 1, 3, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 3, 0, 1, 1, + 3, 0, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, + 2, 0, 1, 3, 3, 1, 1, 1, 3, 1, + 3, 2, 2, 2, 0, 1, 2, 0, 1, 1, + 2, 2, 7, 5, 7, 7, 5, 9, 10, 7, + 8, 2, 2, 3, 3, 2, 2, 3, 3, 3, + 3, 5, 5, 3, 5, 1, 2, 0, 1, 4, + 3, 3, 3, 3, 3, 3, 4, 5, 2, 2, + 2, 8, 8, 1, 3, 0, 1, 0, 1, 1, + 1, 2, 1, 1, 0, 1, 0, 1, 2}; const int JavaScriptGrammar::action_default [] = { - 8, 2, 0, 0, 4, 3, 0, 288, 0, 6, - 7, 5, 19, 0, 9, 1, 0, 0, 13, 0, - 11, 10, 0, 17, 0, 118, 185, 149, 157, 153, - 97, 169, 145, 18, 82, 98, 161, 165, 86, 115, - 96, 101, 81, 135, 122, 0, 28, 29, 25, 284, - 22, 286, 40, 0, 0, 0, 0, 0, 23, 26, - 0, 0, 27, 21, 0, 24, 0, 0, 111, 0, - 0, 98, 117, 100, 99, 0, 0, 0, 113, 114, - 112, 116, 0, 146, 0, 0, 0, 0, 136, 0, - 0, 0, 0, 0, 0, 126, 0, 0, 0, 120, - 121, 119, 124, 128, 127, 125, 123, 138, 137, 139, - 0, 154, 0, 150, 0, 0, 92, 91, 80, 48, - 49, 50, 75, 51, 76, 52, 53, 54, 55, 56, - 57, 58, 59, 79, 60, 61, 62, 63, 64, 77, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 78, 0, 0, 90, 186, 93, 0, 94, 0, 95, - 89, 16, 0, 182, 175, 173, 180, 181, 179, 178, - 184, 177, 176, 174, 183, 170, 0, 158, 0, 0, - 162, 0, 0, 166, 0, 0, 92, 84, 0, 83, - 0, 88, 102, 0, 285, 275, 276, 0, 273, 0, - 274, 0, 277, 193, 200, 199, 207, 195, 0, 196, - 278, 0, 283, 197, 198, 203, 201, 280, 279, 282, - 204, 0, 215, 0, 0, 0, 0, 284, 22, 0, - 286, 187, 229, 0, 0, 0, 216, 0, 0, 205, - 206, 0, 194, 202, 230, 231, 272, 281, 245, 0, - 246, 247, 248, 241, 0, 242, 243, 244, 269, 270, - 0, 0, 0, 0, 0, 234, 235, 191, 189, 151, - 159, 155, 171, 147, 192, 0, 98, 163, 167, 140, - 129, 0, 0, 148, 0, 0, 0, 0, 141, 0, - 0, 0, 0, 0, 133, 131, 134, 132, 130, 143, - 142, 144, 0, 156, 0, 152, 0, 190, 98, 0, - 172, 187, 188, 0, 187, 0, 0, 237, 0, 0, - 0, 239, 0, 160, 0, 0, 164, 0, 0, 168, - 227, 0, 219, 228, 222, 0, 226, 0, 187, 220, - 0, 187, 0, 0, 238, 0, 0, 0, 240, 285, - 275, 0, 0, 277, 0, 271, 0, 261, 0, 0, - 0, 233, 0, 232, 0, 287, 0, 47, 209, 212, - 0, 48, 75, 51, 76, 53, 54, 25, 58, 59, - 22, 60, 63, 23, 26, 187, 27, 66, 21, 68, - 24, 70, 71, 72, 73, 74, 78, 0, 42, 0, - 0, 44, 46, 34, 45, 0, 43, 33, 210, 208, - 86, 87, 92, 0, 85, 0, 249, 250, 0, 0, - 0, 252, 257, 255, 258, 0, 0, 256, 257, 0, - 253, 0, 254, 211, 260, 0, 211, 259, 0, 262, - 263, 0, 211, 264, 265, 0, 0, 266, 0, 0, - 0, 267, 268, 104, 103, 0, 0, 0, 236, 0, - 0, 0, 251, 224, 217, 0, 225, 221, 0, 223, - 213, 0, 214, 218, 0, 41, 0, 38, 40, 31, - 0, 37, 32, 39, 36, 30, 0, 35, 108, 106, - 110, 107, 105, 109, 0, 0, 15, 22, 40, 12, - 0, 14, 20}; + 8, 2, 0, 0, 4, 3, 0, 289, 0, 6, + 7, 5, 20, 0, 9, 1, 0, 0, 14, 11, + 0, 12, 10, 0, 18, 0, 119, 186, 150, 158, + 154, 98, 170, 146, 19, 83, 99, 162, 166, 87, + 116, 97, 102, 82, 136, 123, 0, 29, 30, 26, + 285, 23, 287, 41, 0, 0, 0, 0, 0, 24, + 27, 0, 0, 28, 22, 0, 25, 0, 0, 112, + 0, 0, 99, 118, 101, 100, 0, 0, 0, 114, + 115, 113, 117, 0, 147, 0, 0, 0, 0, 137, + 0, 0, 0, 0, 0, 0, 127, 0, 0, 0, + 121, 122, 120, 125, 129, 128, 126, 124, 139, 138, + 140, 0, 155, 0, 151, 0, 0, 93, 92, 81, + 49, 50, 51, 76, 52, 77, 53, 54, 55, 56, + 57, 58, 59, 60, 80, 61, 62, 63, 64, 65, + 78, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 79, 0, 0, 91, 187, 94, 0, 95, 0, + 96, 90, 17, 0, 183, 176, 174, 181, 182, 180, + 179, 185, 178, 177, 175, 184, 171, 0, 159, 0, + 0, 163, 0, 0, 167, 0, 0, 93, 85, 0, + 84, 0, 89, 103, 0, 286, 276, 277, 0, 274, + 0, 275, 0, 278, 194, 201, 200, 208, 196, 0, + 197, 279, 0, 284, 198, 199, 204, 202, 281, 280, + 283, 205, 0, 216, 0, 0, 0, 0, 285, 23, + 0, 287, 188, 230, 0, 0, 0, 217, 0, 0, + 206, 207, 0, 195, 203, 231, 232, 273, 282, 246, + 0, 247, 248, 249, 242, 0, 243, 244, 245, 270, + 271, 0, 0, 0, 0, 0, 235, 236, 192, 190, + 152, 160, 156, 172, 148, 193, 0, 99, 164, 168, + 141, 130, 0, 0, 149, 0, 0, 0, 0, 142, + 0, 0, 0, 0, 0, 134, 132, 135, 133, 131, + 144, 143, 145, 0, 157, 0, 153, 0, 191, 99, + 0, 173, 188, 189, 0, 188, 0, 0, 238, 0, + 0, 0, 240, 0, 161, 0, 0, 165, 0, 0, + 169, 228, 0, 220, 229, 223, 0, 227, 0, 188, + 221, 0, 188, 0, 0, 239, 0, 0, 0, 241, + 286, 276, 0, 0, 278, 0, 272, 0, 262, 0, + 0, 0, 234, 0, 233, 0, 288, 0, 48, 210, + 213, 0, 49, 76, 52, 77, 54, 55, 26, 59, + 60, 23, 61, 64, 24, 27, 188, 28, 67, 22, + 69, 25, 71, 72, 73, 74, 75, 79, 0, 43, + 0, 0, 45, 47, 35, 46, 0, 44, 34, 211, + 209, 87, 88, 93, 0, 86, 0, 250, 251, 0, + 0, 0, 253, 258, 256, 259, 0, 0, 257, 258, + 0, 254, 0, 255, 212, 261, 0, 212, 260, 0, + 263, 264, 0, 212, 265, 266, 0, 0, 267, 0, + 0, 0, 268, 269, 105, 104, 0, 0, 0, 237, + 0, 0, 0, 252, 225, 218, 0, 226, 222, 0, + 224, 214, 0, 215, 219, 0, 42, 0, 39, 41, + 32, 0, 38, 33, 40, 37, 31, 0, 36, 109, + 107, 111, 108, 106, 110, 0, 0, 16, 23, 41, + 13, 0, 15, 21}; const int JavaScriptGrammar::goto_default [] = { - 2, 6, 15, 1, 5, 4, 14, 18, 16, 368, - 208, 42, 476, 474, 366, 365, 26, 475, 364, 367, - 117, 38, 34, 156, 40, 30, 155, 35, 41, 68, - 39, 25, 44, 43, 279, 32, 273, 27, 269, 29, - 271, 28, 270, 36, 277, 37, 278, 31, 272, 268, - 309, 415, 274, 275, 203, 242, 207, 209, 213, 214, - 205, 204, 216, 243, 215, 220, 239, 240, 206, 370, - 369, 241, 465, 464, 331, 332, 467, 334, 466, 333, - 421, 425, 428, 424, 423, 443, 444, 212, 197, 211, - 193, 196, 210, 218, 217, 0}; + 2, 6, 15, 1, 5, 4, 14, 18, 16, 369, + 209, 43, 477, 475, 367, 366, 27, 476, 365, 368, + 118, 39, 35, 157, 41, 31, 156, 36, 42, 69, + 40, 26, 45, 44, 280, 33, 274, 28, 270, 30, + 272, 29, 271, 37, 278, 38, 279, 32, 273, 269, + 310, 416, 275, 276, 204, 243, 208, 210, 214, 215, + 206, 205, 217, 244, 216, 221, 240, 241, 207, 371, + 370, 242, 466, 465, 332, 333, 468, 335, 467, 334, + 422, 426, 429, 425, 424, 444, 445, 213, 198, 212, + 194, 197, 211, 219, 218, 0}; const int JavaScriptGrammar::action_index [] = { - -7, -88, 41, -25, -88, -43, 87, -88, 102, -88, - -88, -88, 12, 18, -88, 124, 113, 92, -88, 186, - -88, -88, 9, 29, 534, 122, -88, 28, -16, -41, - 213, -88, 307, 91, -88, 457, 60, 82, 237, 156, - -88, -88, -88, 372, 157, 534, -88, -88, -88, 32, - -88, 1014, 43, 534, 534, 534, 321, 534, -88, -88, - 534, 534, -88, -88, 534, -88, 534, 534, -88, 534, - 534, 103, 148, -88, -88, 534, 534, 534, -88, -88, - -88, 225, 534, 307, 534, 534, 534, 534, 372, 534, - 534, 534, 534, 534, 534, 158, 534, 534, 534, 101, - 100, 74, 229, 189, 193, 207, 208, 372, 372, 372, - 534, 0, 534, 71, 930, 534, 534, -88, -88, -88, + -4, -88, 42, -21, -88, -40, 116, -88, 112, -88, + -88, -88, 16, 19, -88, 85, 102, 174, -88, -88, + 173, -88, -88, 12, 27, 596, 78, -88, 34, -12, + -20, 210, -88, 266, 100, -88, 411, 61, 70, 239, + 169, -88, -88, -88, 333, 152, 596, -88, -88, -88, + 29, -88, 1076, 21, 596, 596, 596, 443, 596, -88, + -88, 596, 596, -88, -88, 596, -88, 596, 596, -88, + 596, 596, 108, 204, -88, -88, 596, 596, 596, -88, + -88, -88, 155, 596, 252, 596, 596, 596, 596, 343, + 596, 596, 596, 596, 596, 596, 159, 596, 596, 596, + 81, 106, 104, 302, 302, 167, 302, 302, 361, 323, + 313, 596, 40, 596, 71, 992, 596, 596, -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, 147, 534, -88, -88, 23, 7, -88, 534, -88, - -88, -88, 534, -88, -88, -88, -88, -88, -88, -88, - -88, -88, -88, -88, -88, -88, 534, 57, 534, 534, - 80, 78, 534, -88, 930, 534, 534, -88, 136, -88, - 31, -88, -88, 37, -88, 42, 66, 33, -88, 46, - -88, 67, 1350, -88, -88, -88, -88, -88, 218, -88, - -88, 56, -88, -88, -88, -88, -88, -88, 1350, -88, - -88, 132, -88, 168, 81, 1266, 53, 52, 72, 54, - 1434, 534, -88, 58, 534, 47, -88, 61, 62, -88, - -88, 55, -88, -88, -88, -88, -88, -88, -88, 73, - -88, -88, -88, -88, 69, -88, -88, -88, -88, -88, - 39, 51, 534, 94, 104, -88, -88, 769, -88, 76, - 35, 34, -88, 244, 164, 68, 389, 48, 83, 260, - 179, 4, 534, 240, 534, 534, 534, 534, 276, 534, - 534, 534, 534, 534, 223, 217, 153, 152, 185, 286, - 270, 292, 534, -75, 534, 1, 534, -88, 457, 534, - -88, 534, 11, -48, 534, -42, 1266, -88, 534, 114, - 1266, -88, 534, -31, 534, 534, 19, 8, 534, -88, - -1, 96, -19, -88, -88, 534, -88, 4, 534, -88, - 27, 534, -36, 1266, -88, 534, 109, 1266, -88, -11, - -6, -38, -22, 1350, -35, -88, 1266, -88, 534, 98, - 1266, -2, 1266, -88, -4, 84, -49, -88, -88, 1266, - -55, 160, -24, 138, 77, 534, 1266, 2, -28, 90, - 3, -29, 347, -3, 20, 692, 21, 24, 49, 534, - 50, 26, 534, 25, 534, 22, -10, 534, -88, 1098, - 45, -88, -88, -88, -88, 534, -88, -88, -88, -88, - 173, -88, 534, -5, -88, 85, -88, -88, 534, 99, - 30, -88, 63, -88, 65, 93, 534, -88, 64, 59, - -88, 10, -88, 1266, -88, 88, 1266, -88, 178, -88, - -88, 95, 1266, 44, -88, 17, 16, -88, 5, -23, - 6, -88, -88, -88, -88, 534, 142, 1266, -88, 534, - 141, 1266, -88, 13, -88, 216, -88, -88, 534, -88, - -88, 15, -88, -88, 119, 38, 846, -88, 40, -88, - 611, -88, -88, -88, -88, -88, 110, -88, -88, -88, - -88, -88, -88, -88, 1182, 14, -88, 79, 228, -88, - 169, -88, -88, + -88, -88, 114, 596, -88, -88, 31, -32, -88, 596, + -88, -88, -88, 596, -88, -88, -88, -88, -88, -88, + -88, -88, -88, -88, -88, -88, -88, 596, 57, 596, + 596, 166, 77, 596, -88, 992, 596, 596, -88, 120, + -88, 35, -88, -88, 37, -88, 47, 66, 33, -88, + 49, -88, 63, 1412, -88, -88, -88, -88, -88, 219, + -88, -88, 60, -88, -88, -88, -88, -88, -88, 1412, + -88, -88, 149, -88, 207, 79, 1244, 54, 51, 72, + 41, 1496, 596, -88, 53, 596, 55, -88, 56, 58, + -88, -88, 68, -88, -88, -88, -88, -88, -88, -88, + 76, -88, -88, -88, -88, 73, -88, -88, -88, -88, + -88, 52, 67, 596, 94, 86, -88, -88, 831, -88, + 74, 38, 36, -88, 246, 75, 69, 486, 48, 110, + 270, 195, -26, 596, 264, 596, 596, 596, 596, 367, + 596, 596, 596, 596, 596, 196, 215, 222, 225, 218, + 298, 291, 367, 596, -75, 596, -1, 596, -88, 369, + 596, -88, 596, 5, -47, 596, -41, 1244, -88, 596, + 157, 1244, -88, 596, -24, 596, 596, 18, 10, 596, + -88, 1, 92, -15, -88, -88, 596, -88, -8, 596, + -88, 30, 596, -37, 1244, -88, 596, 131, 1244, -88, + -6, 4, -35, -7, 1412, -43, -88, 1244, -88, 596, + 96, 1244, 6, 1244, -88, 8, 0, -53, -88, -88, + 1244, -51, 137, -22, 153, 101, 596, 1244, 3, -25, + 113, 2, -30, 519, 80, -2, 754, 20, -5, 46, + 596, 50, 28, 596, 25, 596, 24, 23, 596, -88, + 1160, 45, -88, -88, -88, -88, 596, -88, -88, -88, + -88, 172, -88, 596, 11, -88, 97, -88, -88, 596, + 144, 32, -88, 62, -88, 65, 88, 596, -88, 64, + 59, -88, 13, -88, 1244, -88, 99, 1244, -88, 216, + -88, -88, 105, 1244, 44, -88, 26, 22, -88, 9, + -23, 7, -88, -88, -88, -88, 596, 91, 1244, -88, + 596, 123, 1244, -88, 15, -88, 177, -88, -88, 596, + -88, -88, 17, -88, -88, 119, 39, 908, -88, 43, + -88, 673, -88, -88, -88, -88, -88, 111, -88, -88, + -88, -88, -88, -88, -88, 1328, 14, -88, 103, 164, + -88, 151, -88, -88, - -96, -96, -96, -96, -96, 24, -96, -96, -96, -96, - -96, -96, -96, -96, -96, 10, -96, 9, -96, 22, - -96, -96, -96, -96, 12, -96, -96, -96, -96, -96, - -96, -96, -96, 27, -96, -17, -96, -96, -96, -96, - -96, -96, -96, -96, -96, 140, -96, -96, -96, -96, - -96, -96, -96, -1, 96, 122, 72, 82, -96, -96, - 116, 119, -96, -96, 109, -96, 106, 49, -96, 104, - 110, -96, -96, -96, -96, 101, 100, 86, -96, -96, - -96, -96, 79, -96, 147, 139, 149, 128, -96, 127, - 138, 130, 136, 90, 70, -96, 41, 77, 54, -96, + -96, -96, -96, -96, -96, 85, -96, -96, -96, -96, + -96, -96, -96, -96, -96, 16, -96, 12, -96, -96, + 22, -96, -96, -96, -96, 11, -96, -96, -96, -96, + -96, -96, -96, -96, 26, -96, -19, -96, -96, -96, + -96, -96, -96, -96, -96, -96, 139, -96, -96, -96, + -96, -96, -96, -96, -1, 90, 86, 106, 113, -96, + -96, 114, 110, -96, -96, 107, -96, 58, 104, -96, + 102, 108, -96, -96, -96, -96, 99, 89, 118, -96, + -96, -96, -96, 77, -96, 76, 140, 145, 121, -96, + 119, 130, 131, 137, 93, 68, -96, 55, 62, 57, -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, - 59, -96, 64, -96, 19, 33, 44, -96, -96, -96, + -96, 75, -96, 71, -96, 19, 33, 51, -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, - -96, -96, 47, -96, -96, -96, -96, -96, 37, -96, - -96, -96, 31, -96, -96, -96, -96, -96, -96, -96, - -96, -96, -96, -96, -96, -96, 91, -96, 146, -14, - -96, -96, -4, -96, 209, 21, 148, -96, -96, -96, + -96, -96, -96, 36, -96, -96, -96, -96, -96, 35, + -96, -96, -96, 43, -96, -96, -96, -96, -96, -96, + -96, -96, -96, -96, -96, -96, -96, 138, -96, 128, + -3, -96, -96, 14, -96, 61, 13, 154, -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, - -96, -96, 23, -96, -96, -96, -96, -96, -96, -96, - -96, -96, -96, -96, -96, -96, -96, -96, 58, -96, - -96, -96, -96, -96, -96, 17, -96, -96, -96, -96, - -96, 11, -96, -96, 5, -41, -96, -96, -96, -96, + -96, -96, -96, 27, -96, -96, -96, -96, -96, -96, + -96, -96, -96, -96, -96, -96, -96, -96, -96, 66, + -96, -96, -96, -96, -96, -96, 23, -96, -96, -96, + -96, -96, 10, -96, -96, 6, -42, -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, - -96, -96, -5, -96, -96, -96, -96, 115, -96, -96, + -96, -96, -96, 5, -96, -96, -96, -96, 117, -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, - -96, -96, 161, -96, 177, 167, 151, 178, -96, 73, - 67, 63, 57, 60, -96, -96, -96, -96, -96, -96, - -96, -96, 160, -96, 152, -96, 189, -96, -96, 154, - -96, 56, -96, -96, 61, -96, 43, -96, 46, -96, - 48, -96, 164, -96, 187, 188, -96, -96, 181, -96, - -96, -96, -96, -96, -96, 175, -96, -20, 65, -96, - -96, 69, -96, 32, -96, 36, -96, 42, -96, -96, - -49, -96, -96, 55, -96, -96, 35, -96, 30, -96, - 52, -96, 53, -96, -96, -96, -96, -96, -96, 50, - -96, -96, -96, -96, -96, 131, 132, -96, -96, -96, - -96, -96, 129, -96, -96, 38, -96, -96, -96, 39, - -96, -12, 92, -96, 97, -96, -96, 34, -96, 40, - -96, -96, -96, -96, -96, 29, -96, -96, -96, -96, - -96, -96, 87, -96, -96, -96, -96, -96, -7, -96, - -96, -96, -96, -96, -77, -96, 0, -96, -73, -96, - -96, -96, -96, -42, -96, -96, -69, -96, -96, -96, - -96, -96, -96, -72, -96, -96, -24, -96, -96, -96, - -29, -96, -96, -96, -96, 26, -96, 28, -96, 25, - -96, 14, -96, -96, -96, -96, -96, -96, 8, -96, - -96, -53, -96, -96, -96, -96, 2, -96, 7, -96, - 1, -96, -96, -96, -96, -96, -96, -96, -96, -96, - -96, -96, -96, -96, 45, -96, -96, -6, 4, -96, - -2, -96, -96}; + -96, -96, -96, 180, -96, 167, 176, 168, 188, -96, + 41, 65, 67, 64, 74, -96, -96, -96, -96, -96, + -96, -96, -96, 158, -96, 148, -96, 191, -96, -96, + 157, -96, 59, -96, -96, 56, -96, 53, -96, 50, + -96, 49, -96, 155, -96, 234, 187, -96, -96, 164, + -96, -96, -96, -96, -96, -96, 177, -96, -26, 54, + -96, -96, 60, -96, 32, -96, 30, -96, 37, -96, + -96, -49, -96, -96, 63, -96, -96, 48, -96, 46, + -96, 45, -96, 44, -96, -96, -96, -96, -96, -96, + 52, -96, -96, -96, -96, -96, 132, 39, -96, -96, + -96, -96, -96, 129, -96, -96, 40, -96, -96, -96, + 34, -96, -12, 95, -96, 94, -96, -96, 31, -96, + 47, -96, -96, -96, -96, -96, 29, -96, -96, -96, + -96, -96, -96, 165, -96, -96, -96, -96, -96, 0, + -96, -96, -96, -96, -96, -79, -96, -7, -96, -80, + -96, -96, -96, -96, -61, -96, -96, -63, -96, -96, + -96, -96, -96, -96, -57, -96, -96, -43, -96, -96, + -96, -27, -96, -96, -96, -96, 25, -96, 28, -96, + 24, -96, 17, -96, -96, -96, -96, -96, -96, 8, + -96, -96, -55, -96, -96, -96, -96, 9, -96, 7, + -96, 1, -96, -96, -96, -96, -96, -96, -96, -96, + -96, -96, -96, -96, -96, -2, -96, -96, -5, 2, + -96, -6, -96, -96}; const int JavaScriptGrammar::action_info [] = { - 409, 304, 282, 397, -64, -215, 407, 358, 267, -56, - -44, 353, 345, 314, 362, 328, 335, 302, 316, 152, - 355, 322, 352, 198, 343, 350, 459, -46, -45, 82, - 468, 158, 110, 330, 449, 112, 24, 450, 23, 442, - 8, 7, 3, 502, 463, 17, 483, 22, 477, 442, - 322, 477, 405, 448, -216, 414, -67, -69, 455, 442, - 418, 194, 176, 422, 446, 432, 433, 160, 426, 426, - 426, 198, 82, 195, 199, 200, 112, 282, 3, 356, - 442, 349, 176, 302, 463, 182, 356, 262, 341, 267, - 358, 191, 399, 201, 418, 436, 152, 455, 459, 152, - 202, 445, 152, 429, 337, 110, 152, 152, 0, 0, - 304, 246, 17, 261, 69, 446, 12, 152, 152, 194, - 494, 12, 152, 0, 17, 70, -284, 478, 495, 311, - 257, 256, 178, 324, 252, 251, 179, 325, 259, 258, - 69, 69, 259, 258, 152, 73, 417, 416, 430, 152, - 152, 70, 70, 12, 264, 152, 74, 338, 360, 420, - 75, 249, 69, 10, 9, 266, 265, 254, 75, 347, - 487, 13, 306, 70, 320, 479, 13, 96, 96, 97, - 97, 0, 96, 96, 97, 97, 152, 0, 184, 249, - 98, 98, 189, 250, 248, 98, 98, 254, 12, 255, - 253, 461, 457, 153, 96, 76, 97, 185, 13, 412, - 96, 77, 97, 76, 96, 12, 97, 98, 96, 77, - 97, 250, 248, 98, 471, 501, 152, 98, 114, 255, - 253, 98, 96, 96, 97, 97, 477, 75, 0, 440, - 439, 20, 96, 0, 97, 98, 98, 115, 96, 116, - 97, 0, 184, 13, 96, 98, 97, 12, 284, 285, - 0, 98, 284, 285, 0, 0, 0, 98, 0, 0, - 13, 185, 0, 186, 0, 0, 0, 472, 470, 245, - 244, 0, 76, 289, 290, 286, 287, 0, 77, 286, - 287, 0, 291, 289, 290, 292, 0, 293, 0, 289, - 290, 0, 291, 0, 0, 292, 0, 293, 291, 289, - 290, 292, 13, 293, 0, 289, 290, 0, 291, 0, - 0, 292, 0, 293, 291, 84, 85, 292, 0, 293, - 0, 0, 0, 46, 47, 0, 0, 0, 0, 0, - 0, 0, 0, 49, 0, 0, 0, 0, 0, 0, - 50, 0, 86, 87, 51, 52, 0, 53, 0, 46, - 47, 0, 0, 0, 56, 0, 0, 0, 59, 49, + 283, 305, 408, 331, 410, -47, 359, -216, 400, -45, + -57, 268, 356, 153, 315, 398, 346, 329, 336, 317, + 323, 331, 363, 344, 303, 353, 354, -46, 161, 478, + 351, 419, 469, 199, 25, 83, 111, 451, 450, 159, + 443, 24, 7, 503, 8, 3, 464, 484, 23, 17, + 323, 478, 406, -68, -217, 443, 113, -70, 195, 460, + 456, 443, 449, 177, 447, 423, 434, 427, 433, 427, + 427, 415, 83, 196, 200, 283, 199, 359, 201, 357, + 350, 3, 0, 307, 183, 0, 303, -65, 443, 419, + 268, 342, 456, 202, 460, 192, 203, 464, 430, 153, + 338, 0, 153, 263, 153, 111, 437, 153, 153, 495, + 357, 446, 305, 0, 12, 247, 113, 496, 70, 153, + 179, 70, 153, 0, 180, 447, 262, 479, 153, 71, + 312, 153, 71, 17, 258, 257, 17, 253, 252, 153, + 260, 259, 195, 431, 70, 12, 70, 267, 266, -285, + 74, 458, 153, 339, 265, 71, 361, 71, 418, 417, + 325, 75, 260, 259, 326, 153, 250, 76, 177, 13, + 154, 488, 478, 10, 9, 480, 190, 97, 250, 98, + 12, 76, 255, 462, 97, 472, 98, 185, 0, 0, + 99, 348, 97, 12, 98, 0, 0, 99, 251, 249, + 13, 0, 12, 12, 421, 99, 186, 502, 413, 0, + 251, 249, 77, 0, 256, 254, 76, 321, 78, 0, + 97, 97, 98, 98, 153, 115, 77, 153, 21, 19, + 0, 0, 78, 99, 99, 13, 255, 0, 473, 471, + 97, 0, 98, 97, 116, 98, 117, 97, 13, 98, + 97, 0, 98, 99, 185, 0, 99, 13, 13, 0, + 99, 77, 0, 99, 285, 286, 0, 78, 256, 254, + 85, 86, 0, 186, 0, 187, 0, 441, 440, 0, + 246, 245, 285, 286, 85, 86, 0, 0, 0, 0, + 0, 287, 288, 290, 291, 0, 0, 87, 88, 0, + 0, 0, 292, 0, 0, 293, 0, 294, 0, 287, + 288, 87, 88, 0, 290, 291, 0, 0, 0, 0, + 0, 290, 291, 292, 0, 0, 293, 97, 294, 98, + 292, 0, 0, 293, 0, 294, 90, 91, 0, 0, + 99, 0, 0, 0, 92, 93, 90, 91, 94, 0, + 95, 0, 0, 0, 92, 93, 90, 91, 94, 0, + 95, 0, 0, 0, 92, 93, 90, 91, 94, 0, + 95, 0, 164, 0, 92, 93, 0, 0, 94, 0, + 95, 0, 165, 0, 90, 91, 166, 0, 0, 0, + 290, 291, 92, 93, 0, 167, 94, 168, 95, 292, + 0, 0, 293, 0, 294, 0, 0, 0, 169, 0, + 170, 74, 0, 0, 164, 0, 0, 0, 171, 0, + 0, 172, 75, 0, 165, 0, 0, 173, 166, 0, + 0, 0, 0, 174, 0, 0, 0, 167, 0, 168, + 0, 0, 0, 0, 0, 0, 175, 0, 0, 0, + 169, 0, 170, 74, 0, 47, 48, 0, 0, 0, + 171, 0, 0, 172, 75, 50, 0, 0, 0, 173, + 0, 0, 51, 0, 0, 174, 52, 53, 0, 54, + 0, 0, 0, 0, 0, 0, 57, 0, 175, 164, + 60, 0, 0, 0, 0, 0, 0, 0, 0, 165, + 0, 0, 0, 166, 0, 0, 0, 0, 63, 0, + 64, 0, 167, 0, 168, 0, 0, 319, 0, 0, + 0, 59, 66, 49, 0, 169, 0, 170, 74, 0, + 0, 47, 48, 0, 0, 171, 0, 0, 172, 75, + 0, 50, 0, 0, 173, 0, 0, 0, 51, 0, + 174, 0, 52, 53, 0, 54, 0, 0, 0, 0, + 0, 0, 57, 175, 0, 0, 60, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 63, 0, 64, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 59, 66, 49, + 0, 0, 0, 0, 0, 0, 0, 46, 47, 48, + 0, 0, 0, 0, 0, 0, 0, 0, 50, 0, + 0, 0, 0, 0, 0, 51, 0, 0, 0, 52, + 53, 0, 54, 0, 0, 0, 55, 0, 56, 57, + 58, 0, 0, 60, 0, 0, 0, 61, 0, 62, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 63, 0, 64, 0, 65, 0, 67, 0, 68, + 0, 0, 0, 0, 59, 66, 49, 0, 0, 0, + 0, 0, 0, 0, 46, 47, 48, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 0, 0, 0, 0, + 0, 0, 51, 0, 0, 0, 52, 53, 0, 54, + 0, 0, 0, 55, 0, 56, 57, 58, 0, 0, + 60, 0, 0, 0, 61, 0, 62, 0, 0, 483, + 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, + 64, 0, 65, 0, 67, 0, 68, 0, 0, 0, + 0, 59, 66, 49, 0, 0, 0, 0, 0, 0, + 0, -66, 0, 0, 0, 46, 47, 48, 0, 0, 0, 0, 0, 0, 0, 0, 50, 0, 0, 0, - 51, 52, 0, 53, 0, 0, 62, 0, 63, 0, - 56, 0, 163, 0, 59, 89, 90, 0, 0, 58, - 65, 48, 164, 91, 92, 0, 165, 93, 0, 94, - 0, 0, 62, 0, 63, 166, 0, 167, 0, 0, - 318, 0, 0, 0, 0, 58, 65, 48, 168, 0, - 169, 73, 0, 0, 0, 0, 0, 0, 170, 0, - 0, 171, 74, 0, 0, 0, 0, 172, 0, 0, - 0, 0, 0, 173, 0, 0, 0, 0, 0, 0, - 163, 0, 0, 0, 0, 0, 174, 0, 0, 0, - 164, 0, 0, 0, 165, 0, 0, 0, 0, 0, - 0, 0, 0, 166, 0, 167, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 168, 0, 169, 73, - 0, 0, 0, 0, 0, 0, 170, 0, 0, 171, - 74, 0, 0, 0, 0, 172, 0, 0, 0, 0, - 0, 173, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 174, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 45, 46, 47, 0, 0, - 0, 0, 0, 0, 0, 0, 49, 0, 0, 0, - 0, 0, 0, 50, 0, 0, 0, 51, 52, 0, - 53, 0, 0, 0, 54, 0, 55, 56, 57, 0, - 0, 59, 0, 0, 0, 60, 0, 61, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, - 0, 63, 0, 64, 0, 66, 0, 67, 0, 0, - 0, 0, 58, 65, 48, 0, 0, 0, 0, 0, - 0, 0, 45, 46, 47, 0, 0, 0, 0, 0, - 0, 0, 0, 49, 0, 0, 0, 0, 0, 0, - 50, 0, 0, 0, 51, 52, 0, 53, 0, 0, - 0, 54, 0, 55, 56, 57, 0, 0, 59, 0, - 0, 0, 60, 0, 61, 0, 0, 482, 0, 0, - 0, 0, 0, 0, 0, 0, 62, 0, 63, 0, - 64, 0, 66, 0, 67, 0, 0, 0, 0, 58, - 65, 48, 0, 0, 0, 0, 0, 0, 0, -65, - 0, 0, 0, 45, 46, 47, 0, 0, 0, 0, - 0, 0, 0, 0, 49, 0, 0, 0, 0, 0, - 0, 50, 0, 0, 0, 51, 52, 0, 53, 0, - 0, 0, 54, 0, 55, 56, 57, 0, 0, 59, - 0, 0, 0, 60, 0, 61, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 62, 0, 63, - 0, 64, 0, 66, 0, 67, 0, 0, 0, 0, - 58, 65, 48, 0, 0, 0, 0, 0, 0, 0, - 45, 46, 47, 0, 0, 0, 0, 0, 0, 0, - 0, 49, 0, 0, 0, 0, 0, 0, 50, 0, - 0, 0, 51, 52, 0, 53, 0, 0, 0, 54, - 0, 55, 56, 57, 0, 0, 59, 0, 0, 0, - 60, 0, 61, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 62, 0, 63, 0, 64, 0, - 66, 281, 67, 0, 0, 0, 0, 58, 65, 48, - 0, 0, 0, 0, 0, 0, 0, 45, 46, 47, - 0, 0, 0, 0, 0, 0, 0, 0, 49, 0, - 0, 0, 0, 0, 0, 50, 0, 0, 0, 51, - 52, 0, 53, 0, 0, 0, 54, 0, 55, 56, - 57, 0, 0, 59, 0, 0, 0, 60, 0, 61, - 0, 0, 485, 0, 0, 0, 0, 0, 0, 0, - 0, 62, 0, 63, 0, 64, 0, 66, 0, 67, - 0, 0, 0, 0, 58, 65, 48, 0, 0, 0, - 0, 0, 0, 0, 119, 120, 121, 0, 0, 123, - 125, 126, 0, 0, 127, 0, 128, 0, 0, 0, - 130, 131, 132, 0, 0, 0, 0, 0, 0, 133, - 134, 135, 136, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 137, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 140, - 0, 0, 0, 0, 0, 0, 141, 142, 143, 0, - 145, 146, 147, 148, 149, 150, 0, 0, 138, 144, - 129, 122, 124, 139, 0, 0, 0, 0, 119, 120, - 121, 0, 0, 123, 125, 126, 0, 0, 127, 0, - 128, 0, 0, 0, 130, 131, 132, 0, 0, 0, - 0, 0, 0, 401, 134, 135, 136, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 137, 0, 0, - 0, 402, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 140, 0, 0, 0, 0, 0, 404, - 141, 142, 143, 0, 145, 146, 147, 148, 149, 150, - 0, 0, 138, 144, 129, 122, 124, 139, 0, 0, - 0, 0, 119, 120, 121, 0, 0, 123, 125, 126, - 0, 0, 127, 0, 128, 0, 0, 0, 130, 131, - 132, 0, 0, 0, 0, 0, 0, 401, 134, 135, - 136, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 137, 0, 0, 0, 402, 0, 0, 0, 0, - 0, 0, 0, 403, 0, 0, 0, 140, 0, 0, - 0, 0, 0, 404, 141, 142, 143, 0, 145, 146, - 147, 148, 149, 150, 0, 0, 138, 144, 129, 122, - 124, 139, 0, 0, 0, 0, 221, 0, 0, 0, - 0, 223, 0, 45, 46, 47, 225, 0, 0, 0, - 0, 0, 0, 226, 49, 0, 0, 0, 0, 0, - 0, 497, 229, 0, 0, 230, 498, 0, 53, 0, - 0, 0, 54, 0, 55, 56, 57, 0, 0, 59, - 0, 0, 0, 60, 0, 61, 0, 0, 0, 0, - 0, 231, 0, 232, 0, 0, 0, 62, 233, 63, - 234, 64, 235, 66, 236, 67, 237, 238, 0, 0, - 58, 65, 48, 222, 224, 0, 0, 0, 0, 0, - 221, 0, 0, 0, 0, 223, 0, 45, 46, 47, - 225, 0, 0, 0, 0, 0, 0, 226, 49, 0, - 0, 0, 0, 0, 0, 228, 229, 0, 0, 230, - 52, 0, 53, 0, 0, 0, 54, 0, 55, 56, - 57, 0, 0, 59, 0, 0, 0, 60, 0, 61, - 0, 0, 0, 0, 0, 231, 0, 232, 0, 0, - 0, 62, 233, 63, 234, 64, 235, 66, 236, 67, - 237, 238, 0, 0, 58, 65, 48, 222, 224, 0, - 0, 0, 0, 0, 221, 0, 0, 0, 0, 223, - 0, 45, 46, 47, 225, 0, 0, 0, 0, 0, - 0, 226, 227, 0, 0, 0, 0, 0, 0, 228, - 229, 0, 0, 230, 52, 0, 53, 0, 0, 0, - 54, 0, 55, 56, 57, 0, 0, 59, 0, 0, - 0, 60, 0, 61, 0, 0, 0, 0, 0, 231, - 0, 232, 0, 0, 0, 62, 233, 63, 234, 64, - 235, 66, 236, 67, 237, 238, 0, 0, 58, 65, - 48, 222, 224, 0, 0, 0, 0, 0, 371, 120, - 121, 0, 0, 373, 125, 375, 46, 47, 376, 0, - 128, 0, 0, 0, 130, 378, 379, 0, 0, 0, - 0, 0, 0, 380, 381, 135, 136, 230, 52, 0, - 53, 0, 0, 0, 54, 0, 55, 382, 57, 0, - 0, 384, 0, 0, 0, 60, 0, 61, 0, -211, - 0, 0, 0, 385, 0, 232, 0, 0, 0, 386, - 387, 388, 389, 64, 391, 392, 393, 394, 395, 396, - 0, 0, 383, 390, 377, 372, 374, 139, 0, 0, - 0, 0, - - 437, 499, 181, 419, 21, 263, 500, 427, 431, 486, - 435, 19, 183, 441, 447, 438, 21, 481, 484, 480, - 473, 312, 33, 462, 469, 451, 260, 434, 21, 11, - 452, 188, 219, 162, 161, 460, 456, 458, 118, 351, - 359, 344, 441, 151, 357, 406, 346, 175, 312, 438, - 398, 348, 317, 159, 496, 339, 319, 321, 400, 408, - 157, 361, 363, 154, 219, 0, 312, 219, 71, 0, - 0, 312, 99, 0, 0, 312, 71, 0, 454, 312, - 0, 71, 0, 0, 71, 101, 71, 71, 0, 297, - 71, 71, 298, 410, 71, 296, 411, 71, 111, 295, - 71, 113, 106, 157, 71, 294, 71, 313, 100, 71, - 413, 490, 315, 71, 83, 80, 340, 71, 71, 71, - 342, 453, 105, 71, 71, 488, 454, 71, 71, 79, - 78, 71, 177, 71, 72, 453, 71, 71, 493, 0, - 81, 260, 276, 71, 354, 491, 71, 280, 492, 71, - 410, 489, 247, 411, 71, 71, 0, 71, 71, 95, - 192, 109, 103, 71, 157, 71, 71, 71, 104, 192, - 102, 190, 107, 71, 71, 0, 71, 0, 71, 71, - 88, 308, 108, 280, 280, 300, 280, 71, 71, 180, - 305, 71, 280, 280, 71, 0, 280, 283, 0, 280, - 303, 299, 308, 310, 71, 71, 323, 280, 308, 280, - 280, 288, 301, 280, 71, 308, 308, 0, 0, 280, - 280, 280, 0, 0, 336, 0, 0, 0, 118, 187, - 329, 326, 0, 0, 0, 0, 0, 327, 307, 0, + 0, 0, 0, 51, 0, 0, 0, 52, 53, 0, + 54, 0, 0, 0, 55, 0, 56, 57, 58, 0, + 0, 60, 0, 0, 0, 61, 0, 62, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, + 0, 64, 0, 65, 0, 67, 0, 68, 0, 0, + 0, 0, 59, 66, 49, 0, 0, 0, 0, 0, + 0, 0, 46, 47, 48, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 0, 0, 0, 0, 0, 0, + 51, 0, 0, 0, 52, 53, 0, 54, 0, 0, + 0, 55, 0, 56, 57, 58, 0, 0, 60, 0, + 0, 0, 61, 0, 62, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 63, 0, 64, 0, + 65, 0, 67, 282, 68, 0, 0, 0, 0, 59, + 66, 49, 0, 0, 0, 0, 0, 0, 0, 46, + 47, 48, 0, 0, 0, 0, 0, 0, 0, 0, + 50, 0, 0, 0, 0, 0, 0, 51, 0, 0, + 0, 52, 53, 0, 54, 0, 0, 0, 55, 0, + 56, 57, 58, 0, 0, 60, 0, 0, 0, 61, + 0, 62, 0, 0, 486, 0, 0, 0, 0, 0, + 0, 0, 0, 63, 0, 64, 0, 65, 0, 67, + 0, 68, 0, 0, 0, 0, 59, 66, 49, 0, + 0, 0, 0, 0, 0, 0, 120, 121, 122, 0, + 0, 124, 126, 127, 0, 0, 128, 0, 129, 0, + 0, 0, 131, 132, 133, 0, 0, 0, 0, 0, + 0, 134, 135, 136, 137, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 138, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 141, 0, 0, 0, 0, 0, 0, 142, 143, + 144, 0, 146, 147, 148, 149, 150, 151, 0, 0, + 139, 145, 130, 123, 125, 140, 0, 0, 0, 0, + 120, 121, 122, 0, 0, 124, 126, 127, 0, 0, + 128, 0, 129, 0, 0, 0, 131, 132, 133, 0, + 0, 0, 0, 0, 0, 402, 135, 136, 137, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 138, + 0, 0, 0, 403, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 141, 0, 0, 0, 0, + 0, 405, 142, 143, 144, 0, 146, 147, 148, 149, + 150, 151, 0, 0, 139, 145, 130, 123, 125, 140, + 0, 0, 0, 0, 120, 121, 122, 0, 0, 124, + 126, 127, 0, 0, 128, 0, 129, 0, 0, 0, + 131, 132, 133, 0, 0, 0, 0, 0, 0, 402, + 135, 136, 137, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 138, 0, 0, 0, 403, 0, 0, + 0, 0, 0, 0, 0, 404, 0, 0, 0, 141, + 0, 0, 0, 0, 0, 405, 142, 143, 144, 0, + 146, 147, 148, 149, 150, 151, 0, 0, 139, 145, + 130, 123, 125, 140, 0, 0, 0, 0, 222, 0, + 0, 0, 0, 224, 0, 46, 47, 48, 226, 0, + 0, 0, 0, 0, 0, 227, 50, 0, 0, 0, + 0, 0, 0, 229, 230, 0, 0, 231, 53, 0, + 54, 0, 0, 0, 55, 0, 56, 57, 58, 0, + 0, 60, 0, 0, 0, 61, 0, 62, 0, 0, + 0, 0, 0, 232, 0, 233, 0, 0, 0, 63, + 234, 64, 235, 65, 236, 67, 237, 68, 238, 239, + 0, 0, 59, 66, 49, 223, 225, 0, 0, 0, + 0, 0, 222, 0, 0, 0, 0, 224, 0, 46, + 47, 48, 226, 0, 0, 0, 0, 0, 0, 227, + 50, 0, 0, 0, 0, 0, 0, 498, 230, 0, + 0, 231, 499, 0, 54, 0, 0, 0, 55, 0, + 56, 57, 58, 0, 0, 60, 0, 0, 0, 61, + 0, 62, 0, 0, 0, 0, 0, 232, 0, 233, + 0, 0, 0, 63, 234, 64, 235, 65, 236, 67, + 237, 68, 238, 239, 0, 0, 59, 66, 49, 223, + 225, 0, 0, 0, 0, 0, 222, 0, 0, 0, + 0, 224, 0, 46, 47, 48, 226, 0, 0, 0, + 0, 0, 0, 227, 228, 0, 0, 0, 0, 0, + 0, 229, 230, 0, 0, 231, 53, 0, 54, 0, + 0, 0, 55, 0, 56, 57, 58, 0, 0, 60, + 0, 0, 0, 61, 0, 62, 0, 0, 0, 0, + 0, 232, 0, 233, 0, 0, 0, 63, 234, 64, + 235, 65, 236, 67, 237, 68, 238, 239, 0, 0, + 59, 66, 49, 223, 225, 0, 0, 0, 0, 0, + 372, 121, 122, 0, 0, 374, 126, 376, 47, 48, + 377, 0, 129, 0, 0, 0, 131, 379, 380, 0, + 0, 0, 0, 0, 0, 381, 382, 136, 137, 231, + 53, 0, 54, 0, 0, 0, 55, 0, 56, 383, + 58, 0, 0, 385, 0, 0, 0, 61, 0, 62, + 0, -212, 0, 0, 0, 386, 0, 233, 0, 0, + 0, 387, 388, 389, 390, 65, 392, 393, 394, 395, + 396, 397, 0, 0, 384, 391, 378, 373, 375, 140, + 0, 0, 0, 0, + + 22, 432, 500, 436, 501, 428, 438, 497, 435, 487, + 420, 453, 442, 182, 20, 264, 439, 482, 474, 481, + 313, 34, 22, 189, 470, 485, 463, 452, 22, 448, + 184, 163, 261, 162, 461, 457, 220, 459, 119, 352, + 347, 345, 442, 152, 439, 407, 349, 399, 261, 340, + 313, 160, 155, 364, 362, 0, 360, 358, 322, 176, + 320, 409, 318, 0, 313, 401, 313, 158, 72, 313, + 313, 0, 220, 295, 0, 220, 0, 0, 0, 0, + 119, 188, 72, 0, 72, 72, 100, 454, 102, 72, + 11, 72, 72, 101, 72, 72, 298, 296, 72, 297, + 107, 72, 72, 72, 72, 341, 299, 316, 114, 89, + 314, 343, 84, 72, 112, 490, 72, 72, 80, 489, + 72, 72, 72, 455, 454, 106, 72, 411, 79, 72, + 412, 72, 73, 455, 72, 72, 494, 72, 82, 493, + 72, 72, 491, 492, 277, 72, 72, 81, 72, 281, + 411, 96, 355, 412, 110, 72, 0, 72, 72, 72, + 248, 193, 103, 104, 72, 72, 72, 72, 193, 105, + 158, 181, 72, 108, 0, 72, 0, 191, 109, 178, + 281, 158, 72, 0, 309, 72, 306, 281, 414, 281, + 281, 309, 0, 0, 72, 72, 281, 324, 304, 281, + 281, 289, 301, 72, 309, 0, 311, 72, 281, 281, + 300, 0, 281, 330, 309, 72, 284, 0, 309, 281, + 281, 0, 302, 281, 0, 0, 337, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 328, 0, 0, 0, + 308, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 72, 0, 0, 0, 0, 281, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 327, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0}; + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; const int JavaScriptGrammar::action_check [] = { - 55, 76, 1, 7, 7, 29, 55, 36, 36, 7, - 7, 33, 31, 61, 16, 7, 17, 48, 60, 8, - 55, 2, 60, 29, 60, 36, 36, 7, 7, 1, - 17, 8, 48, 29, 29, 76, 7, 60, 29, 33, - 65, 0, 85, 29, 29, 33, 8, 29, 8, 33, - 2, 8, 7, 36, 29, 60, 7, 7, 36, 33, - 36, 29, 2, 33, 20, 55, 7, 60, 5, 5, - 5, 29, 1, 36, 8, 29, 76, 1, 85, 7, - 33, 29, 2, 48, 29, 7, 7, 36, 61, 36, - 36, 60, 8, 60, 36, 7, 8, 36, 36, 8, - 33, 6, 8, 10, 8, 48, 8, 8, -1, -1, - 76, 55, 33, 74, 40, 20, 29, 8, 8, 29, - 7, 29, 8, -1, 33, 51, 36, 8, 15, 61, - 61, 62, 50, 50, 61, 62, 54, 54, 61, 62, - 40, 40, 61, 62, 8, 42, 61, 62, 55, 8, - 8, 51, 51, 29, 60, 8, 53, 61, 60, 60, - 12, 29, 40, 61, 62, 61, 62, 29, 12, 60, - 60, 84, 8, 51, 60, 56, 84, 25, 25, 27, - 27, -1, 25, 25, 27, 27, 8, -1, 15, 29, - 38, 38, 56, 61, 62, 38, 38, 29, 29, 61, - 62, 60, 60, 56, 25, 57, 27, 34, 84, 36, - 25, 63, 27, 57, 25, 29, 27, 38, 25, 63, - 27, 61, 62, 38, 8, 56, 8, 38, 15, 61, - 62, 38, 25, 25, 27, 27, 8, 12, -1, 61, - 62, 55, 25, -1, 27, 38, 38, 34, 25, 36, - 27, -1, 15, 84, 25, 38, 27, 29, 18, 19, - -1, 38, 18, 19, -1, -1, -1, 38, -1, -1, - 84, 34, -1, 36, -1, -1, -1, 61, 62, 61, - 62, -1, 57, 23, 24, 45, 46, -1, 63, 45, - 46, -1, 32, 23, 24, 35, -1, 37, -1, 23, - 24, -1, 32, -1, -1, 35, -1, 37, 32, 23, - 24, 35, 84, 37, -1, 23, 24, -1, 32, -1, - -1, 35, -1, 37, 32, 18, 19, 35, -1, 37, - -1, -1, -1, 12, 13, -1, -1, -1, -1, -1, - -1, -1, -1, 22, -1, -1, -1, -1, -1, -1, - 29, -1, 45, 46, 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, 76, 55, 29, 55, 7, 36, 29, 8, 7, + 7, 36, 55, 8, 61, 7, 31, 7, 17, 60, + 2, 29, 16, 60, 48, 60, 33, 7, 60, 8, + 36, 36, 17, 29, 7, 1, 48, 60, 29, 8, + 33, 29, 0, 29, 65, 85, 29, 8, 29, 33, + 2, 8, 7, 7, 29, 33, 76, 7, 29, 36, + 36, 33, 36, 2, 20, 33, 7, 5, 55, 5, + 5, 60, 1, 36, 8, 1, 29, 36, 29, 7, + 29, 85, -1, 8, 7, -1, 48, 7, 33, 36, + 36, 61, 36, 60, 36, 60, 33, 29, 10, 8, + 8, -1, 8, 36, 8, 48, 7, 8, 8, 7, + 7, 6, 76, -1, 29, 55, 76, 15, 40, 8, + 50, 40, 8, -1, 54, 20, 74, 8, 8, 51, + 61, 8, 51, 33, 61, 62, 33, 61, 62, 8, + 61, 62, 29, 55, 40, 29, 40, 61, 62, 36, + 42, 60, 8, 61, 60, 51, 60, 51, 61, 62, + 50, 53, 61, 62, 54, 8, 29, 12, 2, 84, + 56, 60, 8, 61, 62, 56, 56, 25, 29, 27, + 29, 12, 29, 60, 25, 8, 27, 15, -1, -1, + 38, 60, 25, 29, 27, -1, -1, 38, 61, 62, + 84, -1, 29, 29, 60, 38, 34, 56, 36, -1, + 61, 62, 57, -1, 61, 62, 12, 60, 63, -1, + 25, 25, 27, 27, 8, 15, 57, 8, 55, 55, + -1, -1, 63, 38, 38, 84, 29, -1, 61, 62, + 25, -1, 27, 25, 34, 27, 36, 25, 84, 27, + 25, -1, 27, 38, 15, -1, 38, 84, 84, -1, + 38, 57, -1, 38, 18, 19, -1, 63, 61, 62, + 18, 19, -1, 34, -1, 36, -1, 61, 62, -1, + 61, 62, 18, 19, 18, 19, -1, -1, -1, -1, + -1, 45, 46, 23, 24, -1, -1, 45, 46, -1, + -1, -1, 32, -1, -1, 35, -1, 37, -1, 45, + 46, 45, 46, -1, 23, 24, -1, -1, -1, -1, + -1, 23, 24, 32, -1, -1, 35, 25, 37, 27, + 32, -1, -1, 35, -1, 37, 23, 24, -1, -1, + 38, -1, -1, -1, 31, 32, 23, 24, 35, -1, + 37, -1, -1, -1, 31, 32, 23, 24, 35, -1, + 37, -1, -1, -1, 31, 32, 23, 24, 35, -1, + 37, -1, 3, -1, 31, 32, -1, -1, 35, -1, + 37, -1, 13, -1, 23, 24, 17, -1, -1, -1, + 23, 24, 31, 32, -1, 26, 35, 28, 37, 32, + -1, -1, 35, -1, 37, -1, -1, -1, 39, -1, + 41, 42, -1, -1, 3, -1, -1, -1, 49, -1, + -1, 52, 53, -1, 13, -1, -1, 58, 17, -1, + -1, -1, -1, 64, -1, -1, -1, 26, -1, 28, + -1, -1, -1, -1, -1, -1, 77, -1, -1, -1, + 39, -1, 41, 42, -1, 12, 13, -1, -1, -1, + 49, -1, -1, 52, 53, 22, -1, -1, -1, 58, + -1, -1, 29, -1, -1, 64, 33, 34, -1, 36, + -1, -1, -1, -1, -1, -1, 43, -1, 77, 3, + 47, -1, -1, -1, -1, -1, -1, -1, -1, 13, + -1, -1, -1, 17, -1, -1, -1, -1, 65, -1, + 67, -1, 26, -1, 28, -1, -1, 31, -1, -1, + -1, 78, 79, 80, -1, 39, -1, 41, 42, -1, + -1, 12, 13, -1, -1, 49, -1, -1, 52, 53, + -1, 22, -1, -1, 58, -1, -1, -1, 29, -1, + 64, -1, 33, 34, -1, 36, -1, -1, -1, -1, + -1, -1, 43, 77, -1, -1, 47, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 65, -1, 67, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 78, 79, 80, + -1, -1, -1, -1, -1, -1, -1, 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, 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, @@ -498,59 +528,60 @@ const int JavaScriptGrammar::action_check [] = { -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, 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, 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, -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, 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, + 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, 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, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 59, - -1, -1, -1, -1, -1, -1, 66, 67, 68, -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, 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, + 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, 83, -1, -1, -1, -1, 4, -1, -1, -1, + 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, @@ -559,62 +590,47 @@ const int JavaScriptGrammar::action_check [] = { -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, + 4, 5, 6, -1, -1, 9, 10, 11, 12, 13, + 14, -1, 16, -1, -1, -1, 20, 21, 22, -1, + -1, -1, -1, -1, -1, 29, 30, 31, 32, 33, 34, -1, 36, -1, -1, -1, 40, -1, 42, 43, 44, -1, -1, 47, -1, -1, -1, 51, -1, 53, - -1, -1, -1, -1, -1, 59, -1, 61, -1, -1, + -1, 55, -1, -1, -1, 59, -1, 61, -1, -1, -1, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, -1, -1, 78, 79, 80, 81, 82, -1, - -1, -1, -1, -1, 4, -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, + 74, 75, -1, -1, 78, 79, 80, 81, 82, 83, + -1, -1, -1, -1, - 69, 7, 16, 10, 6, 10, 2, 84, 81, 10, - 10, 2, 16, 54, 86, 10, 6, 16, 16, 12, - 73, 10, 10, 9, 16, 54, 9, 69, 6, 5, - 54, 10, 9, 50, 7, 10, 10, 9, 19, 88, - 10, 9, 54, 10, 9, 16, 10, 16, 10, 10, - 16, 9, 9, 16, 9, 75, 10, 9, 18, 9, - 16, 9, 9, 16, 9, -1, 10, 9, 27, -1, - -1, 10, 31, -1, -1, 10, 27, -1, 29, 10, - -1, 27, -1, -1, 27, 31, 27, 27, -1, 32, - 27, 27, 32, 21, 27, 32, 24, 27, 39, 32, - 27, 37, 32, 16, 27, 32, 27, 51, 31, 27, - 23, 29, 51, 27, 35, 29, 51, 27, 27, 27, - 51, 29, 32, 27, 27, 29, 29, 27, 27, 29, - 29, 27, 41, 27, 30, 29, 27, 27, 29, -1, - 30, 9, 27, 27, 89, 29, 27, 32, 29, 27, - 21, 29, 94, 24, 27, 27, -1, 27, 27, 32, - 29, 33, 32, 27, 16, 27, 27, 27, 32, 29, - 32, 23, 33, 27, 27, -1, 27, -1, 27, 27, - 33, 27, 33, 32, 32, 34, 32, 27, 27, 43, - 38, 27, 32, 32, 27, -1, 32, 36, -1, 32, - 40, 34, 27, 49, 27, 27, 42, 32, 27, 32, - 32, 34, 34, 32, 27, 27, 27, -1, -1, 32, - 32, 32, -1, -1, 49, -1, -1, -1, 19, 20, - 49, 44, -1, -1, -1, -1, -1, 49, 49, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 6, 81, 7, 10, 2, 84, 69, 9, 69, 10, + 10, 54, 54, 16, 2, 10, 10, 16, 73, 12, + 10, 10, 6, 10, 16, 16, 9, 54, 6, 86, + 16, 50, 9, 7, 10, 10, 9, 9, 19, 88, + 10, 9, 54, 10, 10, 16, 9, 16, 9, 75, + 10, 16, 16, 9, 9, -1, 10, 9, 9, 16, + 10, 9, 9, -1, 10, 18, 10, 16, 27, 10, + 10, -1, 9, 32, -1, 9, -1, -1, -1, -1, + 19, 20, 27, -1, 27, 27, 31, 29, 31, 27, + 5, 27, 27, 31, 27, 27, 32, 32, 27, 32, + 32, 27, 27, 27, 27, 51, 32, 51, 37, 33, + 51, 51, 35, 27, 39, 29, 27, 27, 29, 29, + 27, 27, 27, 29, 29, 32, 27, 21, 29, 27, + 24, 27, 30, 29, 27, 27, 29, 27, 30, 29, + 27, 27, 29, 29, 27, 27, 27, 29, 27, 32, + 21, 32, 89, 24, 33, 27, -1, 27, 27, 27, + 94, 29, 32, 32, 27, 27, 27, 27, 29, 32, + 16, 43, 27, 33, -1, 27, -1, 23, 33, 41, + 32, 16, 27, -1, 27, 27, 38, 32, 23, 32, + 32, 27, -1, -1, 27, 27, 32, 42, 40, 32, + 32, 34, 34, 27, 27, -1, 49, 27, 32, 32, + 34, -1, 32, 49, 27, 27, 36, -1, 27, 32, + 32, -1, 34, 32, -1, -1, 49, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 49, -1, -1, -1, + 49, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 27, -1, -1, -1, -1, 32, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 44, -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, -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 6f2debf..12c2566 100644 --- a/src/declarative/qml/parser/javascriptgrammar_p.h +++ b/src/declarative/qml/parser/javascriptgrammar_p.h @@ -96,14 +96,14 @@ public: T_XOR_EQ = 77, ACCEPT_STATE = 7, - RULE_COUNT = 288, - STATE_COUNT = 503, + RULE_COUNT = 289, + STATE_COUNT = 504, TERMINAL_COUNT = 88, NON_TERMINAL_COUNT = 96, - GOTO_INDEX_OFFSET = 503, - GOTO_INFO_OFFSET = 1522, - GOTO_CHECK_OFFSET = 1522 + GOTO_INDEX_OFFSET = 504, + GOTO_INFO_OFFSET = 1584, + GOTO_CHECK_OFFSET = 1584 }; static const char *const spell []; diff --git a/src/declarative/qml/parser/javascriptparser.cpp b/src/declarative/qml/parser/javascriptparser.cpp index adcd8a3..b91ff5b 100644 --- a/src/declarative/qml/parser/javascriptparser.cpp +++ b/src/declarative/qml/parser/javascriptparser.cpp @@ -202,13 +202,20 @@ case 9: { } break; case 10: { + AST::UiObjectInitializer *node = makeAstNode (driver->nodePool(), (AST::UiObjectMemberList*)0); + node->lbraceToken = loc(1); + node->rbraceToken = loc(2); + sym(1).Node = node; +} break; + +case 11: { AST::UiObjectInitializer *node = makeAstNode (driver->nodePool(), sym(2).UiObjectMemberList->finish()); node->lbraceToken = loc(1); node->rbraceToken = loc(3); sym(1).Node = node; } break; -case 11: { +case 12: { AST::UiObjectBinding *node = makeAstNode (driver->nodePool(), sym(1).UiQualifiedId->finish(), sym(3).sval, sym(4).UiObjectInitializer); node->colonToken = loc(2); @@ -216,14 +223,14 @@ case 11: { sym(1).Node = node; } break; -case 12: { +case 13: { AST::UiObjectDefinition *node = makeAstNode (driver->nodePool(), sym(1).sval, sym(2).UiObjectInitializer); node->identifierToken = loc(1); sym(1).Node = node; } break; -case 13: { +case 14: { AST::UiArrayBinding *node = makeAstNode (driver->nodePool(), sym(1).UiQualifiedId->finish(), sym(4).UiObjectMemberList->finish()); node->colonToken = loc(2); @@ -232,14 +239,14 @@ case 13: { sym(1).Node = node; } break; -case 14: { +case 15: { AST::UiScriptBinding *node = makeAstNode (driver->nodePool(), sym(1).UiQualifiedId->finish(), sym(3).Statement); node->colonToken = loc(2); sym(1).Node = node; } break; -case 15: { +case 16: { AST::UiPublicMember *node = makeAstNode (driver->nodePool(), sym(2).sval, sym(3).sval, sym(5).Expression, sym(6).UiObjectInitializer); node->publicToken = loc(1); @@ -249,7 +256,7 @@ case 15: { sym(1).Node = node; } break; -case 16: { +case 17: { AST::UiPublicMember *node = makeAstNode (driver->nodePool(), sym(2).sval, sym(3).sval); node->publicToken = loc(1); node->attributeTypeToken = loc(2); @@ -257,7 +264,7 @@ case 16: { sym(1).Node = node; } break; -case 17: { +case 18: { AST::UiPublicMember *node = makeAstNode (driver->nodePool(), sym(2).sval, sym(3).sval, sym(5).Expression, static_cast(0)); node->publicToken = loc(1); @@ -267,61 +274,61 @@ case 17: { sym(1).Node = node; } break; -case 18: { +case 19: { AST::UiQualifiedId *node = makeAstNode (driver->nodePool(), sym(1).sval); node->identifierToken = loc(1); sym(1).Node = node; } break; -case 19: { +case 20: { AST::UiQualifiedId *node = makeAstNode (driver->nodePool(), sym(1).UiQualifiedId, sym(3).sval); node->identifierToken = loc(3); sym(1).Node = node; } break; -case 20: { +case 21: { AST::ThisExpression *node = makeAstNode (driver->nodePool()); node->thisToken = loc(1); sym(1).Node = node; } break; -case 21: { +case 22: { AST::IdentifierExpression *node = makeAstNode (driver->nodePool(), sym(1).sval); node->identifierToken = loc(1); sym(1).Node = node; } break; -case 22: { +case 23: { AST::NullExpression *node = makeAstNode (driver->nodePool()); node->nullToken = loc(1); sym(1).Node = node; } break; -case 23: { +case 24: { AST::TrueLiteral *node = makeAstNode (driver->nodePool()); node->trueToken = loc(1); sym(1).Node = node; } break; -case 24: { +case 25: { AST::FalseLiteral *node = makeAstNode (driver->nodePool()); node->falseToken = loc(1); sym(1).Node = node; } break; -case 25: { +case 26: { AST::NumericLiteral *node = makeAstNode (driver->nodePool(), sym(1).dval); node->literalToken = loc(1); sym(1).Node = node; } break; -case 26: { +case 27: { AST::StringLiteral *node = makeAstNode (driver->nodePool(), sym(1).sval); node->literalToken = loc(1); sym(1).Node = node; } break; -case 27: { +case 28: { bool rx = lexer->scanRegExp(Lexer::NoPrefix); if (!rx) { diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, lexer->startLineNo(), @@ -333,7 +340,7 @@ case 27: { sym(1).Node = node; } break; -case 28: { +case 29: { bool rx = lexer->scanRegExp(Lexer::EqualPrefix); if (!rx) { diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, lexer->startLineNo(), @@ -345,83 +352,81 @@ case 28: { sym(1).Node = node; } break; -case 29: { +case 30: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Elision); } break; -case 30: { +case 31: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).ElementList->finish ()); } break; -case 31: { +case 32: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).ElementList->finish (), sym(4).Elision); } break; -case 32: { +case 33: { if (sym(2).Node) sym(1).Node = makeAstNode (driver->nodePool(), sym(2).PropertyNameAndValueList->finish ()); else sym(1).Node = makeAstNode (driver->nodePool()); } break; -case 33: { +case 34: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).PropertyNameAndValueList->finish ()); } break; -case 34: { +case 35: { sym(1) = sym(2); } break; -case 35: { +case 36: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Elision, sym(2).Expression); } break; -case 36: { +case 37: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).ElementList, sym(3).Elision, sym(4).Expression); } break; -case 37: { +case 38: { sym(1).Node = makeAstNode (driver->nodePool()); } break; -case 38: { +case 39: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Elision); } break; -case 39: { +case 40: { sym(1).Node = 0; } break; -case 40: { +case 41: { sym(1).Elision = sym(1).Elision->finish (); } break; -case 41: { +case 42: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).PropertyName, sym(3).Expression); } break; -case 42: { +case 43: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).PropertyNameAndValueList, sym(3).PropertyName, sym(5).Expression); } break; -case 43: { +case 44: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).sval); } break; -case 44: { +case 45: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).sval); } break; -case 45: { +case 46: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).dval); } break; -case 46: { +case 47: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).sval); } break; -case 47: - case 48: case 49: @@ -481,22 +486,24 @@ case 75: case 76: case 77: + +case 78: { sym(1).sval = driver->intern(lexer->characterBuffer(), lexer->characterCount()); } break; -case 82: { +case 83: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression); } break; -case 83: { +case 84: { AST::FieldMemberExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).sval); node->dotToken = loc(2); node->identifierToken = loc(3); sym(1).Node = node; } break; -case 84: { +case 85: { AST::NewMemberExpression *node = makeAstNode (driver->nodePool(), sym(2).Expression, sym(4).ArgumentList); node->newToken = loc(1); node->lparenToken = loc(3); @@ -504,541 +511,541 @@ case 84: { sym(1).Node = node; } break; -case 86: { +case 87: { AST::NewExpression *node = makeAstNode (driver->nodePool(), sym(2).Expression); node->newToken = loc(1); sym(1).Node = node; } break; -case 87: { +case 88: { AST::CallExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).ArgumentList); node->lparenToken = loc(2); node->rparenToken = loc(4); sym(1).Node = node; } break; -case 88: { +case 89: { AST::CallExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).ArgumentList); node->lparenToken = loc(2); node->rparenToken = loc(4); sym(1).Node = node; } break; -case 89: { +case 90: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression); } break; -case 90: { +case 91: { AST::FieldMemberExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).sval); node->dotToken = loc(2); node->identifierToken = loc(3); sym(1).Node = node; } break; -case 91: { +case 92: { sym(1).Node = 0; } break; -case 92: { +case 93: { sym(1).Node = sym(1).ArgumentList->finish(); } break; -case 93: { +case 94: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression); } break; -case 94: { +case 95: { AST::ArgumentList *node = makeAstNode (driver->nodePool(), sym(1).ArgumentList, sym(3).Expression); node->commaToken = loc(2); sym(1).Node = node; } break; -case 98: { +case 99: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression); } break; -case 99: { +case 100: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression); } break; -case 101: { +case 102: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); } break; -case 102: { +case 103: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); } break; -case 103: { +case 104: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); } break; -case 104: { +case 105: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); } break; -case 105: { +case 106: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); } break; -case 106: { +case 107: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); } break; -case 107: { +case 108: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); } break; -case 108: { +case 109: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); } break; -case 109: { +case 110: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); } break; -case 111: { +case 112: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Mul, sym(3).Expression); } break; -case 112: { +case 113: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Div, sym(3).Expression); } break; -case 113: { +case 114: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Mod, sym(3).Expression); } break; -case 115: { +case 116: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Add, sym(3).Expression); } break; -case 116: { +case 117: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Sub, sym(3).Expression); } break; -case 118: { +case 119: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::LShift, sym(3).Expression); } break; -case 119: { +case 120: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::RShift, sym(3).Expression); } break; -case 120: { +case 121: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::URShift, sym(3).Expression); } break; -case 122: { +case 123: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Lt, sym(3).Expression); } break; -case 123: { +case 124: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Gt, sym(3).Expression); } break; -case 124: { +case 125: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Le, sym(3).Expression); } break; -case 125: { +case 126: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Ge, sym(3).Expression); } break; -case 126: { +case 127: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::InstanceOf, sym(3).Expression); } break; -case 127: { +case 128: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::In, sym(3).Expression); } break; -case 129: { +case 130: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Lt, sym(3).Expression); } break; -case 130: { +case 131: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Gt, sym(3).Expression); } break; -case 131: { +case 132: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Le, sym(3).Expression); } break; -case 132: { +case 133: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Ge, sym(3).Expression); } break; -case 133: { +case 134: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::InstanceOf, sym(3).Expression); } break; -case 135: { +case 136: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Equal, sym(3).Expression); } break; -case 136: { +case 137: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::NotEqual, sym(3).Expression); } break; -case 137: { +case 138: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::StrictEqual, sym(3).Expression); } break; -case 138: { +case 139: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::StrictNotEqual, sym(3).Expression); } break; -case 140: { +case 141: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Equal, sym(3).Expression); } break; -case 141: { +case 142: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::NotEqual, sym(3).Expression); } break; -case 142: { +case 143: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::StrictEqual, sym(3).Expression); } break; -case 143: { +case 144: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::StrictNotEqual, sym(3).Expression); } break; -case 145: { +case 146: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::BitAnd, sym(3).Expression); } break; -case 147: { +case 148: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::BitAnd, sym(3).Expression); } break; -case 149: { +case 150: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::BitXor, sym(3).Expression); } break; -case 151: { +case 152: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::BitXor, sym(3).Expression); } break; -case 153: { +case 154: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::BitOr, sym(3).Expression); } break; -case 155: { +case 156: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::BitOr, sym(3).Expression); } break; -case 157: { +case 158: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::And, sym(3).Expression); } break; -case 159: { +case 160: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::And, sym(3).Expression); } break; -case 161: { +case 162: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Or, sym(3).Expression); } break; -case 163: { +case 164: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Or, sym(3).Expression); } break; -case 165: { +case 166: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression, sym(5).Expression); } break; -case 167: { +case 168: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression, sym(5).Expression); } break; -case 169: { +case 170: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(2).ival, sym(3).Expression); } break; -case 171: { +case 172: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(2).ival, sym(3).Expression); } break; -case 172: { +case 173: { sym(1).ival = QSOperator::Assign; } break; -case 173: { +case 174: { sym(1).ival = QSOperator::InplaceMul; } break; -case 174: { +case 175: { sym(1).ival = QSOperator::InplaceDiv; } break; -case 175: { +case 176: { sym(1).ival = QSOperator::InplaceMod; } break; -case 176: { +case 177: { sym(1).ival = QSOperator::InplaceAdd; } break; -case 177: { +case 178: { sym(1).ival = QSOperator::InplaceSub; } break; -case 178: { +case 179: { sym(1).ival = QSOperator::InplaceLeftShift; } break; -case 179: { +case 180: { sym(1).ival = QSOperator::InplaceRightShift; } break; -case 180: { +case 181: { sym(1).ival = QSOperator::InplaceURightShift; } break; -case 181: { +case 182: { sym(1).ival = QSOperator::InplaceAnd; } break; -case 182: { +case 183: { sym(1).ival = QSOperator::InplaceXor; } break; -case 183: { +case 184: { sym(1).ival = QSOperator::InplaceOr; } break; -case 185: { +case 186: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression); } break; -case 186: { +case 187: { sym(1).Node = 0; } break; -case 189: { +case 190: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression); } break; -case 190: { +case 191: { sym(1).Node = 0; } break; -case 207: { +case 208: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).StatementList); } break; -case 208: { +case 209: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Statement); } break; -case 209: { +case 210: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).StatementList, sym(2).Statement); } break; -case 210: { +case 211: { sym(1).Node = 0; } break; -case 211: { +case 212: { sym(1).Node = sym(1).StatementList->finish (); } break; -case 213: { +case 214: { AST::VariableStatement *node = makeAstNode (driver->nodePool(), sym(2).VariableDeclarationList->finish (/*readOnly=*/sym(1).ival == T_CONST)); node->declarationKindToken = loc(1); node->semicolonToken = loc(3); sym(1).Node = node; } break; -case 214: { +case 215: { sym(1).ival = T_CONST; } break; -case 215: { +case 216: { sym(1).ival = T_VAR; } break; -case 216: { +case 217: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).VariableDeclaration); } break; -case 217: { +case 218: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).VariableDeclarationList, sym(3).VariableDeclaration); } break; -case 218: { +case 219: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).VariableDeclaration); } break; -case 219: { +case 220: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).VariableDeclarationList, sym(3).VariableDeclaration); } break; -case 220: { +case 221: { AST::VariableDeclaration *node = makeAstNode (driver->nodePool(), sym(1).sval, sym(2).Expression); node->identifierToken = loc(1); sym(1).Node = node; } break; -case 221: { +case 222: { AST::VariableDeclaration *node = makeAstNode (driver->nodePool(), sym(1).sval, sym(2).Expression); node->identifierToken = loc(1); sym(1).Node = node; } break; -case 222: { +case 223: { sym(1) = sym(2); } break; -case 223: { +case 224: { sym(1).Node = 0; } break; -case 225: { +case 226: { sym(1) = sym(2); } break; -case 226: { +case 227: { sym(1).Node = 0; } break; -case 228: { +case 229: { sym(1).Node = makeAstNode (driver->nodePool()); } break; -case 230: { +case 231: { AST::ExpressionStatement *node = makeAstNode (driver->nodePool(), sym(1).Expression); node->semicolonToken = loc(2); sym(1).Node = node; } break; -case 231: { +case 232: { sym(1).Node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Statement, sym(7).Statement); } break; -case 232: { +case 233: { sym(1).Node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Statement); } break; -case 234: { +case 235: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Statement, sym(5).Expression); } break; -case 235: { +case 236: { sym(1).Node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Statement); } break; -case 236: { +case 237: { sym(1).Node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Expression, sym(7).Expression, sym(9).Statement); } break; -case 237: { +case 238: { sym(1).Node = makeAstNode (driver->nodePool(), sym(4).VariableDeclarationList->finish (/*readOnly=*/false), sym(6).Expression, sym(8).Expression, sym(10).Statement); } break; -case 238: { +case 239: { sym(1).Node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Expression, sym(7).Statement); } break; -case 239: { +case 240: { sym(1).Node = makeAstNode (driver->nodePool(), sym(4).VariableDeclaration, sym(6).Expression, sym(8).Statement); } break; -case 241: { +case 242: { sym(1).Node = makeAstNode (driver->nodePool()); } break; -case 243: { +case 244: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).sval); } break; -case 245: { +case 246: { sym(1).Node = makeAstNode (driver->nodePool()); } break; -case 247: { +case 248: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).sval); } break; -case 249: { +case 250: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); } break; -case 250: { +case 251: { sym(1).Node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Statement); } break; -case 251: { +case 252: { sym(1).Node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).CaseBlock); } break; -case 252: { +case 253: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).CaseClauses); } break; -case 253: { +case 254: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).CaseClauses, sym(3).DefaultClause, sym(4).CaseClauses); } break; -case 254: { +case 255: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).CaseClause); } break; -case 255: { +case 256: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).CaseClauses, sym(2).CaseClause); } break; -case 256: { +case 257: { sym(1).Node = 0; } break; -case 257: { +case 258: { sym(1).Node = sym(1).CaseClauses->finish (); } break; -case 258: { +case 259: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression, sym(4).StatementList); } break; -case 259: { +case 260: { sym(1).Node = makeAstNode (driver->nodePool(), sym(3).StatementList); } break; -case 260: { +case 261: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).sval, sym(3).Statement); } break; -case 262: { +case 263: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); } break; -case 263: { +case 264: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Statement, sym(3).Catch); } break; -case 264: { +case 265: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Statement, sym(3).Finally); } break; -case 265: { +case 266: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Statement, sym(3).Catch, sym(4).Finally); } break; -case 266: { +case 267: { sym(1).Node = makeAstNode (driver->nodePool(), sym(3).sval, sym(5).Statement); } break; -case 267: { +case 268: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Statement); } break; -case 269: { +case 270: { sym(1).Node = makeAstNode (driver->nodePool()); } break; -case 270: { +case 271: { AST::FunctionDeclaration *node = makeAstNode (driver->nodePool(), sym(2).sval, sym(4).FormalParameterList, sym(7).FunctionBody); node->functionToken = loc(1); node->identifierToken = loc(2); @@ -1049,7 +1056,7 @@ case 270: { sym(1).Node = node; } break; -case 271: { +case 272: { AST::FunctionExpression *node = makeAstNode (driver->nodePool(), sym(2).sval, sym(4).FormalParameterList, sym(7).FunctionBody); node->functionToken = loc(1); if (sym(2).sval) @@ -1061,56 +1068,56 @@ case 271: { sym(1).Node = node; } break; -case 272: { +case 273: { AST::FormalParameterList *node = makeAstNode (driver->nodePool(), sym(1).sval); node->identifierToken = loc(1); sym(1).Node = node; } break; -case 273: { +case 274: { AST::FormalParameterList *node = makeAstNode (driver->nodePool(), sym(1).FormalParameterList, sym(3).sval); node->commaToken = loc(2); node->identifierToken = loc(3); sym(1).Node = node; } break; -case 274: { +case 275: { sym(1).Node = 0; } break; -case 275: { +case 276: { sym(1).Node = sym(1).FormalParameterList->finish (); } break; -case 276: { +case 277: { sym(1).Node = 0; } break; -case 278: { +case 279: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).SourceElements->finish ()); } break; -case 279: { +case 280: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).SourceElement); } break; -case 280: { +case 281: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).SourceElements, sym(2).SourceElement); } break; -case 281: { +case 282: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Statement); } break; -case 282: { +case 283: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).FunctionDeclaration); } break; -case 283: { +case 284: { sym(1).sval = 0; } break; -case 285: { +case 286: { sym(1).Node = 0; } break; @@ -1156,7 +1163,7 @@ case 285: { token_buffer[1].loc = yylloc = location(lexer); if (t_action(errorState, yytoken)) { - const QString msg = QString::fromUtf8("Removed token: `%1'").arg(spell[token_buffer[0].token]); + const QString msg = QString::fromUtf8("Removed token: `%1'").arg(QLatin1String(spell[token_buffer[0].token])); diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, token_buffer[0].loc.startLine, token_buffer[0].loc.startColumn, msg)); @@ -1186,7 +1193,7 @@ case 285: { for (int *tk = tokens; *tk != EOF_SYMBOL; ++tk) { int a = t_action(errorState, *tk); if (a > 0 && t_action(a, yytoken)) { - const QString msg = QString::fromUtf8("Inserted token: `%1'").arg(spell[*tk]); + const QString msg = QString::fromUtf8("Inserted token: `%1'").arg(QLatin1String(spell[*tk])); diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, token_buffer[0].loc.startLine, token_buffer[0].loc.startColumn, msg)); @@ -1206,7 +1213,7 @@ case 285: { for (int tk = 1; tk < TERMINAL_COUNT; ++tk) { int a = t_action(errorState, tk); if (a > 0 && t_action(a, yytoken)) { - const QString msg = QString::fromUtf8("Inserted token: `%1'").arg(spell[tk]); + const QString msg = QString::fromUtf8("Inserted token: `%1'").arg(QLatin1String(spell[tk])); diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, token_buffer[0].loc.startLine, token_buffer[0].loc.startColumn, msg)); diff --git a/src/declarative/qml/parser/javascriptparser_p.h b/src/declarative/qml/parser/javascriptparser_p.h index 071da1f..abebf4f 100644 --- a/src/declarative/qml/parser/javascriptparser_p.h +++ b/src/declarative/qml/parser/javascriptparser_p.h @@ -203,9 +203,9 @@ protected: }; -#define J_SCRIPT_REGEXPLITERAL_RULE1 27 +#define J_SCRIPT_REGEXPLITERAL_RULE1 28 -#define J_SCRIPT_REGEXPLITERAL_RULE2 28 +#define J_SCRIPT_REGEXPLITERAL_RULE2 29 QT_END_NAMESPACE diff --git a/src/declarative/qml/qmlparser.cpp b/src/declarative/qml/qmlparser.cpp index 6c71a97..9bcd53d 100644 --- a/src/declarative/qml/qmlparser.cpp +++ b/src/declarative/qml/qmlparser.cpp @@ -152,7 +152,10 @@ Object *QmlParser::Property::getValue() void QmlParser::Property::addValue(Value *v) { - qDebug() << "Property" << name << "addValue" << v->primitive; + if (v->object) + qDebug() << "Property" << name << "addValue Object(" << v->object->typeName << ")"; + else + qDebug() << "Property" << name << "addValue" << v->primitive; values << v; } diff --git a/src/declarative/qml/qmlscriptparser.cpp b/src/declarative/qml/qmlscriptparser.cpp index 42cd812..981f3ad 100644 --- a/src/declarative/qml/qmlscriptparser.cpp +++ b/src/declarative/qml/qmlscriptparser.cpp @@ -65,6 +65,7 @@ protected: const QString &propertyName, const QString &objectType, AST::UiObjectInitializer *initializer = 0); + QString getPrimitive(const QByteArray &propertyName, AST::ExpressionNode *expr); using AST::Visitor::visit; using AST::Visitor::endVisit; @@ -177,7 +178,8 @@ Object *ProcessAST::defineObjectBinding(int line, _scope.removeLast(); obj->line = line; - if (Property *prop = currentProperty()) { + if (!str.isEmpty()) { + Property *prop = currentProperty(); Value *v = new Value; v->object = obj; v->line = line; @@ -213,34 +215,50 @@ Object *ProcessAST::defineObjectBinding(int line, // UiObjectMember: T_PUBLIC T_IDENTIFIER T_IDENTIFIER T_COLON Expression UiObjectInitializer ; bool ProcessAST::visit(AST::UiPublicMember *node) { -#if 0 const QString type = node->type->asString(); const QString name = node->name->asString(); + qDebug() << Q_FUNC_INFO << name; + if (type == QLatin1String("property")) { - Object *properties = defineObjectBinding(node->publicToken.startLine, - QLatin1String("properties"), - Q - property = QLatin1("properties"); _stateStack.pushProperty(QLatin1String("properties"), node->publicToken.startLine); - const int typeId = _parser->findOrCreateTypeId(QLatin1String("Property")); - int line = node->identifierToken.startLine; + Object *obj = defineObjectBinding(node->identifierToken.startLine, + QString(), + QLatin1String("Property")); + + qDebug() << "MIDDLE"; + _stateStack.pushObject(obj); + + _stateStack.pushProperty(QLatin1String("name"), node->identifierToken.startLine); + Value *value = new Value; + value->primitive = name; + value->line = node->identifierToken.startLine; + currentProperty()->addValue(value); + _stateStack.pop(); // name property + + if (node->expression) { // default value + _stateStack.pushProperty(QLatin1String("value"), node->identifierToken.startLine); + Value *value = new Value; + value->primitive = getPrimitive("value", node->expression); + value->line = node->identifierToken.startLine; + currentProperty()->addValue(value); + _stateStack.pop(); // value property + } - Object *obj = new Object; - obj->type = typeId; - obj->typeName = qualifiedNameId().toLatin1(); - obj->line = line; - accept(node->initializer); - _stateStack.pop(); + _stateStack.pop(); // object + + _stateStack.pop(); // properties } else { - qWarning << "bad public identifier" << type; // ### FIXME + qWarning() << "bad public identifier" << type; // ### FIXME } -#endif + + qDebug() << Q_FUNC_INFO << name << "DONE!!!"; + return false; } @@ -266,6 +284,47 @@ bool ProcessAST::visit(AST::UiObjectBinding *node) return false; } +QString ProcessAST::getPrimitive(const QByteArray &propertyName, AST::ExpressionNode *expr) +{ + QString primitive; + QTextStream out(&primitive); + PrettyPretty pp(out); + + if(propertyName.length() >= 3 && propertyName.startsWith("on") && + ('A' <= propertyName.at(2) && 'Z' >= propertyName.at(2))) { + pp(expr); + + // here comes a cruel hack until we support functions properly with arguments for signal properties + if (primitive.startsWith(QLatin1String("function("))) { + int brace = 0; + for (;brace < primitive.size(); ++brace) + if (primitive.at(brace) == QLatin1Char('{')) + break; + primitive = primitive.mid(brace + 1, primitive.size() - brace - 2); + } + //end of hack + + } else if (propertyName == "id" && expr && expr->kind == AST::Node::Kind_IdentifierExpression) { + primitive = static_cast(expr)->name->asString(); + } else if (expr->kind == AST::Node::Kind_StringLiteral) { + // hack: emulate weird XML feature that string literals are not quoted. + //This needs to be fixed in the qmlcompiler once xml goes away. + primitive = static_cast(expr)->value->asString(); + } else if (expr->kind == AST::Node::Kind_TrueLiteral + || expr->kind == AST::Node::Kind_FalseLiteral + || expr->kind == AST::Node::Kind_NumericLiteral + ) { + pp(expr); + } else { + // create a binding + out << "{"; + pp(expr); + out << "}"; + } + return primitive; +} + + // UiObjectMember: UiQualifiedId T_COLON Statement ; bool ProcessAST::visit(AST::UiScriptBinding *node) { @@ -286,38 +345,8 @@ bool ProcessAST::visit(AST::UiScriptBinding *node) if (node->statement->kind == AST::Node::Kind_ExpressionStatement) { AST::ExpressionStatement *stmt = static_cast(node->statement); + primitive = getPrimitive(prop->name, stmt->expression); - if(prop->name.length() >= 3 && prop->name.startsWith("on") && - ('A' <= prop->name.at(2) && 'Z' >= prop->name.at(2))) { - pp(stmt->expression); - - // here comes a cruel hack until we support functions properly with arguments for signal properties - if (primitive.startsWith(QLatin1String("function("))) { - int brace = 0; - for (;brace < primitive.size(); ++brace) - if (primitive.at(brace) == QLatin1Char('{')) - break; - primitive = primitive.mid(brace + 1, primitive.size() - brace - 2); - } - //end of hack - - } else if (prop->name == "id" && stmt->expression && stmt->expression->kind == AST::Node::Kind_IdentifierExpression) { - primitive = static_cast(stmt->expression)->name->asString(); - } else if (stmt->expression->kind == AST::Node::Kind_StringLiteral) { - // hack: emulate weird XML feature that string literals are not quoted. - //This needs to be fixed in the qmlcompiler once xml goes away. - primitive = static_cast(stmt->expression)->value->asString(); - } else if (stmt->expression->kind == AST::Node::Kind_TrueLiteral - || stmt->expression->kind == AST::Node::Kind_FalseLiteral - || stmt->expression->kind == AST::Node::Kind_NumericLiteral - ) { - pp(stmt->expression); - } else { - // create a binding - out << "{"; - pp(stmt->expression); - out << "}"; - } } else { pp(node->statement); } -- cgit v0.12 From 44a82378d05bc54224f7ff0e276c084aeab6e548 Mon Sep 17 00:00:00 2001 From: mae Date: Mon, 20 Apr 2009 15:55:48 +0200 Subject: removed debug output --- src/declarative/qml/qmlscriptparser.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/declarative/qml/qmlscriptparser.cpp b/src/declarative/qml/qmlscriptparser.cpp index 981f3ad..e7e54ef 100644 --- a/src/declarative/qml/qmlscriptparser.cpp +++ b/src/declarative/qml/qmlscriptparser.cpp @@ -218,8 +218,6 @@ bool ProcessAST::visit(AST::UiPublicMember *node) const QString type = node->type->asString(); const QString name = node->name->asString(); - qDebug() << Q_FUNC_INFO << name; - if (type == QLatin1String("property")) { _stateStack.pushProperty(QLatin1String("properties"), node->publicToken.startLine); @@ -227,7 +225,6 @@ bool ProcessAST::visit(AST::UiPublicMember *node) QString(), QLatin1String("Property")); - qDebug() << "MIDDLE"; _stateStack.pushObject(obj); _stateStack.pushProperty(QLatin1String("name"), node->identifierToken.startLine); @@ -257,8 +254,6 @@ bool ProcessAST::visit(AST::UiPublicMember *node) qWarning() << "bad public identifier" << type; // ### FIXME } - qDebug() << Q_FUNC_INFO << name << "DONE!!!"; - return false; } -- cgit v0.12 From 624cd6b978b2dbd7e26702b2a8a8bb73fbd30267 Mon Sep 17 00:00:00 2001 From: mae Date: Mon, 20 Apr 2009 16:17:16 +0200 Subject: make arrays work, these visitors are ***** awesome --- src/declarative/qml/qmlscriptparser.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/declarative/qml/qmlscriptparser.cpp b/src/declarative/qml/qmlscriptparser.cpp index e7e54ef..01bdeac 100644 --- a/src/declarative/qml/qmlscriptparser.cpp +++ b/src/declarative/qml/qmlscriptparser.cpp @@ -254,6 +254,9 @@ bool ProcessAST::visit(AST::UiPublicMember *node) qWarning() << "bad public identifier" << type; // ### FIXME } + + // ### TODO drop initializer (unless some example needs differnet properties than name and type and value. + return false; } @@ -361,7 +364,18 @@ bool ProcessAST::visit(AST::UiScriptBinding *node) // UiObjectMember: UiQualifiedId T_COLON T_LBRACKET UiObjectMemberList T_RBRACKET ; bool ProcessAST::visit(AST::UiArrayBinding *node) { - qWarning() << Q_FUNC_INFO << "not implemented"; + QString propertyName = asString(node->qualifiedId); + const QStringList str = propertyName.split(QLatin1Char('.'), QString::SkipEmptyParts); + for(int ii = 0; ii < str.count(); ++ii) { + const QString s = str.at(ii); + _stateStack.pushProperty(s, node->colonToken.startLine); + } + + accept(node->members); + + for(int ii = str.count() - 1; ii >= 0; --ii) + _stateStack.pop(); + return false; } -- cgit v0.12 From ca1dde886a5613e7f298927d8c1cd61f7fd05b28 Mon Sep 17 00:00:00 2001 From: mae Date: Mon, 20 Apr 2009 17:26:46 +0200 Subject: make PropertyChangeSet work. This makes tutorial3 run again. --- src/declarative/qml/qmlscriptparser.cpp | 148 ++++++++++++++++++++------------ 1 file changed, 95 insertions(+), 53 deletions(-) diff --git a/src/declarative/qml/qmlscriptparser.cpp b/src/declarative/qml/qmlscriptparser.cpp index 01bdeac..8167c24 100644 --- a/src/declarative/qml/qmlscriptparser.cpp +++ b/src/declarative/qml/qmlscriptparser.cpp @@ -62,10 +62,11 @@ public: protected: Object *defineObjectBinding(int line, - const QString &propertyName, + AST::UiQualifiedId *propertyName, const QString &objectType, AST::UiObjectInitializer *initializer = 0); - QString getPrimitive(const QByteArray &propertyName, AST::ExpressionNode *expr); + QString getPrimitive(const QByteArray &propertyName, AST::ExpressionNode *expr); + void defineProperty(const QString &propertyName, int line, const QString &primitive); using AST::Visitor::visit; using AST::Visitor::endVisit; @@ -150,7 +151,7 @@ QString ProcessAST::asString(AST::UiQualifiedId *node) const } Object *ProcessAST::defineObjectBinding(int line, - const QString &propertyName, + AST::UiQualifiedId *propertyName, const QString &objectType, AST::UiObjectInitializer *initializer) { @@ -160,14 +161,12 @@ Object *ProcessAST::defineObjectBinding(int line, return false; } - const QStringList str = propertyName.split(QLatin1Char('.'), QString::SkipEmptyParts); - - for(int ii = 0; ii < str.count(); ++ii) { - const QString s = str.at(ii); - _stateStack.pushProperty(s, line); + int propertyCount = 0; + for (; propertyName; propertyName = propertyName->next){ + ++propertyCount; + _stateStack.pushProperty(propertyName->name->asString(), propertyName->identifierToken.startLine); } - // Class const int typeId = _parser->findOrCreateTypeId(objectType); @@ -178,7 +177,7 @@ Object *ProcessAST::defineObjectBinding(int line, _scope.removeLast(); obj->line = line; - if (!str.isEmpty()) { + if (propertyCount) { Property *prop = currentProperty(); Value *v = new Value; v->object = obj; @@ -186,7 +185,7 @@ Object *ProcessAST::defineObjectBinding(int line, prop->addValue(v); } - for(int ii = str.count() - 1; ii >= 0; --ii) + while (propertyCount--) _stateStack.pop(); @@ -212,6 +211,16 @@ Object *ProcessAST::defineObjectBinding(int line, return obj; } +void ProcessAST::defineProperty(const QString &propertyName, int line, const QString &primitive) +{ + _stateStack.pushProperty(propertyName, line); + Value *value = new Value; + value->primitive = primitive; + value->line = line; + currentProperty()->addValue(value); + _stateStack.pop(); +} + // UiObjectMember: T_PUBLIC T_IDENTIFIER T_IDENTIFIER T_COLON Expression UiObjectInitializer ; bool ProcessAST::visit(AST::UiPublicMember *node) { @@ -222,32 +231,16 @@ bool ProcessAST::visit(AST::UiPublicMember *node) _stateStack.pushProperty(QLatin1String("properties"), node->publicToken.startLine); Object *obj = defineObjectBinding(node->identifierToken.startLine, - QString(), + 0, QLatin1String("Property")); _stateStack.pushObject(obj); - _stateStack.pushProperty(QLatin1String("name"), node->identifierToken.startLine); - Value *value = new Value; - value->primitive = name; - value->line = node->identifierToken.startLine; - currentProperty()->addValue(value); - _stateStack.pop(); // name property - - if (node->expression) { // default value - _stateStack.pushProperty(QLatin1String("value"), node->identifierToken.startLine); - Value *value = new Value; - value->primitive = getPrimitive("value", node->expression); - value->line = node->identifierToken.startLine; - currentProperty()->addValue(value); - _stateStack.pop(); // value property - } - - - + defineProperty(QLatin1String("name"), node->identifierToken.startLine, name); + if (node->expression) // default value + defineProperty(QLatin1String("value"), node->identifierToken.startLine, getPrimitive("value", node->expression)); _stateStack.pop(); // object - _stateStack.pop(); // properties } else { @@ -265,7 +258,7 @@ bool ProcessAST::visit(AST::UiPublicMember *node) bool ProcessAST::visit(AST::UiObjectDefinition *node) { defineObjectBinding(node->identifierToken.startLine, - QString(), + 0, node->name->asString(), node->initializer); return false; @@ -275,10 +268,62 @@ bool ProcessAST::visit(AST::UiObjectDefinition *node) // UiObjectMember: UiQualifiedId T_COLON T_IDENTIFIER UiObjectInitializer ; bool ProcessAST::visit(AST::UiObjectBinding *node) { - defineObjectBinding(node->identifierToken.startLine, - asString(node->qualifiedId), - node->name->asString(), - node->initializer); + if (asString(node->qualifiedId) == QLatin1String("propertyChangeSet") + && node->name->asString() == QLatin1String("PropertyChangeSet")) { + + AST::UiObjectMemberList *it = node->initializer->members; + for (; it; it = it->next) { + if (it->member->kind != AST::Node::Kind_UiScriptBinding) + continue; // ### TODO generate error + AST::UiScriptBinding *scriptBinding = static_cast(it->member); + + + QString target; + QString property; + QString value; + + int propertyCount = 0; + AST::UiQualifiedId *propertyName = scriptBinding->qualifiedId; + for (; propertyName; propertyName = propertyName->next){ + if (propertyName->next) { + if (!target.isEmpty()) + target += QLatin1Char('.'); + target += propertyName->name->asString(); + } else { + property = propertyName->name->asString(); + } + ++propertyCount; + } + + if (scriptBinding->statement->kind == AST::Node::Kind_ExpressionStatement) { + AST::ExpressionStatement *stmt = static_cast(scriptBinding->statement); + value = getPrimitive(property.toLatin1(), stmt->expression); + } else { + // #### TODO generate error + } + + qDebug() << "SetProperty" << target << property << value; + + Object *obj = defineObjectBinding(node->identifierToken.startLine, + 0, + QLatin1String("SetProperty")); + + _stateStack.pushObject(obj); + if (!target.isEmpty()) + defineProperty(QLatin1String("target"), scriptBinding->colonToken.startLine, QLatin1Char('{') + target + QLatin1Char('}')); + if (!property.isEmpty()) + defineProperty(QLatin1String("property"), scriptBinding->colonToken.startLine, property); + if (!value.isEmpty()) + defineProperty(QLatin1String("value"), scriptBinding->colonToken.startLine, value); + _stateStack.pop(); // object + } + } else { + + defineObjectBinding(node->identifierToken.startLine, + node->qualifiedId, + node->name->asString(), + node->initializer); + } return false; } @@ -326,21 +371,19 @@ QString ProcessAST::getPrimitive(const QByteArray &propertyName, AST::Expression // UiObjectMember: UiQualifiedId T_COLON Statement ; bool ProcessAST::visit(AST::UiScriptBinding *node) { - const QString qualifiedId = asString(node->qualifiedId); - const QStringList str = qualifiedId.split(QLatin1Char('.')); - int line = node->colonToken.startLine; - for(int ii = 0; ii < str.count(); ++ii) { - const QString s = str.at(ii); - _stateStack.pushProperty(s, line); + int propertyCount = 0; + AST::UiQualifiedId *propertyName = node->qualifiedId; + for (; propertyName; propertyName = propertyName->next){ + ++propertyCount; + _stateStack.pushProperty(propertyName->name->asString(), propertyName->identifierToken.startLine); } + Property *prop = currentProperty(); QString primitive; QTextStream out(&primitive); PrettyPretty pp(out); - Property *prop = currentProperty(); - if (node->statement->kind == AST::Node::Kind_ExpressionStatement) { AST::ExpressionStatement *stmt = static_cast(node->statement); primitive = getPrimitive(prop->name, stmt->expression); @@ -349,13 +392,12 @@ bool ProcessAST::visit(AST::UiScriptBinding *node) pp(node->statement); } - Value *v = new Value; v->primitive = primitive; - v->line = line; + v->line = node->colonToken.startLine; prop->addValue(v); - for(int ii = str.count() - 1; ii >= 0; --ii) + while (propertyCount--) _stateStack.pop(); return true; @@ -364,16 +406,16 @@ bool ProcessAST::visit(AST::UiScriptBinding *node) // UiObjectMember: UiQualifiedId T_COLON T_LBRACKET UiObjectMemberList T_RBRACKET ; bool ProcessAST::visit(AST::UiArrayBinding *node) { - QString propertyName = asString(node->qualifiedId); - const QStringList str = propertyName.split(QLatin1Char('.'), QString::SkipEmptyParts); - for(int ii = 0; ii < str.count(); ++ii) { - const QString s = str.at(ii); - _stateStack.pushProperty(s, node->colonToken.startLine); + int propertyCount = 0; + AST::UiQualifiedId *propertyName = node->qualifiedId; + for (; propertyName; propertyName = propertyName->next){ + ++propertyCount; + _stateStack.pushProperty(propertyName->name->asString(), propertyName->identifierToken.startLine); } accept(node->members); - for(int ii = str.count() - 1; ii >= 0; --ii) + while (propertyCount--) _stateStack.pop(); return false; -- cgit v0.12 From 411808e3020e4563e5c2e0bcf6ebf2a6b633a8c4 Mon Sep 17 00:00:00 2001 From: mae Date: Mon, 20 Apr 2009 17:54:26 +0200 Subject: support comma for lists, better parser error output --- src/declarative/qml/parser/javascript.g | 18 +- src/declarative/qml/parser/javascriptgrammar.cpp | 1088 +++++++++++----------- src/declarative/qml/parser/javascriptgrammar_p.h | 12 +- src/declarative/qml/parser/javascriptparser.cpp | 374 ++++---- src/declarative/qml/parser/javascriptparser_p.h | 4 +- src/declarative/qml/qmlcomponent.cpp | 14 - src/declarative/qml/qmlscriptparser.cpp | 10 +- src/declarative/qml/qmlscriptparser_p.h | 2 + 8 files changed, 770 insertions(+), 752 deletions(-) diff --git a/src/declarative/qml/parser/javascript.g b/src/declarative/qml/parser/javascript.g index c7b26e2..411a8c6 100644 --- a/src/declarative/qml/parser/javascript.g +++ b/src/declarative/qml/parser/javascript.g @@ -530,6 +530,22 @@ case $rule_number: { } break; ./ +UiArrayMemberList: UiObjectMember ; +/. +case $rule_number: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).UiObjectMember); +} break; +./ + +UiArrayMemberList: UiArrayMemberList T_COMMA UiObjectMember ; +/. +case $rule_number: { + AST::UiObjectMemberList *node = makeAstNode (driver->nodePool(), + sym(1).UiObjectMemberList, sym(3).UiObjectMember); + sym(1).Node = node; +} break; +./ + UiObjectInitializer: T_LBRACE T_RBRACE ; /. case $rule_number: { @@ -571,7 +587,7 @@ case $rule_number: { } break; ./ -UiObjectMember: UiQualifiedId T_COLON T_LBRACKET UiObjectMemberList T_RBRACKET ; +UiObjectMember: UiQualifiedId T_COLON T_LBRACKET UiArrayMemberList T_RBRACKET ; /. case $rule_number: { AST::UiArrayBinding *node = makeAstNode (driver->nodePool(), sym(1).UiQualifiedId->finish(), diff --git a/src/declarative/qml/parser/javascriptgrammar.cpp b/src/declarative/qml/parser/javascriptgrammar.cpp index 61d033c..43d4c17 100644 --- a/src/declarative/qml/parser/javascriptgrammar.cpp +++ b/src/declarative/qml/parser/javascriptgrammar.cpp @@ -14,523 +14,497 @@ const char *const JavaScriptGrammar::spell [] = { const int JavaScriptGrammar::lhs [] = { 88, 89, 89, 92, 92, 93, 93, 91, 90, 90, - 95, 95, 94, 94, 94, 94, 94, 94, 94, 96, - 96, 99, 99, 99, 99, 99, 99, 99, 99, 99, - 99, 99, 99, 99, 99, 99, 101, 101, 105, 105, - 100, 100, 103, 103, 106, 106, 106, 106, 107, 107, - 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, - 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, - 107, 107, 107, 107, 107, 107, 107, 107, 107, 108, - 108, 109, 109, 109, 109, 109, 112, 112, 113, 113, - 113, 113, 111, 111, 114, 114, 115, 115, 116, 116, - 116, 117, 117, 117, 117, 117, 117, 117, 117, 117, - 117, 118, 118, 118, 118, 119, 119, 119, 120, 120, - 120, 120, 121, 121, 121, 121, 121, 121, 121, 122, - 122, 122, 122, 122, 122, 123, 123, 123, 123, 123, - 124, 124, 124, 124, 124, 125, 125, 126, 126, 127, + 95, 95, 96, 96, 94, 94, 94, 94, 94, 94, + 94, 97, 97, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 102, 102, + 106, 106, 101, 101, 104, 104, 107, 107, 107, 107, + 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, + 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, + 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, + 108, 109, 109, 110, 110, 110, 110, 110, 113, 113, + 114, 114, 114, 114, 112, 112, 115, 115, 116, 116, + 117, 117, 117, 118, 118, 118, 118, 118, 118, 118, + 118, 118, 118, 119, 119, 119, 119, 120, 120, 120, + 121, 121, 121, 121, 122, 122, 122, 122, 122, 122, + 122, 123, 123, 123, 123, 123, 123, 124, 124, 124, + 124, 124, 125, 125, 125, 125, 125, 126, 126, 127, 127, 128, 128, 129, 129, 130, 130, 131, 131, 132, - 132, 133, 133, 134, 134, 135, 135, 136, 136, 104, - 104, 137, 137, 138, 138, 138, 138, 138, 138, 138, - 138, 138, 138, 138, 138, 98, 98, 139, 139, 140, - 140, 141, 141, 97, 97, 97, 97, 97, 97, 97, - 97, 97, 97, 97, 97, 97, 97, 97, 142, 158, - 158, 157, 157, 143, 143, 159, 159, 160, 160, 162, - 162, 161, 163, 166, 164, 164, 167, 165, 165, 144, - 145, 145, 146, 146, 147, 147, 147, 147, 147, 147, - 147, 148, 148, 148, 148, 149, 149, 149, 149, 150, - 150, 151, 153, 168, 168, 171, 171, 169, 169, 172, - 170, 152, 154, 154, 155, 155, 155, 173, 174, 156, - 156, 175, 110, 179, 179, 176, 176, 177, 177, 180, - 181, 181, 182, 182, 178, 178, 102, 102, 183}; + 132, 133, 133, 134, 134, 135, 135, 136, 136, 137, + 137, 105, 105, 138, 138, 139, 139, 139, 139, 139, + 139, 139, 139, 139, 139, 139, 139, 99, 99, 140, + 140, 141, 141, 142, 142, 98, 98, 98, 98, 98, + 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, + 143, 159, 159, 158, 158, 144, 144, 160, 160, 161, + 161, 163, 163, 162, 164, 167, 165, 165, 168, 166, + 166, 145, 146, 146, 147, 147, 148, 148, 148, 148, + 148, 148, 148, 149, 149, 149, 149, 150, 150, 150, + 150, 151, 151, 152, 154, 169, 169, 172, 172, 170, + 170, 173, 171, 153, 155, 155, 156, 156, 156, 174, + 175, 157, 157, 176, 111, 180, 180, 177, 177, 178, + 178, 181, 182, 182, 183, 183, 179, 179, 103, 103, + 184}; const int JavaScriptGrammar:: rhs[] = { 2, 1, 1, 1, 2, 3, 3, 0, 1, 2, - 2, 3, 4, 2, 5, 3, 6, 3, 5, 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, 3, 2, 3, 4, 2, 5, 3, 6, 3, + 5, 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, + 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, 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}; + 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}; const int JavaScriptGrammar::action_default [] = { - 8, 2, 0, 0, 4, 3, 0, 289, 0, 6, - 7, 5, 20, 0, 9, 1, 0, 0, 14, 11, - 0, 12, 10, 0, 18, 0, 119, 186, 150, 158, - 154, 98, 170, 146, 19, 83, 99, 162, 166, 87, - 116, 97, 102, 82, 136, 123, 0, 29, 30, 26, - 285, 23, 287, 41, 0, 0, 0, 0, 0, 24, - 27, 0, 0, 28, 22, 0, 25, 0, 0, 112, - 0, 0, 99, 118, 101, 100, 0, 0, 0, 114, - 115, 113, 117, 0, 147, 0, 0, 0, 0, 137, - 0, 0, 0, 0, 0, 0, 127, 0, 0, 0, - 121, 122, 120, 125, 129, 128, 126, 124, 139, 138, - 140, 0, 155, 0, 151, 0, 0, 93, 92, 81, - 49, 50, 51, 76, 52, 77, 53, 54, 55, 56, - 57, 58, 59, 60, 80, 61, 62, 63, 64, 65, - 78, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 79, 0, 0, 91, 187, 94, 0, 95, 0, - 96, 90, 17, 0, 183, 176, 174, 181, 182, 180, - 179, 185, 178, 177, 175, 184, 171, 0, 159, 0, - 0, 163, 0, 0, 167, 0, 0, 93, 85, 0, - 84, 0, 89, 103, 0, 286, 276, 277, 0, 274, - 0, 275, 0, 278, 194, 201, 200, 208, 196, 0, - 197, 279, 0, 284, 198, 199, 204, 202, 281, 280, - 283, 205, 0, 216, 0, 0, 0, 0, 285, 23, - 0, 287, 188, 230, 0, 0, 0, 217, 0, 0, - 206, 207, 0, 195, 203, 231, 232, 273, 282, 246, - 0, 247, 248, 249, 242, 0, 243, 244, 245, 270, - 271, 0, 0, 0, 0, 0, 235, 236, 192, 190, - 152, 160, 156, 172, 148, 193, 0, 99, 164, 168, - 141, 130, 0, 0, 149, 0, 0, 0, 0, 142, - 0, 0, 0, 0, 0, 134, 132, 135, 133, 131, - 144, 143, 145, 0, 157, 0, 153, 0, 191, 99, - 0, 173, 188, 189, 0, 188, 0, 0, 238, 0, - 0, 0, 240, 0, 161, 0, 0, 165, 0, 0, - 169, 228, 0, 220, 229, 223, 0, 227, 0, 188, - 221, 0, 188, 0, 0, 239, 0, 0, 0, 241, - 286, 276, 0, 0, 278, 0, 272, 0, 262, 0, - 0, 0, 234, 0, 233, 0, 288, 0, 48, 210, - 213, 0, 49, 76, 52, 77, 54, 55, 26, 59, - 60, 23, 61, 64, 24, 27, 188, 28, 67, 22, - 69, 25, 71, 72, 73, 74, 75, 79, 0, 43, - 0, 0, 45, 47, 35, 46, 0, 44, 34, 211, - 209, 87, 88, 93, 0, 86, 0, 250, 251, 0, - 0, 0, 253, 258, 256, 259, 0, 0, 257, 258, - 0, 254, 0, 255, 212, 261, 0, 212, 260, 0, - 263, 264, 0, 212, 265, 266, 0, 0, 267, 0, - 0, 0, 268, 269, 105, 104, 0, 0, 0, 237, - 0, 0, 0, 252, 225, 218, 0, 226, 222, 0, - 224, 214, 0, 215, 219, 0, 42, 0, 39, 41, - 32, 0, 38, 33, 40, 37, 31, 0, 36, 109, - 107, 111, 108, 106, 110, 0, 0, 16, 23, 41, - 13, 0, 15, 21}; + 8, 2, 0, 0, 4, 3, 0, 291, 0, 6, + 7, 5, 22, 0, 9, 1, 0, 0, 16, 13, + 0, 14, 10, 0, 20, 0, 121, 188, 152, 160, + 156, 100, 172, 148, 21, 85, 101, 164, 168, 89, + 118, 99, 104, 84, 138, 125, 0, 31, 32, 28, + 287, 25, 289, 43, 0, 0, 0, 0, 0, 26, + 29, 0, 0, 30, 24, 0, 27, 0, 0, 114, + 0, 0, 101, 120, 103, 102, 0, 0, 0, 116, + 117, 115, 119, 0, 149, 0, 0, 0, 0, 139, + 0, 0, 0, 0, 0, 0, 129, 0, 0, 0, + 123, 124, 122, 127, 131, 130, 128, 126, 141, 140, + 142, 0, 157, 0, 153, 0, 0, 95, 94, 83, + 51, 52, 53, 78, 54, 79, 55, 56, 57, 58, + 59, 60, 61, 62, 82, 63, 64, 65, 66, 67, + 80, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 81, 0, 0, 93, 189, 96, 0, 97, 0, + 98, 92, 19, 0, 185, 178, 176, 183, 184, 182, + 181, 187, 180, 179, 177, 186, 173, 0, 161, 0, + 0, 165, 0, 0, 169, 0, 0, 95, 87, 0, + 86, 0, 91, 105, 0, 288, 278, 279, 0, 276, + 0, 277, 0, 280, 196, 203, 202, 210, 198, 0, + 199, 281, 0, 286, 200, 201, 206, 204, 283, 282, + 285, 207, 0, 218, 0, 0, 0, 0, 287, 25, + 0, 289, 190, 232, 0, 0, 0, 219, 0, 0, + 208, 209, 0, 197, 205, 233, 234, 275, 284, 248, + 0, 249, 250, 251, 244, 0, 245, 246, 247, 272, + 273, 0, 0, 0, 0, 0, 237, 238, 194, 192, + 154, 162, 158, 174, 150, 195, 0, 101, 166, 170, + 143, 132, 0, 0, 151, 0, 0, 0, 0, 144, + 0, 0, 0, 0, 0, 136, 134, 137, 135, 133, + 146, 145, 147, 0, 159, 0, 155, 0, 193, 101, + 0, 175, 190, 191, 0, 190, 0, 0, 240, 0, + 0, 0, 242, 0, 163, 0, 0, 167, 0, 0, + 171, 230, 0, 222, 231, 225, 0, 229, 0, 190, + 223, 0, 190, 0, 0, 241, 0, 0, 0, 243, + 288, 278, 0, 0, 280, 0, 274, 0, 264, 0, + 0, 0, 236, 0, 235, 0, 290, 0, 50, 212, + 215, 0, 51, 78, 54, 79, 56, 57, 28, 61, + 62, 25, 63, 66, 26, 29, 190, 30, 69, 24, + 71, 27, 73, 74, 75, 76, 77, 81, 0, 45, + 0, 0, 47, 49, 37, 48, 0, 46, 36, 213, + 211, 89, 90, 95, 0, 88, 0, 252, 253, 0, + 0, 0, 255, 260, 258, 261, 0, 0, 259, 260, + 0, 256, 0, 257, 214, 263, 0, 214, 262, 0, + 265, 266, 0, 214, 267, 268, 0, 0, 269, 0, + 0, 0, 270, 271, 107, 106, 0, 0, 0, 239, + 0, 0, 0, 254, 227, 220, 0, 228, 224, 0, + 226, 216, 0, 217, 221, 0, 44, 0, 41, 43, + 34, 0, 40, 35, 42, 39, 33, 0, 38, 111, + 109, 113, 110, 108, 112, 0, 0, 18, 25, 43, + 15, 0, 11, 0, 17, 12, 23}; const int JavaScriptGrammar::goto_default [] = { - 2, 6, 15, 1, 5, 4, 14, 18, 16, 369, - 209, 43, 477, 475, 367, 366, 27, 476, 365, 368, - 118, 39, 35, 157, 41, 31, 156, 36, 42, 69, - 40, 26, 45, 44, 280, 33, 274, 28, 270, 30, - 272, 29, 271, 37, 278, 38, 279, 32, 273, 269, - 310, 416, 275, 276, 204, 243, 208, 210, 214, 215, - 206, 205, 217, 244, 216, 221, 240, 241, 207, 371, - 370, 242, 466, 465, 332, 333, 468, 335, 467, 334, - 422, 426, 429, 425, 424, 444, 445, 213, 198, 212, - 194, 197, 211, 219, 218, 0}; + 2, 6, 15, 1, 5, 4, 14, 501, 18, 16, + 369, 209, 43, 477, 475, 367, 366, 27, 476, 365, + 368, 118, 39, 35, 157, 41, 31, 156, 36, 42, + 69, 40, 26, 45, 44, 280, 33, 274, 28, 270, + 30, 272, 29, 271, 37, 278, 38, 279, 32, 273, + 269, 310, 416, 275, 276, 204, 243, 208, 210, 214, + 215, 206, 205, 217, 244, 216, 221, 240, 241, 207, + 371, 370, 242, 466, 465, 332, 333, 468, 335, 467, + 334, 422, 426, 429, 425, 424, 444, 445, 213, 198, + 212, 194, 197, 211, 219, 218, 0}; const int JavaScriptGrammar::action_index [] = { - -4, -88, 42, -21, -88, -40, 116, -88, 112, -88, - -88, -88, 16, 19, -88, 85, 102, 174, -88, -88, - 173, -88, -88, 12, 27, 596, 78, -88, 34, -12, - -20, 210, -88, 266, 100, -88, 411, 61, 70, 239, - 169, -88, -88, -88, 333, 152, 596, -88, -88, -88, - 29, -88, 1076, 21, 596, 596, 596, 443, 596, -88, - -88, 596, 596, -88, -88, 596, -88, 596, 596, -88, - 596, 596, 108, 204, -88, -88, 596, 596, 596, -88, - -88, -88, 155, 596, 252, 596, 596, 596, 596, 343, - 596, 596, 596, 596, 596, 596, 159, 596, 596, 596, - 81, 106, 104, 302, 302, 167, 302, 302, 361, 323, - 313, 596, 40, 596, 71, 992, 596, 596, -88, -88, + -12, -88, 80, 40, -88, 15, 70, -88, 107, -88, + -88, -88, 63, 38, -88, 122, 142, 214, -88, -88, + 160, -88, -88, 64, 88, 581, 73, -88, 9, -39, + -59, 193, -88, 254, 120, -88, 381, 1, 86, 227, + 197, -88, -88, -88, 307, 161, 581, -88, -88, -88, + 11, -88, 1061, 31, 581, 581, 581, 419, 581, -88, + -88, 581, 581, -88, -88, 581, -88, 581, 581, -88, + 581, 581, 79, 208, -88, -88, 581, 581, 581, -88, + -88, -88, 168, 581, 239, 581, 581, 581, 581, 327, + 581, 581, 581, 581, 581, 581, 278, 581, 581, 581, + 71, 72, 74, 278, 157, 158, 136, 278, 297, 317, + 287, 581, 16, 581, 77, 977, 581, 581, -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, 114, 596, -88, -88, 31, -32, -88, 596, - -88, -88, -88, 596, -88, -88, -88, -88, -88, -88, - -88, -88, -88, -88, -88, -88, -88, 596, 57, 596, - 596, 166, 77, 596, -88, 992, 596, 596, -88, 120, - -88, 35, -88, -88, 37, -88, 47, 66, 33, -88, - 49, -88, 63, 1412, -88, -88, -88, -88, -88, 219, - -88, -88, 60, -88, -88, -88, -88, -88, -88, 1412, - -88, -88, 149, -88, 207, 79, 1244, 54, 51, 72, - 41, 1496, 596, -88, 53, 596, 55, -88, 56, 58, - -88, -88, 68, -88, -88, -88, -88, -88, -88, -88, - 76, -88, -88, -88, -88, 73, -88, -88, -88, -88, - -88, 52, 67, 596, 94, 86, -88, -88, 831, -88, - 74, 38, 36, -88, 246, 75, 69, 486, 48, 110, - 270, 195, -26, 596, 264, 596, 596, 596, 596, 367, - 596, 596, 596, 596, 596, 196, 215, 222, 225, 218, - 298, 291, 367, 596, -75, 596, -1, 596, -88, 369, - 596, -88, 596, 5, -47, 596, -41, 1244, -88, 596, - 157, 1244, -88, 596, -24, 596, 596, 18, 10, 596, - -88, 1, 92, -15, -88, -88, 596, -88, -8, 596, - -88, 30, 596, -37, 1244, -88, 596, 131, 1244, -88, - -6, 4, -35, -7, 1412, -43, -88, 1244, -88, 596, - 96, 1244, 6, 1244, -88, 8, 0, -53, -88, -88, - 1244, -51, 137, -22, 153, 101, 596, 1244, 3, -25, - 113, 2, -30, 519, 80, -2, 754, 20, -5, 46, - 596, 50, 28, 596, 25, 596, 24, 23, 596, -88, - 1160, 45, -88, -88, -88, -88, 596, -88, -88, -88, - -88, 172, -88, 596, 11, -88, 97, -88, -88, 596, - 144, 32, -88, 62, -88, 65, 88, 596, -88, 64, - 59, -88, 13, -88, 1244, -88, 99, 1244, -88, 216, - -88, -88, 105, 1244, 44, -88, 26, 22, -88, 9, - -23, 7, -88, -88, -88, -88, 596, 91, 1244, -88, - 596, 123, 1244, -88, 15, -88, 177, -88, -88, 596, - -88, -88, 17, -88, -88, 119, 39, 908, -88, 43, - -88, 673, -88, -88, -88, -88, -88, 111, -88, -88, - -88, -88, -88, -88, -88, 1328, 14, -88, 103, 164, - -88, 151, -88, -88, + -88, -88, 89, 581, -88, -88, 56, 67, -88, 581, + -88, -88, -88, 581, -88, -88, -88, -88, -88, -88, + -88, -88, -88, -88, -88, -88, -88, 581, 23, 581, + 581, 60, 75, 581, -88, 977, 581, 581, -88, 108, + -88, 34, -88, -88, 53, -88, 54, 78, 55, -88, + 62, -88, 57, 1229, -88, -88, -88, -88, -88, 185, + -88, -88, 26, -88, -88, -88, -88, -88, -88, 1229, + -88, -88, 171, -88, 173, 68, 1313, 52, 41, 59, + 36, 1481, 581, -88, 33, 581, 32, -88, 39, 48, + -88, -88, 50, -88, -88, -88, -88, -88, -88, -88, + 115, -88, -88, -88, -88, 111, -88, -88, -88, -88, + -88, 61, 65, 581, 102, 76, -88, -88, 735, -88, + 84, 4, -63, -88, 256, 7, -47, 504, 10, 94, + 343, 165, -18, 581, 237, 581, 581, 581, 581, 343, + 581, 581, 581, 581, 581, 211, 278, 278, 192, 199, + 255, 272, 343, 581, -60, 581, 22, 581, -88, 344, + 581, -88, 581, 13, -55, 581, -41, 1313, -88, 581, + 144, 1313, -88, 581, -44, 581, 581, 3, -5, 581, + -88, 51, 133, -30, -88, -88, 581, -88, -11, 581, + -88, -4, 581, -1, 1313, -88, 581, 98, 1313, -88, + -10, 18, -14, 21, 1229, 8, -88, 1313, -88, 581, + 99, 1313, 42, 1313, -88, 49, 45, 6, -88, -88, + 1313, 0, 149, 19, 152, 105, 581, 1313, 37, -3, + 97, 28, -2, 419, 25, 24, 893, 20, -6, 29, + 581, 35, 12, 581, 14, 581, 5, 2, 581, -88, + 1145, 30, -88, -88, -88, -88, 581, -88, -88, -88, + -88, 182, -88, 581, -31, -88, 81, -88, -88, 581, + 110, 27, -88, 134, -88, 46, 92, 581, -88, 44, + 43, -88, -27, -88, 1313, -88, 215, 1313, -88, 190, + -88, -88, 140, 1313, -20, -88, -29, -13, -88, -7, + -36, -8, -88, -88, -88, -88, 581, 90, 1313, -88, + 581, 96, 1313, -88, -9, -88, 179, -88, -88, 581, + -88, -88, 47, -88, -88, 123, 69, 812, -88, 66, + -88, 658, -88, -88, -88, -88, -88, 95, -88, -88, + -88, -88, -88, -88, -88, 1397, 58, -88, 101, 183, + -88, 109, -88, 91, -88, -88, -88, - -96, -96, -96, -96, -96, 85, -96, -96, -96, -96, - -96, -96, -96, -96, -96, 16, -96, 12, -96, -96, - 22, -96, -96, -96, -96, 11, -96, -96, -96, -96, - -96, -96, -96, -96, 26, -96, -19, -96, -96, -96, - -96, -96, -96, -96, -96, -96, 139, -96, -96, -96, - -96, -96, -96, -96, -1, 90, 86, 106, 113, -96, - -96, 114, 110, -96, -96, 107, -96, 58, 104, -96, - 102, 108, -96, -96, -96, -96, 99, 89, 118, -96, - -96, -96, -96, 77, -96, 76, 140, 145, 121, -96, - 119, 130, 131, 137, 93, 68, -96, 55, 62, 57, - -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, - -96, 75, -96, 71, -96, 19, 33, 51, -96, -96, - -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, - -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, - -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, - -96, -96, -96, 36, -96, -96, -96, -96, -96, 35, - -96, -96, -96, 43, -96, -96, -96, -96, -96, -96, - -96, -96, -96, -96, -96, -96, -96, 138, -96, 128, - -3, -96, -96, 14, -96, 61, 13, 154, -96, -96, - -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, - -96, -96, -96, 27, -96, -96, -96, -96, -96, -96, - -96, -96, -96, -96, -96, -96, -96, -96, -96, 66, - -96, -96, -96, -96, -96, -96, 23, -96, -96, -96, - -96, -96, 10, -96, -96, 6, -42, -96, -96, -96, - -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, - -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, - -96, -96, -96, 5, -96, -96, -96, -96, 117, -96, - -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, - -96, -96, -96, 180, -96, 167, 176, 168, 188, -96, - 41, 65, 67, 64, 74, -96, -96, -96, -96, -96, - -96, -96, -96, 158, -96, 148, -96, 191, -96, -96, - 157, -96, 59, -96, -96, 56, -96, 53, -96, 50, - -96, 49, -96, 155, -96, 234, 187, -96, -96, 164, - -96, -96, -96, -96, -96, -96, 177, -96, -26, 54, - -96, -96, 60, -96, 32, -96, 30, -96, 37, -96, - -96, -49, -96, -96, 63, -96, -96, 48, -96, 46, - -96, 45, -96, 44, -96, -96, -96, -96, -96, -96, - 52, -96, -96, -96, -96, -96, 132, 39, -96, -96, - -96, -96, -96, 129, -96, -96, 40, -96, -96, -96, - 34, -96, -12, 95, -96, 94, -96, -96, 31, -96, - 47, -96, -96, -96, -96, -96, 29, -96, -96, -96, - -96, -96, -96, 165, -96, -96, -96, -96, -96, 0, - -96, -96, -96, -96, -96, -79, -96, -7, -96, -80, - -96, -96, -96, -96, -61, -96, -96, -63, -96, -96, - -96, -96, -96, -96, -57, -96, -96, -43, -96, -96, - -96, -27, -96, -96, -96, -96, 25, -96, 28, -96, - 24, -96, 17, -96, -96, -96, -96, -96, -96, 8, - -96, -96, -55, -96, -96, -96, -96, 9, -96, 7, - -96, 1, -96, -96, -96, -96, -96, -96, -96, -96, - -96, -96, -96, -96, -96, -2, -96, -96, -5, 2, - -96, -6, -96, -96}; + -97, -97, -97, -97, -97, 29, -97, -97, -97, -97, + -97, -97, -97, -97, -97, 11, -97, 27, -97, -97, + 40, -97, -97, -97, -97, 33, -97, -97, -97, -97, + -97, -97, -97, -97, 47, -97, -43, -97, -97, -97, + -97, -97, -97, -97, -97, -97, 64, -97, -97, -97, + -97, -97, -97, -97, 17, 114, 123, 121, 122, -97, + -97, 110, 106, -97, -97, 98, -97, 103, 126, -97, + 101, 214, -97, -97, -97, -97, 130, 138, 127, -97, + -97, -97, -97, 131, -97, 107, 137, 141, 87, -97, + 55, 70, 73, 72, 69, 94, -97, 58, 63, 61, + -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, + -97, 145, -97, 82, -97, -18, 39, 41, -97, -97, + -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, + -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, + -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, + -97, -97, -97, 49, -97, -97, -97, -97, -97, 42, + -97, -97, -97, 35, -97, -97, -97, -97, -97, -97, + -97, -97, -97, -97, -97, -97, -97, 97, -97, 34, + 4, -97, -97, 8, -97, 51, -1, 50, -97, -97, + -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, + -97, -97, -97, 21, -97, -97, -97, -97, -97, -97, + -97, -97, -97, -97, -97, -97, -97, -97, -97, 53, + -97, -97, -97, -97, -97, -97, 12, -97, -97, -97, + -97, -97, -2, -97, -97, 36, -16, -97, -97, -97, + -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, + -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, + -97, -97, -97, 76, -97, -97, -97, -97, 52, -97, + -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, + -97, -97, -97, 180, -97, 183, 168, 169, 172, -97, + 90, 91, 83, 80, 79, -97, -97, -97, -97, -97, + -97, -97, -97, 146, -97, 160, -97, 144, -97, -97, + 181, -97, 62, -97, -97, 65, -97, 13, -97, 15, + -97, -7, -97, 148, -97, 150, 156, -97, -97, 182, + -97, -97, -97, -97, -97, -97, 191, -97, -44, 57, + -97, -97, 93, -97, 38, -97, 46, -97, -3, -97, + -97, -40, -97, -97, 59, -97, -97, 10, -97, 3, + -97, -9, -97, -10, -97, -97, -97, -97, -97, -97, + 23, -97, -97, -97, -97, -97, 54, 31, -97, -97, + -97, -97, -97, 74, -97, -97, 24, -97, -97, -97, + 26, -97, 5, 133, -97, 134, -97, -97, 48, -97, + 32, -97, -97, -97, -97, -97, 37, -97, -97, -97, + -97, -97, -97, 113, -97, -97, -97, -97, -97, -5, + -97, -97, -97, -97, -97, -81, -97, 7, -97, -63, + -97, -97, -97, -97, -46, -97, -97, -54, -97, -97, + -97, -97, -97, -97, -42, -97, -97, -28, -97, -97, + -97, -50, -97, -97, -97, -97, 2, -97, 1, -97, + 45, -97, 43, -97, -97, -97, -97, -97, -97, 19, + -97, -97, -34, -97, -97, -97, -97, 25, -97, 30, + -97, 44, -97, -97, -97, -97, -97, -97, -97, -97, + -97, -97, -97, -97, -97, 28, -97, -97, 22, 6, + -97, -97, -97, 9, -97, -97, -97}; const int JavaScriptGrammar::action_info [] = { - 283, 305, 408, 331, 410, -47, 359, -216, 400, -45, - -57, 268, 356, 153, 315, 398, 346, 329, 336, 317, - 323, 331, 363, 344, 303, 353, 354, -46, 161, 478, - 351, 419, 469, 199, 25, 83, 111, 451, 450, 159, - 443, 24, 7, 503, 8, 3, 464, 484, 23, 17, - 323, 478, 406, -68, -217, 443, 113, -70, 195, 460, - 456, 443, 449, 177, 447, 423, 434, 427, 433, 427, - 427, 415, 83, 196, 200, 283, 199, 359, 201, 357, - 350, 3, 0, 307, 183, 0, 303, -65, 443, 419, - 268, 342, 456, 202, 460, 192, 203, 464, 430, 153, - 338, 0, 153, 263, 153, 111, 437, 153, 153, 495, - 357, 446, 305, 0, 12, 247, 113, 496, 70, 153, - 179, 70, 153, 0, 180, 447, 262, 479, 153, 71, - 312, 153, 71, 17, 258, 257, 17, 253, 252, 153, - 260, 259, 195, 431, 70, 12, 70, 267, 266, -285, - 74, 458, 153, 339, 265, 71, 361, 71, 418, 417, - 325, 75, 260, 259, 326, 153, 250, 76, 177, 13, - 154, 488, 478, 10, 9, 480, 190, 97, 250, 98, - 12, 76, 255, 462, 97, 472, 98, 185, 0, 0, - 99, 348, 97, 12, 98, 0, 0, 99, 251, 249, - 13, 0, 12, 12, 421, 99, 186, 502, 413, 0, - 251, 249, 77, 0, 256, 254, 76, 321, 78, 0, - 97, 97, 98, 98, 153, 115, 77, 153, 21, 19, - 0, 0, 78, 99, 99, 13, 255, 0, 473, 471, - 97, 0, 98, 97, 116, 98, 117, 97, 13, 98, - 97, 0, 98, 99, 185, 0, 99, 13, 13, 0, - 99, 77, 0, 99, 285, 286, 0, 78, 256, 254, - 85, 86, 0, 186, 0, 187, 0, 441, 440, 0, - 246, 245, 285, 286, 85, 86, 0, 0, 0, 0, - 0, 287, 288, 290, 291, 0, 0, 87, 88, 0, - 0, 0, 292, 0, 0, 293, 0, 294, 0, 287, - 288, 87, 88, 0, 290, 291, 0, 0, 0, 0, - 0, 290, 291, 292, 0, 0, 293, 97, 294, 98, - 292, 0, 0, 293, 0, 294, 90, 91, 0, 0, - 99, 0, 0, 0, 92, 93, 90, 91, 94, 0, - 95, 0, 0, 0, 92, 93, 90, 91, 94, 0, - 95, 0, 0, 0, 92, 93, 90, 91, 94, 0, - 95, 0, 164, 0, 92, 93, 0, 0, 94, 0, - 95, 0, 165, 0, 90, 91, 166, 0, 0, 0, - 290, 291, 92, 93, 0, 167, 94, 168, 95, 292, - 0, 0, 293, 0, 294, 0, 0, 0, 169, 0, - 170, 74, 0, 0, 164, 0, 0, 0, 171, 0, - 0, 172, 75, 0, 165, 0, 0, 173, 166, 0, - 0, 0, 0, 174, 0, 0, 0, 167, 0, 168, - 0, 0, 0, 0, 0, 0, 175, 0, 0, 0, - 169, 0, 170, 74, 0, 47, 48, 0, 0, 0, - 171, 0, 0, 172, 75, 50, 0, 0, 0, 173, - 0, 0, 51, 0, 0, 174, 52, 53, 0, 54, - 0, 0, 0, 0, 0, 0, 57, 0, 175, 164, - 60, 0, 0, 0, 0, 0, 0, 0, 0, 165, - 0, 0, 0, 166, 0, 0, 0, 0, 63, 0, - 64, 0, 167, 0, 168, 0, 0, 319, 0, 0, - 0, 59, 66, 49, 0, 169, 0, 170, 74, 0, - 0, 47, 48, 0, 0, 171, 0, 0, 172, 75, - 0, 50, 0, 0, 173, 0, 0, 0, 51, 0, - 174, 0, 52, 53, 0, 54, 0, 0, 0, 0, - 0, 0, 57, 175, 0, 0, 60, 0, 0, 0, + 447, 346, 329, 177, 303, 323, 315, 449, 469, 111, + 83, 331, 323, 305, 312, 307, 305, 113, 331, 317, + 443, 153, 450, 283, 451, 443, 351, -48, 433, 415, + 419, -49, -67, 268, 359, -47, -70, 406, 460, 478, + 195, 456, -72, -219, -59, 443, 353, 199, -218, 427, + 434, 427, 303, 400, 354, 410, 398, 342, 363, 344, + 423, 408, 177, 356, 159, 443, 357, 23, 336, 419, + 350, 111, 359, 3, 478, 456, 464, 484, 83, 464, + 7, 247, 183, 199, 460, 283, 200, 506, 268, 196, + 203, 201, 113, 24, 192, 25, 17, 153, 153, 12, + 3, 263, 430, 153, 153, 8, 153, 153, 357, 0, + 153, 70, 70, 70, 70, 202, 153, 503, 153, 0, + 12, 74, 71, 71, 71, 71, 195, 161, 153, 260, + 259, 479, 75, -287, 17, 262, 179, 267, 266, 427, + 180, 338, 418, 417, 325, 154, 446, 431, 326, 495, + 458, 12, 153, 17, 13, 488, 462, 496, 348, 361, + 447, 97, 265, 98, 190, 504, 260, 259, 10, 9, + 421, 0, 258, 257, 99, 13, 253, 252, 250, 480, + 76, 255, 97, 97, 98, 98, 97, 472, 98, 12, + 97, 478, 98, 153, 339, 99, 99, 185, 153, 99, + 250, 0, 255, 99, 321, 0, 13, 0, 115, 76, + 251, 249, 12, 256, 254, 21, 186, 97, 413, 98, + 76, 0, 437, 153, 97, 77, 98, 116, 0, 117, + 99, 78, 251, 249, 256, 254, 97, 99, 98, 0, + 473, 471, 185, 12, 13, 0, 246, 245, 0, 99, + 0, 441, 440, 0, 77, 285, 286, 85, 86, 0, + 78, 186, 0, 187, 0, 77, 0, 13, 0, 19, + 0, 78, 85, 86, 285, 286, 0, 0, 290, 291, + 0, 0, 287, 288, 87, 88, 0, 292, 0, 0, + 293, 0, 294, 0, 0, 290, 291, 0, 13, 87, + 88, 287, 288, 97, 292, 98, 0, 293, 0, 294, + 90, 91, 0, 0, 0, 0, 99, 0, 92, 93, + 90, 91, 94, 0, 95, 0, 0, 0, 92, 93, + 90, 91, 94, 0, 95, 0, 0, 0, 92, 93, + 90, 91, 94, 0, 95, 0, 0, 164, 92, 93, + 90, 91, 94, 0, 95, 0, 0, 165, 92, 93, + 0, 166, 94, 0, 95, 0, 290, 291, 0, 0, + 167, 0, 168, 0, 0, 292, 0, 0, 293, 0, + 294, 0, 0, 169, 164, 170, 74, 0, 0, 0, + 0, 0, 0, 171, 165, 0, 172, 75, 166, 0, + 0, 0, 173, 0, 0, 0, 0, 167, 174, 168, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 169, 175, 170, 74, 0, 0, 0, 0, 0, 0, + 171, 47, 48, 172, 75, 0, 0, 0, 0, 173, + 0, 50, 0, 0, 0, 174, 0, 0, 51, 0, + 0, 0, 52, 53, 0, 54, 0, 0, 175, 0, + 0, 0, 57, 0, 0, 0, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 59, 66, 49, - 0, 0, 0, 0, 0, 0, 0, 46, 47, 48, - 0, 0, 0, 0, 0, 0, 0, 0, 50, 0, - 0, 0, 0, 0, 0, 51, 0, 0, 0, 52, - 53, 0, 54, 0, 0, 0, 55, 0, 56, 57, - 58, 0, 0, 60, 0, 0, 0, 61, 0, 62, + 0, 0, 0, 0, 0, 0, 0, 164, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 165, 0, 0, + 0, 166, 0, 0, 0, 0, 0, 0, 0, 0, + 167, 0, 168, 0, 0, 319, 0, 0, 0, 0, + 0, 0, 0, 169, 0, 170, 74, 0, 0, 0, + 0, 0, 0, 171, 0, 0, 172, 75, 0, 0, + 0, 0, 173, 0, 0, 0, 0, 0, 174, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 63, 0, 64, 0, 65, 0, 67, 0, 68, - 0, 0, 0, 0, 59, 66, 49, 0, 0, 0, - 0, 0, 0, 0, 46, 47, 48, 0, 0, 0, - 0, 0, 0, 0, 0, 50, 0, 0, 0, 0, - 0, 0, 51, 0, 0, 0, 52, 53, 0, 54, - 0, 0, 0, 55, 0, 56, 57, 58, 0, 0, - 60, 0, 0, 0, 61, 0, 62, 0, 0, 483, - 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, - 64, 0, 65, 0, 67, 0, 68, 0, 0, 0, - 0, 59, 66, 49, 0, 0, 0, 0, 0, 0, - 0, -66, 0, 0, 0, 46, 47, 48, 0, 0, - 0, 0, 0, 0, 0, 0, 50, 0, 0, 0, - 0, 0, 0, 51, 0, 0, 0, 52, 53, 0, - 54, 0, 0, 0, 55, 0, 56, 57, 58, 0, - 0, 60, 0, 0, 0, 61, 0, 62, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, - 0, 64, 0, 65, 0, 67, 0, 68, 0, 0, - 0, 0, 59, 66, 49, 0, 0, 0, 0, 0, + 0, 175, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 46, 47, 48, 0, 0, 0, 0, 0, 0, 0, 0, 50, 0, 0, 0, 0, 0, 0, 51, 0, 0, 0, 52, 53, 0, 54, 0, 0, 0, 55, 0, 56, 57, 58, 0, 0, 60, 0, 0, 0, 61, 0, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 64, 0, - 65, 0, 67, 282, 68, 0, 0, 0, 0, 59, + 65, 0, 67, 0, 68, 0, 0, 0, 0, 59, 66, 49, 0, 0, 0, 0, 0, 0, 0, 46, 47, 48, 0, 0, 0, 0, 0, 0, 0, 0, 50, 0, 0, 0, 0, 0, 0, 51, 0, 0, 0, 52, 53, 0, 54, 0, 0, 0, 55, 0, 56, 57, 58, 0, 0, 60, 0, 0, 0, 61, - 0, 62, 0, 0, 486, 0, 0, 0, 0, 0, + 0, 62, 0, 0, 483, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 64, 0, 65, 0, 67, 0, 68, 0, 0, 0, 0, 59, 66, 49, 0, - 0, 0, 0, 0, 0, 0, 120, 121, 122, 0, - 0, 124, 126, 127, 0, 0, 128, 0, 129, 0, - 0, 0, 131, 132, 133, 0, 0, 0, 0, 0, - 0, 134, 135, 136, 137, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 138, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 46, 47, 48, 0, + 0, 0, 0, 0, 0, 0, 0, 50, 0, 0, + 0, 0, 0, 0, 51, 0, 0, 0, 52, 53, + 0, 54, 0, 0, 0, 55, 0, 56, 57, 58, + 0, 0, 60, 0, 0, 0, 61, 0, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 141, 0, 0, 0, 0, 0, 0, 142, 143, - 144, 0, 146, 147, 148, 149, 150, 151, 0, 0, - 139, 145, 130, 123, 125, 140, 0, 0, 0, 0, - 120, 121, 122, 0, 0, 124, 126, 127, 0, 0, - 128, 0, 129, 0, 0, 0, 131, 132, 133, 0, - 0, 0, 0, 0, 0, 402, 135, 136, 137, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 138, - 0, 0, 0, 403, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 141, 0, 0, 0, 0, - 0, 405, 142, 143, 144, 0, 146, 147, 148, 149, - 150, 151, 0, 0, 139, 145, 130, 123, 125, 140, - 0, 0, 0, 0, 120, 121, 122, 0, 0, 124, - 126, 127, 0, 0, 128, 0, 129, 0, 0, 0, - 131, 132, 133, 0, 0, 0, 0, 0, 0, 402, - 135, 136, 137, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 138, 0, 0, 0, 403, 0, 0, - 0, 0, 0, 0, 0, 404, 0, 0, 0, 141, - 0, 0, 0, 0, 0, 405, 142, 143, 144, 0, - 146, 147, 148, 149, 150, 151, 0, 0, 139, 145, - 130, 123, 125, 140, 0, 0, 0, 0, 222, 0, - 0, 0, 0, 224, 0, 46, 47, 48, 226, 0, - 0, 0, 0, 0, 0, 227, 50, 0, 0, 0, - 0, 0, 0, 229, 230, 0, 0, 231, 53, 0, - 54, 0, 0, 0, 55, 0, 56, 57, 58, 0, - 0, 60, 0, 0, 0, 61, 0, 62, 0, 0, - 0, 0, 0, 232, 0, 233, 0, 0, 0, 63, - 234, 64, 235, 65, 236, 67, 237, 68, 238, 239, - 0, 0, 59, 66, 49, 223, 225, 0, 0, 0, - 0, 0, 222, 0, 0, 0, 0, 224, 0, 46, - 47, 48, 226, 0, 0, 0, 0, 0, 0, 227, - 50, 0, 0, 0, 0, 0, 0, 498, 230, 0, - 0, 231, 499, 0, 54, 0, 0, 0, 55, 0, - 56, 57, 58, 0, 0, 60, 0, 0, 0, 61, - 0, 62, 0, 0, 0, 0, 0, 232, 0, 233, - 0, 0, 0, 63, 234, 64, 235, 65, 236, 67, - 237, 68, 238, 239, 0, 0, 59, 66, 49, 223, - 225, 0, 0, 0, 0, 0, 222, 0, 0, 0, - 0, 224, 0, 46, 47, 48, 226, 0, 0, 0, - 0, 0, 0, 227, 228, 0, 0, 0, 0, 0, - 0, 229, 230, 0, 0, 231, 53, 0, 54, 0, + 63, 0, 64, 0, 65, 0, 67, 282, 68, 0, + 0, 0, 0, 59, 66, 49, 0, 0, 0, 0, + 0, 0, 0, 46, 47, 48, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 0, 0, 0, 0, 0, + 0, 51, 0, 0, 0, 52, 53, 0, 54, 0, 0, 0, 55, 0, 56, 57, 58, 0, 0, 60, - 0, 0, 0, 61, 0, 62, 0, 0, 0, 0, - 0, 232, 0, 233, 0, 0, 0, 63, 234, 64, - 235, 65, 236, 67, 237, 68, 238, 239, 0, 0, - 59, 66, 49, 223, 225, 0, 0, 0, 0, 0, - 372, 121, 122, 0, 0, 374, 126, 376, 47, 48, - 377, 0, 129, 0, 0, 0, 131, 379, 380, 0, - 0, 0, 0, 0, 0, 381, 382, 136, 137, 231, - 53, 0, 54, 0, 0, 0, 55, 0, 56, 383, - 58, 0, 0, 385, 0, 0, 0, 61, 0, 62, - 0, -212, 0, 0, 0, 386, 0, 233, 0, 0, - 0, 387, 388, 389, 390, 65, 392, 393, 394, 395, - 396, 397, 0, 0, 384, 391, 378, 373, 375, 140, - 0, 0, 0, 0, + 0, 0, 0, 61, 0, 62, 0, 0, 486, 0, + 0, 0, 0, 0, 0, 0, 0, 63, 0, 64, + 0, 65, 0, 67, 0, 68, 0, 0, 0, 0, + 59, 66, 49, 0, 0, 0, 0, 0, 0, 0, + -68, 0, 0, 0, 46, 47, 48, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 0, 0, 0, 0, + 0, 0, 51, 0, 0, 0, 52, 53, 0, 54, + 0, 0, 0, 55, 0, 56, 57, 58, 0, 0, + 60, 0, 0, 0, 61, 0, 62, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, + 64, 0, 65, 0, 67, 0, 68, 0, 0, 0, + 0, 59, 66, 49, 0, 0, 0, 0, 0, 0, + 0, 120, 121, 122, 0, 0, 124, 126, 127, 0, + 0, 128, 0, 129, 0, 0, 0, 131, 132, 133, + 0, 0, 0, 0, 0, 0, 134, 135, 136, 137, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 138, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 141, 0, 0, 0, + 0, 0, 0, 142, 143, 144, 0, 146, 147, 148, + 149, 150, 151, 0, 0, 139, 145, 130, 123, 125, + 140, 0, 0, 0, 0, 120, 121, 122, 0, 0, + 124, 126, 127, 0, 0, 128, 0, 129, 0, 0, + 0, 131, 132, 133, 0, 0, 0, 0, 0, 0, + 402, 135, 136, 137, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 138, 0, 0, 0, 403, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 141, 0, 0, 0, 0, 0, 405, 142, 143, 144, + 0, 146, 147, 148, 149, 150, 151, 0, 0, 139, + 145, 130, 123, 125, 140, 0, 0, 0, 0, 120, + 121, 122, 0, 0, 124, 126, 127, 0, 0, 128, + 0, 129, 0, 0, 0, 131, 132, 133, 0, 0, + 0, 0, 0, 0, 402, 135, 136, 137, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 138, 0, + 0, 0, 403, 0, 0, 0, 0, 0, 0, 0, + 404, 0, 0, 0, 141, 0, 0, 0, 0, 0, + 405, 142, 143, 144, 0, 146, 147, 148, 149, 150, + 151, 0, 0, 139, 145, 130, 123, 125, 140, 0, + 0, 0, 0, 222, 0, 0, 0, 0, 224, 0, + 46, 47, 48, 226, 0, 0, 0, 0, 0, 0, + 227, 228, 0, 0, 0, 0, 0, 0, 229, 230, + 0, 0, 231, 53, 0, 54, 0, 0, 0, 55, + 0, 56, 57, 58, 0, 0, 60, 0, 0, 0, + 61, 0, 62, 0, 0, 0, 0, 0, 232, 0, + 233, 0, 0, 0, 63, 234, 64, 235, 65, 236, + 67, 237, 68, 238, 239, 0, 0, 59, 66, 49, + 223, 225, 0, 0, 0, 0, 0, 222, 0, 0, + 0, 0, 224, 0, 46, 47, 48, 226, 0, 0, + 0, 0, 0, 0, 227, 50, 0, 0, 0, 0, + 0, 0, 229, 230, 0, 0, 231, 53, 0, 54, + 0, 0, 0, 55, 0, 56, 57, 58, 0, 0, + 60, 0, 0, 0, 61, 0, 62, 0, 0, 0, + 0, 0, 232, 0, 233, 0, 0, 0, 63, 234, + 64, 235, 65, 236, 67, 237, 68, 238, 239, 0, + 0, 59, 66, 49, 223, 225, 0, 0, 0, 0, + 0, 222, 0, 0, 0, 0, 224, 0, 46, 47, + 48, 226, 0, 0, 0, 0, 0, 0, 227, 50, + 0, 0, 0, 0, 0, 0, 498, 230, 0, 0, + 231, 499, 0, 54, 0, 0, 0, 55, 0, 56, + 57, 58, 0, 0, 60, 0, 0, 0, 61, 0, + 62, 0, 0, 0, 0, 0, 232, 0, 233, 0, + 0, 0, 63, 234, 64, 235, 65, 236, 67, 237, + 68, 238, 239, 0, 0, 59, 66, 49, 223, 225, + 0, 0, 0, 0, 0, 372, 121, 122, 0, 0, + 374, 126, 376, 47, 48, 377, 0, 129, 0, 0, + 0, 131, 379, 380, 0, 0, 0, 0, 0, 0, + 381, 382, 136, 137, 231, 53, 0, 54, 0, 0, + 0, 55, 0, 56, 383, 58, 0, 0, 385, 0, + 0, 0, 61, 0, 62, 0, -214, 0, 0, 0, + 386, 0, 233, 0, 0, 0, 387, 388, 389, 390, + 65, 392, 393, 394, 395, 396, 397, 0, 0, 384, + 391, 378, 373, 375, 140, 0, 0, 0, 0, - 22, 432, 500, 436, 501, 428, 438, 497, 435, 487, - 420, 453, 442, 182, 20, 264, 439, 482, 474, 481, - 313, 34, 22, 189, 470, 485, 463, 452, 22, 448, - 184, 163, 261, 162, 461, 457, 220, 459, 119, 352, - 347, 345, 442, 152, 439, 407, 349, 399, 261, 340, - 313, 160, 155, 364, 362, 0, 360, 358, 322, 176, - 320, 409, 318, 0, 313, 401, 313, 158, 72, 313, - 313, 0, 220, 295, 0, 220, 0, 0, 0, 0, - 119, 188, 72, 0, 72, 72, 100, 454, 102, 72, - 11, 72, 72, 101, 72, 72, 298, 296, 72, 297, - 107, 72, 72, 72, 72, 341, 299, 316, 114, 89, - 314, 343, 84, 72, 112, 490, 72, 72, 80, 489, - 72, 72, 72, 455, 454, 106, 72, 411, 79, 72, - 412, 72, 73, 455, 72, 72, 494, 72, 82, 493, - 72, 72, 491, 492, 277, 72, 72, 81, 72, 281, - 411, 96, 355, 412, 110, 72, 0, 72, 72, 72, - 248, 193, 103, 104, 72, 72, 72, 72, 193, 105, - 158, 181, 72, 108, 0, 72, 0, 191, 109, 178, - 281, 158, 72, 0, 309, 72, 306, 281, 414, 281, - 281, 309, 0, 0, 72, 72, 281, 324, 304, 281, - 281, 289, 301, 72, 309, 0, 311, 72, 281, 281, - 300, 0, 281, 330, 309, 72, 284, 0, 309, 281, - 281, 0, 302, 281, 0, 0, 337, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 328, 0, 0, 0, - 308, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 364, 362, 119, 322, 428, 452, 420, 349, 163, 313, + 189, 459, 502, 457, 360, 505, 438, 22, 436, 432, + 358, 182, 261, 318, 435, 184, 320, 453, 487, 20, + 500, 220, 340, 409, 11, 313, 470, 439, 497, 442, + 474, 261, 485, 481, 34, 448, 22, 439, 345, 352, + 152, 401, 176, 463, 407, 162, 461, 347, 158, 160, + 442, 482, 72, 220, 0, 399, 155, 158, 313, 220, + 0, 119, 188, 313, 191, 0, 313, 0, 181, 0, + 277, 0, 72, 72, 193, 281, 72, 264, 96, 72, + 100, 72, 72, 102, 193, 101, 411, 72, 72, 412, + 72, 72, 106, 103, 313, 105, 104, 72, 72, 341, + 72, 72, 299, 298, 314, 72, 297, 316, 72, 72, + 114, 110, 72, 295, 296, 72, 72, 107, 494, 72, + 158, 72, 73, 454, 72, 72, 493, 414, 72, 178, + 492, 89, 72, 411, 489, 343, 412, 0, 248, 355, + 72, 72, 491, 490, 72, 72, 455, 81, 72, 72, + 79, 72, 72, 454, 455, 72, 72, 84, 80, 72, + 0, 108, 309, 72, 72, 109, 72, 281, 72, 281, + 0, 281, 0, 281, 309, 112, 0, 304, 72, 281, + 0, 324, 0, 281, 308, 327, 72, 72, 0, 306, + 72, 281, 281, 300, 301, 281, 328, 302, 72, 309, + 309, 72, 0, 281, 281, 281, 281, 284, 289, 309, + 0, 0, 0, 0, 281, 0, 0, 0, 0, 0, + 0, 311, 330, 0, 0, 0, 0, 0, 0, 0, + 0, 337, 72, 0, 0, 82, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 72, 0, 0, 0, 0, 281, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 327, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0}; const int JavaScriptGrammar::action_check [] = { - 1, 76, 55, 29, 55, 7, 36, 29, 8, 7, - 7, 36, 55, 8, 61, 7, 31, 7, 17, 60, - 2, 29, 16, 60, 48, 60, 33, 7, 60, 8, - 36, 36, 17, 29, 7, 1, 48, 60, 29, 8, - 33, 29, 0, 29, 65, 85, 29, 8, 29, 33, - 2, 8, 7, 7, 29, 33, 76, 7, 29, 36, - 36, 33, 36, 2, 20, 33, 7, 5, 55, 5, - 5, 60, 1, 36, 8, 1, 29, 36, 29, 7, - 29, 85, -1, 8, 7, -1, 48, 7, 33, 36, - 36, 61, 36, 60, 36, 60, 33, 29, 10, 8, - 8, -1, 8, 36, 8, 48, 7, 8, 8, 7, - 7, 6, 76, -1, 29, 55, 76, 15, 40, 8, - 50, 40, 8, -1, 54, 20, 74, 8, 8, 51, - 61, 8, 51, 33, 61, 62, 33, 61, 62, 8, - 61, 62, 29, 55, 40, 29, 40, 61, 62, 36, - 42, 60, 8, 61, 60, 51, 60, 51, 61, 62, - 50, 53, 61, 62, 54, 8, 29, 12, 2, 84, - 56, 60, 8, 61, 62, 56, 56, 25, 29, 27, - 29, 12, 29, 60, 25, 8, 27, 15, -1, -1, - 38, 60, 25, 29, 27, -1, -1, 38, 61, 62, - 84, -1, 29, 29, 60, 38, 34, 56, 36, -1, - 61, 62, 57, -1, 61, 62, 12, 60, 63, -1, - 25, 25, 27, 27, 8, 15, 57, 8, 55, 55, - -1, -1, 63, 38, 38, 84, 29, -1, 61, 62, - 25, -1, 27, 25, 34, 27, 36, 25, 84, 27, - 25, -1, 27, 38, 15, -1, 38, 84, 84, -1, - 38, 57, -1, 38, 18, 19, -1, 63, 61, 62, - 18, 19, -1, 34, -1, 36, -1, 61, 62, -1, - 61, 62, 18, 19, 18, 19, -1, -1, -1, -1, - -1, 45, 46, 23, 24, -1, -1, 45, 46, -1, - -1, -1, 32, -1, -1, 35, -1, 37, -1, 45, - 46, 45, 46, -1, 23, 24, -1, -1, -1, -1, - -1, 23, 24, 32, -1, -1, 35, 25, 37, 27, - 32, -1, -1, 35, -1, 37, 23, 24, -1, -1, - 38, -1, -1, -1, 31, 32, 23, 24, 35, -1, - 37, -1, -1, -1, 31, 32, 23, 24, 35, -1, - 37, -1, -1, -1, 31, 32, 23, 24, 35, -1, - 37, -1, 3, -1, 31, 32, -1, -1, 35, -1, - 37, -1, 13, -1, 23, 24, 17, -1, -1, -1, - 23, 24, 31, 32, -1, 26, 35, 28, 37, 32, - -1, -1, 35, -1, 37, -1, -1, -1, 39, -1, - 41, 42, -1, -1, 3, -1, -1, -1, 49, -1, - -1, 52, 53, -1, 13, -1, -1, 58, 17, -1, - -1, -1, -1, 64, -1, -1, -1, 26, -1, 28, - -1, -1, -1, -1, -1, -1, 77, -1, -1, -1, - 39, -1, 41, 42, -1, 12, 13, -1, -1, -1, - 49, -1, -1, 52, 53, 22, -1, -1, -1, 58, - -1, -1, 29, -1, -1, 64, 33, 34, -1, 36, - -1, -1, -1, -1, -1, -1, 43, -1, 77, 3, - 47, -1, -1, -1, -1, -1, -1, -1, -1, 13, - -1, -1, -1, 17, -1, -1, -1, -1, 65, -1, - 67, -1, 26, -1, 28, -1, -1, 31, -1, -1, - -1, 78, 79, 80, -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, + 20, 31, 7, 2, 48, 2, 61, 36, 17, 48, + 1, 29, 2, 76, 61, 8, 76, 76, 29, 60, + 33, 8, 29, 1, 60, 33, 36, 7, 55, 60, + 36, 7, 7, 36, 36, 7, 7, 7, 36, 8, + 29, 36, 7, 29, 7, 33, 60, 29, 29, 5, + 7, 5, 48, 8, 33, 55, 7, 61, 16, 60, + 33, 55, 2, 55, 8, 33, 7, 29, 17, 36, + 29, 48, 36, 85, 8, 36, 29, 8, 1, 29, + 0, 55, 7, 29, 36, 1, 8, 29, 36, 36, + 33, 29, 76, 29, 60, 7, 33, 8, 8, 29, + 85, 36, 10, 8, 8, 65, 8, 8, 7, -1, + 8, 40, 40, 40, 40, 60, 8, 8, 8, -1, + 29, 42, 51, 51, 51, 51, 29, 60, 8, 61, + 62, 8, 53, 36, 33, 74, 50, 61, 62, 5, + 54, 8, 61, 62, 50, 56, 6, 55, 54, 7, + 60, 29, 8, 33, 84, 60, 60, 15, 60, 60, + 20, 25, 60, 27, 56, 56, 61, 62, 61, 62, + 60, -1, 61, 62, 38, 84, 61, 62, 29, 56, + 12, 29, 25, 25, 27, 27, 25, 8, 27, 29, + 25, 8, 27, 8, 61, 38, 38, 15, 8, 38, + 29, -1, 29, 38, 60, -1, 84, -1, 15, 12, + 61, 62, 29, 61, 62, 55, 34, 25, 36, 27, + 12, -1, 7, 8, 25, 57, 27, 34, -1, 36, + 38, 63, 61, 62, 61, 62, 25, 38, 27, -1, + 61, 62, 15, 29, 84, -1, 61, 62, -1, 38, + -1, 61, 62, -1, 57, 18, 19, 18, 19, -1, + 63, 34, -1, 36, -1, 57, -1, 84, -1, 55, + -1, 63, 18, 19, 18, 19, -1, -1, 23, 24, + -1, -1, 45, 46, 45, 46, -1, 32, -1, -1, + 35, -1, 37, -1, -1, 23, 24, -1, 84, 45, + 46, 45, 46, 25, 32, 27, -1, 35, -1, 37, + 23, 24, -1, -1, -1, -1, 38, -1, 31, 32, + 23, 24, 35, -1, 37, -1, -1, -1, 31, 32, + 23, 24, 35, -1, 37, -1, -1, -1, 31, 32, + 23, 24, 35, -1, 37, -1, -1, 3, 31, 32, + 23, 24, 35, -1, 37, -1, -1, 13, 31, 32, + -1, 17, 35, -1, 37, -1, 23, 24, -1, -1, + 26, -1, 28, -1, -1, 32, -1, -1, 35, -1, + 37, -1, -1, 39, 3, 41, 42, -1, -1, -1, + -1, -1, -1, 49, 13, -1, 52, 53, 17, -1, + -1, -1, 58, -1, -1, -1, -1, 26, 64, 28, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 39, 77, 41, 42, -1, -1, -1, -1, -1, -1, + 49, 12, 13, 52, 53, -1, -1, -1, -1, 58, + -1, 22, -1, -1, -1, 64, -1, -1, 29, -1, + -1, -1, 33, 34, -1, 36, -1, -1, 77, -1, + -1, -1, 43, -1, -1, -1, 47, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 65, -1, 67, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 78, 79, 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, 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, 65, -1, 67, -1, 69, -1, 71, -1, 73, - -1, -1, -1, -1, 78, 79, 80, -1, -1, -1, - -1, -1, -1, -1, 11, 12, 13, -1, -1, -1, - -1, -1, -1, -1, -1, 22, -1, -1, -1, -1, - -1, -1, 29, -1, -1, -1, 33, 34, -1, 36, - -1, -1, -1, 40, -1, 42, 43, 44, -1, -1, - 47, -1, -1, -1, 51, -1, 53, -1, -1, 56, - -1, -1, -1, -1, -1, -1, -1, -1, 65, -1, - 67, -1, 69, -1, 71, -1, 73, -1, -1, -1, - -1, 78, 79, 80, -1, -1, -1, -1, -1, -1, - -1, 7, -1, -1, -1, 11, 12, 13, -1, -1, - -1, -1, -1, -1, -1, -1, 22, -1, -1, -1, - -1, -1, -1, 29, -1, -1, -1, 33, 34, -1, - 36, -1, -1, -1, 40, -1, 42, 43, 44, -1, - -1, 47, -1, -1, -1, 51, -1, 53, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 65, - -1, 67, -1, 69, -1, 71, -1, 73, -1, -1, - -1, -1, 78, 79, 80, -1, -1, -1, -1, -1, + -1, 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, -1, 78, + 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, @@ -539,98 +513,120 @@ const int JavaScriptGrammar::action_check [] = { -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, 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, - -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, + 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, 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, + -1, -1, -1, 51, -1, 53, -1, -1, 56, -1, + -1, -1, -1, -1, -1, -1, -1, 65, -1, 67, + -1, 69, -1, 71, -1, 73, -1, -1, -1, -1, + 78, 79, 80, -1, -1, -1, -1, -1, -1, -1, + 7, -1, -1, -1, 11, 12, 13, -1, -1, -1, + -1, -1, -1, -1, -1, 22, -1, -1, -1, -1, + -1, -1, 29, -1, -1, -1, 33, 34, -1, 36, + -1, -1, -1, 40, -1, 42, 43, 44, -1, -1, + 47, -1, -1, -1, 51, -1, 53, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 65, -1, + 67, -1, 69, -1, 71, -1, 73, -1, -1, -1, + -1, 78, 79, 80, -1, -1, -1, -1, -1, -1, + -1, 4, 5, 6, -1, -1, 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, 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, - 6, 81, 7, 10, 2, 84, 69, 9, 69, 10, - 10, 54, 54, 16, 2, 10, 10, 16, 73, 12, - 10, 10, 6, 10, 16, 16, 9, 54, 6, 86, - 16, 50, 9, 7, 10, 10, 9, 9, 19, 88, - 10, 9, 54, 10, 10, 16, 9, 16, 9, 75, - 10, 16, 16, 9, 9, -1, 10, 9, 9, 16, - 10, 9, 9, -1, 10, 18, 10, 16, 27, 10, - 10, -1, 9, 32, -1, 9, -1, -1, -1, -1, - 19, 20, 27, -1, 27, 27, 31, 29, 31, 27, - 5, 27, 27, 31, 27, 27, 32, 32, 27, 32, - 32, 27, 27, 27, 27, 51, 32, 51, 37, 33, - 51, 51, 35, 27, 39, 29, 27, 27, 29, 29, - 27, 27, 27, 29, 29, 32, 27, 21, 29, 27, - 24, 27, 30, 29, 27, 27, 29, 27, 30, 29, - 27, 27, 29, 29, 27, 27, 27, 29, 27, 32, - 21, 32, 89, 24, 33, 27, -1, 27, 27, 27, - 94, 29, 32, 32, 27, 27, 27, 27, 29, 32, - 16, 43, 27, 33, -1, 27, -1, 23, 33, 41, - 32, 16, 27, -1, 27, 27, 38, 32, 23, 32, - 32, 27, -1, -1, 27, 27, 32, 42, 40, 32, - 32, 34, 34, 27, 27, -1, 49, 27, 32, 32, - 34, -1, 32, 49, 27, 27, 36, -1, 27, 32, - 32, -1, 34, 32, -1, -1, 49, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 49, -1, -1, -1, - 49, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 10, 10, 20, 10, 85, 55, 11, 10, 51, 11, + 11, 10, 6, 11, 11, 6, 70, 6, 11, 82, + 10, 17, 10, 10, 70, 17, 11, 55, 11, 2, + 8, 10, 76, 10, 5, 11, 17, 11, 10, 55, + 74, 10, 17, 13, 11, 87, 6, 11, 10, 89, + 11, 19, 17, 10, 17, 8, 11, 11, 17, 17, + 55, 17, 28, 10, -1, 17, 17, 17, 11, 10, + -1, 20, 21, 11, 24, -1, 11, -1, 44, -1, + 28, -1, 28, 28, 30, 33, 28, 11, 33, 28, + 32, 28, 28, 32, 30, 32, 22, 28, 28, 25, + 28, 28, 33, 33, 11, 33, 33, 28, 28, 52, + 28, 28, 33, 33, 52, 28, 33, 52, 28, 28, + 38, 34, 28, 33, 33, 28, 28, 33, 30, 28, + 17, 28, 31, 30, 28, 28, 30, 24, 28, 42, + 30, 34, 28, 22, 30, 52, 25, -1, 95, 90, + 28, 28, 30, 30, 28, 28, 30, 30, 28, 28, + 30, 28, 28, 30, 30, 28, 28, 36, 30, 28, + -1, 34, 28, 28, 28, 34, 28, 33, 28, 33, + -1, 33, -1, 33, 28, 40, -1, 41, 28, 33, + -1, 43, -1, 33, 50, 45, 28, 28, -1, 39, + 28, 33, 33, 35, 35, 33, 50, 35, 28, 28, + 28, 28, -1, 33, 33, 33, 33, 37, 35, 28, + -1, -1, -1, -1, 33, -1, -1, -1, -1, -1, + -1, 50, 50, -1, -1, -1, -1, -1, -1, -1, + -1, 50, 28, -1, -1, 31, -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, 27, -1, -1, -1, -1, 32, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 44, -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, -1}; + -1}; diff --git a/src/declarative/qml/parser/javascriptgrammar_p.h b/src/declarative/qml/parser/javascriptgrammar_p.h index 12c2566..10f0313 100644 --- a/src/declarative/qml/parser/javascriptgrammar_p.h +++ b/src/declarative/qml/parser/javascriptgrammar_p.h @@ -96,14 +96,14 @@ public: T_XOR_EQ = 77, ACCEPT_STATE = 7, - RULE_COUNT = 289, - STATE_COUNT = 504, + RULE_COUNT = 291, + STATE_COUNT = 507, TERMINAL_COUNT = 88, - NON_TERMINAL_COUNT = 96, + NON_TERMINAL_COUNT = 97, - GOTO_INDEX_OFFSET = 504, - GOTO_INFO_OFFSET = 1584, - GOTO_CHECK_OFFSET = 1584 + GOTO_INDEX_OFFSET = 507, + GOTO_INFO_OFFSET = 1569, + GOTO_CHECK_OFFSET = 1569 }; static const char *const spell []; diff --git a/src/declarative/qml/parser/javascriptparser.cpp b/src/declarative/qml/parser/javascriptparser.cpp index b91ff5b..a399c36 100644 --- a/src/declarative/qml/parser/javascriptparser.cpp +++ b/src/declarative/qml/parser/javascriptparser.cpp @@ -202,20 +202,30 @@ case 9: { } break; case 10: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).UiObjectMember); +} break; + +case 11: { + AST::UiObjectMemberList *node = makeAstNode (driver->nodePool(), + sym(1).UiObjectMemberList, sym(3).UiObjectMember); + sym(1).Node = node; +} break; + +case 12: { AST::UiObjectInitializer *node = makeAstNode (driver->nodePool(), (AST::UiObjectMemberList*)0); node->lbraceToken = loc(1); node->rbraceToken = loc(2); sym(1).Node = node; } break; -case 11: { +case 13: { AST::UiObjectInitializer *node = makeAstNode (driver->nodePool(), sym(2).UiObjectMemberList->finish()); node->lbraceToken = loc(1); node->rbraceToken = loc(3); sym(1).Node = node; } break; -case 12: { +case 14: { AST::UiObjectBinding *node = makeAstNode (driver->nodePool(), sym(1).UiQualifiedId->finish(), sym(3).sval, sym(4).UiObjectInitializer); node->colonToken = loc(2); @@ -223,14 +233,14 @@ case 12: { sym(1).Node = node; } break; -case 13: { +case 15: { AST::UiObjectDefinition *node = makeAstNode (driver->nodePool(), sym(1).sval, sym(2).UiObjectInitializer); node->identifierToken = loc(1); sym(1).Node = node; } break; -case 14: { +case 16: { AST::UiArrayBinding *node = makeAstNode (driver->nodePool(), sym(1).UiQualifiedId->finish(), sym(4).UiObjectMemberList->finish()); node->colonToken = loc(2); @@ -239,14 +249,14 @@ case 14: { sym(1).Node = node; } break; -case 15: { +case 17: { AST::UiScriptBinding *node = makeAstNode (driver->nodePool(), sym(1).UiQualifiedId->finish(), sym(3).Statement); node->colonToken = loc(2); sym(1).Node = node; } break; -case 16: { +case 18: { AST::UiPublicMember *node = makeAstNode (driver->nodePool(), sym(2).sval, sym(3).sval, sym(5).Expression, sym(6).UiObjectInitializer); node->publicToken = loc(1); @@ -256,7 +266,7 @@ case 16: { sym(1).Node = node; } break; -case 17: { +case 19: { AST::UiPublicMember *node = makeAstNode (driver->nodePool(), sym(2).sval, sym(3).sval); node->publicToken = loc(1); node->attributeTypeToken = loc(2); @@ -264,7 +274,7 @@ case 17: { sym(1).Node = node; } break; -case 18: { +case 20: { AST::UiPublicMember *node = makeAstNode (driver->nodePool(), sym(2).sval, sym(3).sval, sym(5).Expression, static_cast(0)); node->publicToken = loc(1); @@ -274,61 +284,61 @@ case 18: { sym(1).Node = node; } break; -case 19: { +case 21: { AST::UiQualifiedId *node = makeAstNode (driver->nodePool(), sym(1).sval); node->identifierToken = loc(1); sym(1).Node = node; } break; -case 20: { +case 22: { AST::UiQualifiedId *node = makeAstNode (driver->nodePool(), sym(1).UiQualifiedId, sym(3).sval); node->identifierToken = loc(3); sym(1).Node = node; } break; -case 21: { +case 23: { AST::ThisExpression *node = makeAstNode (driver->nodePool()); node->thisToken = loc(1); sym(1).Node = node; } break; -case 22: { +case 24: { AST::IdentifierExpression *node = makeAstNode (driver->nodePool(), sym(1).sval); node->identifierToken = loc(1); sym(1).Node = node; } break; -case 23: { +case 25: { AST::NullExpression *node = makeAstNode (driver->nodePool()); node->nullToken = loc(1); sym(1).Node = node; } break; -case 24: { +case 26: { AST::TrueLiteral *node = makeAstNode (driver->nodePool()); node->trueToken = loc(1); sym(1).Node = node; } break; -case 25: { +case 27: { AST::FalseLiteral *node = makeAstNode (driver->nodePool()); node->falseToken = loc(1); sym(1).Node = node; } break; -case 26: { +case 28: { AST::NumericLiteral *node = makeAstNode (driver->nodePool(), sym(1).dval); node->literalToken = loc(1); sym(1).Node = node; } break; -case 27: { +case 29: { AST::StringLiteral *node = makeAstNode (driver->nodePool(), sym(1).sval); node->literalToken = loc(1); sym(1).Node = node; } break; -case 28: { +case 30: { bool rx = lexer->scanRegExp(Lexer::NoPrefix); if (!rx) { diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, lexer->startLineNo(), @@ -340,7 +350,7 @@ case 28: { sym(1).Node = node; } break; -case 29: { +case 31: { bool rx = lexer->scanRegExp(Lexer::EqualPrefix); if (!rx) { diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, lexer->startLineNo(), @@ -352,85 +362,81 @@ case 29: { sym(1).Node = node; } break; -case 30: { +case 32: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Elision); } break; -case 31: { +case 33: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).ElementList->finish ()); } break; -case 32: { +case 34: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).ElementList->finish (), sym(4).Elision); } break; -case 33: { +case 35: { if (sym(2).Node) sym(1).Node = makeAstNode (driver->nodePool(), sym(2).PropertyNameAndValueList->finish ()); else sym(1).Node = makeAstNode (driver->nodePool()); } break; -case 34: { +case 36: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).PropertyNameAndValueList->finish ()); } break; -case 35: { +case 37: { sym(1) = sym(2); } break; -case 36: { +case 38: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Elision, sym(2).Expression); } break; -case 37: { +case 39: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).ElementList, sym(3).Elision, sym(4).Expression); } break; -case 38: { +case 40: { sym(1).Node = makeAstNode (driver->nodePool()); } break; -case 39: { +case 41: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Elision); } break; -case 40: { +case 42: { sym(1).Node = 0; } break; -case 41: { +case 43: { sym(1).Elision = sym(1).Elision->finish (); } break; -case 42: { +case 44: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).PropertyName, sym(3).Expression); } break; -case 43: { +case 45: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).PropertyNameAndValueList, sym(3).PropertyName, sym(5).Expression); } break; -case 44: { +case 46: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).sval); } break; -case 45: { +case 47: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).sval); } break; -case 46: { +case 48: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).dval); } break; -case 47: { +case 49: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).sval); } break; -case 48: - -case 49: - case 50: case 51: @@ -488,22 +494,26 @@ case 76: case 77: case 78: + +case 79: + +case 80: { sym(1).sval = driver->intern(lexer->characterBuffer(), lexer->characterCount()); } break; -case 83: { +case 85: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression); } break; -case 84: { +case 86: { AST::FieldMemberExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).sval); node->dotToken = loc(2); node->identifierToken = loc(3); sym(1).Node = node; } break; -case 85: { +case 87: { AST::NewMemberExpression *node = makeAstNode (driver->nodePool(), sym(2).Expression, sym(4).ArgumentList); node->newToken = loc(1); node->lparenToken = loc(3); @@ -511,209 +521,205 @@ case 85: { sym(1).Node = node; } break; -case 87: { +case 89: { AST::NewExpression *node = makeAstNode (driver->nodePool(), sym(2).Expression); node->newToken = loc(1); sym(1).Node = node; } break; -case 88: { +case 90: { AST::CallExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).ArgumentList); node->lparenToken = loc(2); node->rparenToken = loc(4); sym(1).Node = node; } break; -case 89: { +case 91: { AST::CallExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).ArgumentList); node->lparenToken = loc(2); node->rparenToken = loc(4); sym(1).Node = node; } break; -case 90: { +case 92: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression); } break; -case 91: { +case 93: { AST::FieldMemberExpression *node = makeAstNode (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: { sym(1).Node = 0; } break; -case 93: { +case 95: { sym(1).Node = sym(1).ArgumentList->finish(); } break; -case 94: { +case 96: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression); } break; -case 95: { +case 97: { AST::ArgumentList *node = makeAstNode (driver->nodePool(), sym(1).ArgumentList, sym(3).Expression); node->commaToken = loc(2); sym(1).Node = node; } break; -case 99: { +case 101: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression); } break; -case 100: { +case 102: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression); } break; -case 102: { +case 104: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); } break; -case 103: { +case 105: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); } break; -case 104: { +case 106: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); } break; -case 105: { +case 107: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); } break; -case 106: { +case 108: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); } break; -case 107: { +case 109: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); } break; -case 108: { +case 110: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); } break; -case 109: { +case 111: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); } break; -case 110: { +case 112: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); } break; -case 112: { +case 114: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Mul, sym(3).Expression); } break; -case 113: { +case 115: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Div, sym(3).Expression); } break; -case 114: { +case 116: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Mod, sym(3).Expression); } break; -case 116: { +case 118: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Add, sym(3).Expression); } break; -case 117: { +case 119: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Sub, sym(3).Expression); } break; -case 119: { +case 121: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::LShift, sym(3).Expression); } break; -case 120: { +case 122: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::RShift, sym(3).Expression); } break; -case 121: { +case 123: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::URShift, sym(3).Expression); } break; -case 123: { +case 125: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Lt, sym(3).Expression); } break; -case 124: { +case 126: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Gt, sym(3).Expression); } break; -case 125: { +case 127: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Le, sym(3).Expression); } break; -case 126: { +case 128: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Ge, sym(3).Expression); } break; -case 127: { +case 129: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::InstanceOf, sym(3).Expression); } break; -case 128: { +case 130: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::In, sym(3).Expression); } break; -case 130: { +case 132: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Lt, sym(3).Expression); } break; -case 131: { +case 133: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Gt, sym(3).Expression); } break; -case 132: { +case 134: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Le, sym(3).Expression); } break; -case 133: { +case 135: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Ge, sym(3).Expression); } break; -case 134: { +case 136: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::InstanceOf, sym(3).Expression); } break; -case 136: { +case 138: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Equal, sym(3).Expression); } break; -case 137: { +case 139: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::NotEqual, sym(3).Expression); } break; -case 138: { +case 140: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::StrictEqual, sym(3).Expression); } break; -case 139: { +case 141: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::StrictNotEqual, sym(3).Expression); } break; -case 141: { +case 143: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Equal, sym(3).Expression); } break; -case 142: { +case 144: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::NotEqual, sym(3).Expression); } break; -case 143: { +case 145: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::StrictEqual, sym(3).Expression); } break; -case 144: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::StrictNotEqual, sym(3).Expression); -} break; - case 146: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::BitAnd, sym(3).Expression); + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::StrictNotEqual, sym(3).Expression); } break; case 148: { @@ -721,7 +727,7 @@ case 148: { } break; case 150: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::BitXor, sym(3).Expression); + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::BitAnd, sym(3).Expression); } break; case 152: { @@ -729,7 +735,7 @@ case 152: { } break; case 154: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::BitOr, sym(3).Expression); + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::BitXor, sym(3).Expression); } break; case 156: { @@ -737,7 +743,7 @@ case 156: { } break; case 158: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::And, sym(3).Expression); + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::BitOr, sym(3).Expression); } break; case 160: { @@ -745,7 +751,7 @@ case 160: { } break; case 162: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Or, sym(3).Expression); + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::And, sym(3).Expression); } break; case 164: { @@ -753,7 +759,7 @@ case 164: { } break; case 166: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression, sym(5).Expression); + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Or, sym(3).Expression); } break; case 168: { @@ -761,291 +767,295 @@ case 168: { } break; case 170: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(2).ival, sym(3).Expression); + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression, sym(5).Expression); } break; case 172: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(2).ival, sym(3).Expression); } break; -case 173: { +case 174: { + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(2).ival, sym(3).Expression); +} break; + +case 175: { sym(1).ival = QSOperator::Assign; } break; -case 174: { +case 176: { sym(1).ival = QSOperator::InplaceMul; } break; -case 175: { +case 177: { sym(1).ival = QSOperator::InplaceDiv; } break; -case 176: { +case 178: { sym(1).ival = QSOperator::InplaceMod; } break; -case 177: { +case 179: { sym(1).ival = QSOperator::InplaceAdd; } break; -case 178: { +case 180: { sym(1).ival = QSOperator::InplaceSub; } break; -case 179: { +case 181: { sym(1).ival = QSOperator::InplaceLeftShift; } break; -case 180: { +case 182: { sym(1).ival = QSOperator::InplaceRightShift; } break; -case 181: { +case 183: { sym(1).ival = QSOperator::InplaceURightShift; } break; -case 182: { +case 184: { sym(1).ival = QSOperator::InplaceAnd; } break; -case 183: { +case 185: { sym(1).ival = QSOperator::InplaceXor; } break; -case 184: { +case 186: { sym(1).ival = QSOperator::InplaceOr; } break; -case 186: { +case 188: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression); } break; -case 187: { +case 189: { sym(1).Node = 0; } break; -case 190: { +case 192: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression); } break; -case 191: { +case 193: { sym(1).Node = 0; } break; -case 208: { +case 210: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).StatementList); } break; -case 209: { +case 211: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Statement); } break; -case 210: { +case 212: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).StatementList, sym(2).Statement); } break; -case 211: { +case 213: { sym(1).Node = 0; } break; -case 212: { +case 214: { sym(1).Node = sym(1).StatementList->finish (); } break; -case 214: { +case 216: { AST::VariableStatement *node = makeAstNode (driver->nodePool(), sym(2).VariableDeclarationList->finish (/*readOnly=*/sym(1).ival == T_CONST)); node->declarationKindToken = loc(1); node->semicolonToken = loc(3); sym(1).Node = node; } break; -case 215: { +case 217: { sym(1).ival = T_CONST; } break; -case 216: { +case 218: { sym(1).ival = T_VAR; } break; -case 217: { +case 219: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).VariableDeclaration); } break; -case 218: { +case 220: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).VariableDeclarationList, sym(3).VariableDeclaration); } break; -case 219: { +case 221: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).VariableDeclaration); } break; -case 220: { +case 222: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).VariableDeclarationList, sym(3).VariableDeclaration); } break; -case 221: { +case 223: { AST::VariableDeclaration *node = makeAstNode (driver->nodePool(), sym(1).sval, sym(2).Expression); node->identifierToken = loc(1); sym(1).Node = node; } break; -case 222: { +case 224: { AST::VariableDeclaration *node = makeAstNode (driver->nodePool(), sym(1).sval, sym(2).Expression); node->identifierToken = loc(1); sym(1).Node = node; } break; -case 223: { +case 225: { sym(1) = sym(2); } break; -case 224: { +case 226: { sym(1).Node = 0; } break; -case 226: { +case 228: { sym(1) = sym(2); } break; -case 227: { +case 229: { sym(1).Node = 0; } break; -case 229: { +case 231: { sym(1).Node = makeAstNode (driver->nodePool()); } break; -case 231: { +case 233: { AST::ExpressionStatement *node = makeAstNode (driver->nodePool(), sym(1).Expression); node->semicolonToken = loc(2); sym(1).Node = node; } break; -case 232: { +case 234: { sym(1).Node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Statement, sym(7).Statement); } break; -case 233: { +case 235: { sym(1).Node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Statement); } break; -case 235: { +case 237: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Statement, sym(5).Expression); } break; -case 236: { +case 238: { sym(1).Node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Statement); } break; -case 237: { +case 239: { sym(1).Node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Expression, sym(7).Expression, sym(9).Statement); } break; -case 238: { +case 240: { sym(1).Node = makeAstNode (driver->nodePool(), sym(4).VariableDeclarationList->finish (/*readOnly=*/false), sym(6).Expression, sym(8).Expression, sym(10).Statement); } break; -case 239: { +case 241: { sym(1).Node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Expression, sym(7).Statement); } break; -case 240: { +case 242: { sym(1).Node = makeAstNode (driver->nodePool(), sym(4).VariableDeclaration, sym(6).Expression, sym(8).Statement); } break; -case 242: { +case 244: { sym(1).Node = makeAstNode (driver->nodePool()); } break; -case 244: { +case 246: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).sval); } break; -case 246: { +case 248: { sym(1).Node = makeAstNode (driver->nodePool()); } break; -case 248: { +case 250: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).sval); } break; -case 250: { +case 252: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); } break; -case 251: { +case 253: { sym(1).Node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Statement); } break; -case 252: { +case 254: { sym(1).Node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).CaseBlock); } break; -case 253: { +case 255: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).CaseClauses); } break; -case 254: { +case 256: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).CaseClauses, sym(3).DefaultClause, sym(4).CaseClauses); } break; -case 255: { +case 257: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).CaseClause); } break; -case 256: { +case 258: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).CaseClauses, sym(2).CaseClause); } break; -case 257: { +case 259: { sym(1).Node = 0; } break; -case 258: { +case 260: { sym(1).Node = sym(1).CaseClauses->finish (); } break; -case 259: { +case 261: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression, sym(4).StatementList); } break; -case 260: { +case 262: { sym(1).Node = makeAstNode (driver->nodePool(), sym(3).StatementList); } break; -case 261: { +case 263: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).sval, sym(3).Statement); } break; -case 263: { +case 265: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); } break; -case 264: { +case 266: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Statement, sym(3).Catch); } break; -case 265: { +case 267: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Statement, sym(3).Finally); } break; -case 266: { +case 268: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Statement, sym(3).Catch, sym(4).Finally); } break; -case 267: { +case 269: { sym(1).Node = makeAstNode (driver->nodePool(), sym(3).sval, sym(5).Statement); } break; -case 268: { +case 270: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Statement); } break; -case 270: { +case 272: { sym(1).Node = makeAstNode (driver->nodePool()); } break; -case 271: { +case 273: { AST::FunctionDeclaration *node = makeAstNode (driver->nodePool(), sym(2).sval, sym(4).FormalParameterList, sym(7).FunctionBody); node->functionToken = loc(1); node->identifierToken = loc(2); @@ -1056,7 +1066,7 @@ case 271: { sym(1).Node = node; } break; -case 272: { +case 274: { AST::FunctionExpression *node = makeAstNode (driver->nodePool(), sym(2).sval, sym(4).FormalParameterList, sym(7).FunctionBody); node->functionToken = loc(1); if (sym(2).sval) @@ -1068,56 +1078,56 @@ case 272: { sym(1).Node = node; } break; -case 273: { +case 275: { AST::FormalParameterList *node = makeAstNode (driver->nodePool(), sym(1).sval); node->identifierToken = loc(1); sym(1).Node = node; } break; -case 274: { +case 276: { AST::FormalParameterList *node = makeAstNode (driver->nodePool(), sym(1).FormalParameterList, sym(3).sval); node->commaToken = loc(2); node->identifierToken = loc(3); sym(1).Node = node; } break; -case 275: { +case 277: { sym(1).Node = 0; } break; -case 276: { +case 278: { sym(1).Node = sym(1).FormalParameterList->finish (); } break; -case 277: { +case 279: { sym(1).Node = 0; } break; -case 279: { +case 281: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).SourceElements->finish ()); } break; -case 280: { +case 282: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).SourceElement); } break; -case 281: { +case 283: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).SourceElements, sym(2).SourceElement); } break; -case 282: { +case 284: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Statement); } break; -case 283: { +case 285: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).FunctionDeclaration); } break; -case 284: { +case 286: { sym(1).sval = 0; } break; -case 286: { +case 288: { sym(1).Node = 0; } break; diff --git a/src/declarative/qml/parser/javascriptparser_p.h b/src/declarative/qml/parser/javascriptparser_p.h index abebf4f..e982985 100644 --- a/src/declarative/qml/parser/javascriptparser_p.h +++ b/src/declarative/qml/parser/javascriptparser_p.h @@ -203,9 +203,9 @@ protected: }; -#define J_SCRIPT_REGEXPLITERAL_RULE1 28 +#define J_SCRIPT_REGEXPLITERAL_RULE1 30 -#define J_SCRIPT_REGEXPLITERAL_RULE2 29 +#define J_SCRIPT_REGEXPLITERAL_RULE2 31 QT_END_NAMESPACE diff --git a/src/declarative/qml/qmlcomponent.cpp b/src/declarative/qml/qmlcomponent.cpp index 4a3f9b0..ca849ad 100644 --- a/src/declarative/qml/qmlcomponent.cpp +++ b/src/declarative/qml/qmlcomponent.cpp @@ -345,20 +345,6 @@ void QmlComponent::loadUrl(const QUrl &url) d->fromTypeData(data); -<<<<<<< HEAD:src/declarative/qml/qmlcomponent.cpp -======= - // Compile data - QmlCompiler compiler; - if(!compiler.compile(d->engine, parser, d->cc)) { - qWarning().nospace() -#ifdef QML_VERBOSEERRORS_ENABLED - << "QmlComponent: " -#endif - << compiler.errorDescription().toLatin1().constData() << " @" - << d->name.toLatin1().constData() << ":" - << compiler.errorLine(); - } ->>>>>>> support both *.qml and *.whatever with autodetection. Some debug output, some fixes.:src/declarative/qml/qmlcomponent.cpp } emit statusChanged(status()); diff --git a/src/declarative/qml/qmlscriptparser.cpp b/src/declarative/qml/qmlscriptparser.cpp index 8167c24..ddd473a 100644 --- a/src/declarative/qml/qmlscriptparser.cpp +++ b/src/declarative/qml/qmlscriptparser.cpp @@ -389,7 +389,9 @@ bool ProcessAST::visit(AST::UiScriptBinding *node) primitive = getPrimitive(prop->name, stmt->expression); } else { + out << '{'; pp(node->statement); + out << '}'; } Value *v = new Value; @@ -425,7 +427,7 @@ bool ProcessAST::visit(AST::UiArrayBinding *node) QmlScriptParser::QmlScriptParser() - : root(0) + : root(0), _errorLine(-1) { } @@ -450,6 +452,7 @@ bool QmlScriptParser::parse(const QByteArray &data, const QUrl &url) if (! parser.parse(&driver)) { _error = parser.errorMessage(); + _errorLine = parser.errorLineNumber(); return false; } @@ -464,6 +467,11 @@ QString QmlScriptParser::errorDescription() const return _error; } +int QmlScriptParser::errorLine() const +{ + return _errorLine; +} + QMap QmlScriptParser::nameSpacePaths() const { qWarning() << Q_FUNC_INFO << "not implemented"; diff --git a/src/declarative/qml/qmlscriptparser_p.h b/src/declarative/qml/qmlscriptparser_p.h index d9a557f..b24662e 100644 --- a/src/declarative/qml/qmlscriptparser_p.h +++ b/src/declarative/qml/qmlscriptparser_p.h @@ -20,6 +20,7 @@ public: bool parse(const QByteArray &data, const QUrl &url = QUrl()); QString errorDescription() const; + int errorLine() const; QMap nameSpacePaths() const; QStringList types() const; @@ -35,6 +36,7 @@ private: QmlParser::Object *root; QStringList _typeNames; QString _error; + int _errorLine; }; QT_END_NAMESPACE -- cgit v0.12 From 2b3679e6199b7908480de9971da6d1eb64addac7 Mon Sep 17 00:00:00 2001 From: mae Date: Mon, 20 Apr 2009 18:07:40 +0200 Subject: fix shift/reduce and reduce/reduce conflicts, make parsing of function declarations within the object literals possible. This allows us to get entirely rid of the Script{} fake object. --- src/declarative/qml/parser/javascript.g | 15 +- src/declarative/qml/parser/javascriptgrammar.cpp | 1159 +++++++++++----------- src/declarative/qml/parser/javascriptgrammar_p.h | 12 +- src/declarative/qml/parser/javascriptparser.cpp | 391 ++++---- src/declarative/qml/parser/javascriptparser_p.h | 4 +- 5 files changed, 808 insertions(+), 773 deletions(-) diff --git a/src/declarative/qml/parser/javascript.g b/src/declarative/qml/parser/javascript.g index 411a8c6..3a4061b 100644 --- a/src/declarative/qml/parser/javascript.g +++ b/src/declarative/qml/parser/javascript.g @@ -530,14 +530,14 @@ case $rule_number: { } break; ./ -UiArrayMemberList: UiObjectMember ; +UiArrayMemberList: UiArrayObjectMember ; /. case $rule_number: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).UiObjectMember); } break; ./ -UiArrayMemberList: UiArrayMemberList T_COMMA UiObjectMember ; +UiArrayMemberList: UiArrayMemberList T_COMMA UiArrayObjectMember ; /. case $rule_number: { AST::UiObjectMemberList *node = makeAstNode (driver->nodePool(), @@ -566,6 +566,8 @@ case $rule_number: { } break; ./ +UiArrayObjectMember: UiQualifiedId T_COLON T_IDENTIFIER UiObjectInitializer ; +/. case $rule_number: ./ UiObjectMember: UiQualifiedId T_COLON T_IDENTIFIER UiObjectInitializer ; /. case $rule_number: { @@ -577,6 +579,8 @@ case $rule_number: { } break; ./ +UiArrayObjectMember: T_IDENTIFIER UiObjectInitializer ; +/. case $rule_number: ./ UiObjectMember: T_IDENTIFIER UiObjectInitializer ; /. case $rule_number: { @@ -587,6 +591,8 @@ case $rule_number: { } break; ./ +UiArrayObjectMember: UiQualifiedId T_COLON T_LBRACKET UiArrayMemberList T_RBRACKET ; +/. case $rule_number: ./ UiObjectMember: UiQualifiedId T_COLON T_LBRACKET UiArrayMemberList T_RBRACKET ; /. case $rule_number: { @@ -599,6 +605,8 @@ case $rule_number: { } break; ./ +UiArrayObjectMember: UiQualifiedId T_COLON Statement ; +/. case $rule_number: ./ UiObjectMember: UiQualifiedId T_COLON Statement ; /. case $rule_number: { @@ -646,6 +654,9 @@ case $rule_number: { } break; ./ +UiObjectMember: FunctionDeclaration ; +/. +./ UiQualifiedId: T_IDENTIFIER ; /. diff --git a/src/declarative/qml/parser/javascriptgrammar.cpp b/src/declarative/qml/parser/javascriptgrammar.cpp index 43d4c17..35af821 100644 --- a/src/declarative/qml/parser/javascriptgrammar.cpp +++ b/src/declarative/qml/parser/javascriptgrammar.cpp @@ -14,619 +14,642 @@ const char *const JavaScriptGrammar::spell [] = { const int JavaScriptGrammar::lhs [] = { 88, 89, 89, 92, 92, 93, 93, 91, 90, 90, - 95, 95, 96, 96, 94, 94, 94, 94, 94, 94, - 94, 97, 97, 100, 100, 100, 100, 100, 100, 100, - 100, 100, 100, 100, 100, 100, 100, 100, 102, 102, - 106, 106, 101, 101, 104, 104, 107, 107, 107, 107, - 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, - 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, - 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, - 108, 109, 109, 110, 110, 110, 110, 110, 113, 113, - 114, 114, 114, 114, 112, 112, 115, 115, 116, 116, - 117, 117, 117, 118, 118, 118, 118, 118, 118, 118, - 118, 118, 118, 119, 119, 119, 119, 120, 120, 120, - 121, 121, 121, 121, 122, 122, 122, 122, 122, 122, - 122, 123, 123, 123, 123, 123, 123, 124, 124, 124, - 124, 124, 125, 125, 125, 125, 125, 126, 126, 127, - 127, 128, 128, 129, 129, 130, 130, 131, 131, 132, - 132, 133, 133, 134, 134, 135, 135, 136, 136, 137, - 137, 105, 105, 138, 138, 139, 139, 139, 139, 139, - 139, 139, 139, 139, 139, 139, 139, 99, 99, 140, - 140, 141, 141, 142, 142, 98, 98, 98, 98, 98, - 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, - 143, 159, 159, 158, 158, 144, 144, 160, 160, 161, - 161, 163, 163, 162, 164, 167, 165, 165, 168, 166, - 166, 145, 146, 146, 147, 147, 148, 148, 148, 148, - 148, 148, 148, 149, 149, 149, 149, 150, 150, 150, - 150, 151, 151, 152, 154, 169, 169, 172, 172, 170, - 170, 173, 171, 153, 155, 155, 156, 156, 156, 174, - 175, 157, 157, 176, 111, 180, 180, 177, 177, 178, - 178, 181, 182, 182, 183, 183, 179, 179, 103, 103, - 184}; + 95, 95, 97, 97, 96, 94, 96, 94, 96, 94, + 96, 94, 94, 94, 94, 94, 98, 98, 102, 102, + 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, + 102, 102, 102, 104, 104, 108, 108, 103, 103, 106, + 106, 109, 109, 109, 109, 110, 110, 110, 110, 110, + 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, + 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, + 110, 110, 110, 110, 110, 110, 111, 111, 112, 112, + 112, 112, 112, 115, 115, 116, 116, 116, 116, 114, + 114, 117, 117, 118, 118, 119, 119, 119, 120, 120, + 120, 120, 120, 120, 120, 120, 120, 120, 121, 121, + 121, 121, 122, 122, 122, 123, 123, 123, 123, 124, + 124, 124, 124, 124, 124, 124, 125, 125, 125, 125, + 125, 125, 126, 126, 126, 126, 126, 127, 127, 127, + 127, 127, 128, 128, 129, 129, 130, 130, 131, 131, + 132, 132, 133, 133, 134, 134, 135, 135, 136, 136, + 137, 137, 138, 138, 139, 139, 107, 107, 140, 140, + 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, + 141, 141, 100, 100, 142, 142, 143, 143, 144, 144, + 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, + 99, 99, 99, 99, 99, 145, 161, 161, 160, 160, + 146, 146, 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, 113, + 181, 181, 178, 178, 179, 179, 182, 183, 183, 184, + 184, 180, 180, 105, 105, 185}; const int JavaScriptGrammar:: rhs[] = { 2, 1, 1, 1, 2, 3, 3, 0, 1, 2, - 1, 3, 2, 3, 4, 2, 5, 3, 6, 3, - 5, 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, 3, 2, 3, 4, 4, 2, 2, 5, 5, + 3, 3, 6, 3, 5, 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, 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, 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, + 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, 3, 1, 5, 1, 5, 1, 3, 1, 3, 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, 1, 1, 3, 0, 1, 1, 3, 0, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 3, 1, 2, 0, 1, + 3, 3, 1, 1, 1, 3, 1, 3, 2, 2, + 2, 0, 1, 2, 0, 1, 1, 2, 2, 7, + 5, 7, 7, 5, 9, 10, 7, 8, 2, 2, + 3, 3, 2, 2, 3, 3, 3, 3, 5, 5, + 3, 5, 1, 2, 0, 1, 4, 3, 3, 3, + 3, 3, 3, 4, 5, 2, 2, 2, 8, 8, + 1, 3, 0, 1, 0, 1, 1, 1, 2, 1, + 1, 0, 1, 0, 1, 2}; const int JavaScriptGrammar::action_default [] = { - 8, 2, 0, 0, 4, 3, 0, 291, 0, 6, - 7, 5, 22, 0, 9, 1, 0, 0, 16, 13, - 0, 14, 10, 0, 20, 0, 121, 188, 152, 160, - 156, 100, 172, 148, 21, 85, 101, 164, 168, 89, - 118, 99, 104, 84, 138, 125, 0, 31, 32, 28, - 287, 25, 289, 43, 0, 0, 0, 0, 0, 26, - 29, 0, 0, 30, 24, 0, 27, 0, 0, 114, - 0, 0, 101, 120, 103, 102, 0, 0, 0, 116, - 117, 115, 119, 0, 149, 0, 0, 0, 0, 139, - 0, 0, 0, 0, 0, 0, 129, 0, 0, 0, - 123, 124, 122, 127, 131, 130, 128, 126, 141, 140, - 142, 0, 157, 0, 153, 0, 0, 95, 94, 83, - 51, 52, 53, 78, 54, 79, 55, 56, 57, 58, - 59, 60, 61, 62, 82, 63, 64, 65, 66, 67, - 80, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 81, 0, 0, 93, 189, 96, 0, 97, 0, - 98, 92, 19, 0, 185, 178, 176, 183, 184, 182, - 181, 187, 180, 179, 177, 186, 173, 0, 161, 0, - 0, 165, 0, 0, 169, 0, 0, 95, 87, 0, - 86, 0, 91, 105, 0, 288, 278, 279, 0, 276, - 0, 277, 0, 280, 196, 203, 202, 210, 198, 0, - 199, 281, 0, 286, 200, 201, 206, 204, 283, 282, - 285, 207, 0, 218, 0, 0, 0, 0, 287, 25, - 0, 289, 190, 232, 0, 0, 0, 219, 0, 0, - 208, 209, 0, 197, 205, 233, 234, 275, 284, 248, - 0, 249, 250, 251, 244, 0, 245, 246, 247, 272, - 273, 0, 0, 0, 0, 0, 237, 238, 194, 192, - 154, 162, 158, 174, 150, 195, 0, 101, 166, 170, - 143, 132, 0, 0, 151, 0, 0, 0, 0, 144, - 0, 0, 0, 0, 0, 136, 134, 137, 135, 133, - 146, 145, 147, 0, 159, 0, 155, 0, 193, 101, - 0, 175, 190, 191, 0, 190, 0, 0, 240, 0, - 0, 0, 242, 0, 163, 0, 0, 167, 0, 0, - 171, 230, 0, 222, 231, 225, 0, 229, 0, 190, - 223, 0, 190, 0, 0, 241, 0, 0, 0, 243, - 288, 278, 0, 0, 280, 0, 274, 0, 264, 0, - 0, 0, 236, 0, 235, 0, 290, 0, 50, 212, - 215, 0, 51, 78, 54, 79, 56, 57, 28, 61, - 62, 25, 63, 66, 26, 29, 190, 30, 69, 24, - 71, 27, 73, 74, 75, 76, 77, 81, 0, 45, - 0, 0, 47, 49, 37, 48, 0, 46, 36, 213, - 211, 89, 90, 95, 0, 88, 0, 252, 253, 0, - 0, 0, 255, 260, 258, 261, 0, 0, 259, 260, - 0, 256, 0, 257, 214, 263, 0, 214, 262, 0, - 265, 266, 0, 214, 267, 268, 0, 0, 269, 0, - 0, 0, 270, 271, 107, 106, 0, 0, 0, 239, - 0, 0, 0, 254, 227, 220, 0, 228, 224, 0, - 226, 216, 0, 217, 221, 0, 44, 0, 41, 43, - 34, 0, 40, 35, 42, 39, 33, 0, 38, 111, - 109, 113, 110, 108, 112, 0, 0, 18, 25, 43, - 15, 0, 11, 0, 17, 12, 23}; + 8, 2, 0, 0, 4, 3, 0, 296, 0, 6, + 7, 5, 26, 0, 27, 0, 9, 1, 0, 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, 223, 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, 224, + 0, 0, 0, 213, 214, 119, 0, 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, 232, 225, 0, 233, + 229, 0, 231, 221, 0, 222, 226, 0, 18, 13, + 0, 14, 10, 0, 24, 0, 25, 23, 0, 0, + 22, 30, 48, 16, 27, 0, 11, 0, 17, 0, + 20, 12, 0, 21, 30, 48, 15, 0, 19, 28}; const int JavaScriptGrammar::goto_default [] = { - 2, 6, 15, 1, 5, 4, 14, 501, 18, 16, - 369, 209, 43, 477, 475, 367, 366, 27, 476, 365, - 368, 118, 39, 35, 157, 41, 31, 156, 36, 42, - 69, 40, 26, 45, 44, 280, 33, 274, 28, 270, - 30, 272, 29, 271, 37, 278, 38, 279, 32, 273, - 269, 310, 416, 275, 276, 204, 243, 208, 210, 214, - 215, 206, 205, 217, 244, 216, 221, 240, 241, 207, - 371, 370, 242, 466, 465, 332, 333, 468, 335, 467, - 334, 422, 426, 429, 425, 424, 444, 445, 213, 198, - 212, 194, 197, 211, 219, 218, 0}; + 2, 6, 17, 1, 5, 4, 16, 505, 506, 488, + 18, 372, 41, 12, 57, 458, 456, 134, 133, 29, + 457, 132, 135, 214, 53, 46, 222, 55, 35, 221, + 50, 56, 105, 54, 28, 60, 58, 293, 40, 287, + 30, 283, 32, 285, 31, 284, 51, 291, 52, 292, + 36, 286, 282, 323, 408, 288, 289, 33, 107, 39, + 42, 47, 48, 37, 34, 59, 108, 49, 64, 103, + 104, 38, 374, 373, 106, 478, 477, 345, 346, 480, + 348, 479, 347, 414, 418, 421, 417, 416, 436, 437, + 22, 44, 124, 21, 43, 62, 61, 0}; const int JavaScriptGrammar::action_index [] = { - -12, -88, 80, 40, -88, 15, 70, -88, 107, -88, - -88, -88, 63, 38, -88, 122, 142, 214, -88, -88, - 160, -88, -88, 64, 88, 581, 73, -88, 9, -39, - -59, 193, -88, 254, 120, -88, 381, 1, 86, 227, - 197, -88, -88, -88, 307, 161, 581, -88, -88, -88, - 11, -88, 1061, 31, 581, 581, 581, 419, 581, -88, - -88, 581, 581, -88, -88, 581, -88, 581, 581, -88, - 581, 581, 79, 208, -88, -88, 581, 581, 581, -88, - -88, -88, 168, 581, 239, 581, 581, 581, 581, 327, - 581, 581, 581, 581, 581, 581, 278, 581, 581, 581, - 71, 72, 74, 278, 157, 158, 136, 278, 297, 317, - 287, 581, 16, 581, 77, 977, 581, 581, -88, -88, + -21, -88, 75, 14, -88, -5, 208, -88, 88, -88, + -88, -88, -88, 55, 50, 56, -88, 163, 120, 69, + 70, 79, -7, -88, -6, -88, -12, 1320, 129, -88, + 61, -30, -57, -88, -88, 285, -88, -88, -88, -88, + 268, 233, -88, -88, 40, -88, -88, -88, -88, -88, + 349, 28, 124, 155, 148, -88, -88, -88, 332, -88, + 236, -88, 1320, -88, -88, 178, -88, 189, 125, 588, + -88, -88, 1236, -88, 62, 72, 90, 66, 1572, 84, + 588, 588, 588, 426, 588, -88, -88, 588, 588, 588, + -88, -88, 46, -88, 588, 588, -88, 48, 588, -88, + 588, 53, 54, -88, -88, -88, 67, -88, -88, 588, + 588, 78, 169, 59, -88, 1068, -88, -88, 588, 588, + 588, -88, -88, -88, 33, -88, -29, -58, -20, 1320, + -41, -88, 13, 17, -50, -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, - -88, -88, 89, 581, -88, -88, 56, 67, -88, 581, - -88, -88, -88, 581, -88, -88, -88, -88, -88, -88, - -88, -88, -88, -88, -88, -88, -88, 581, 23, 581, - 581, 60, 75, 581, -88, 977, 581, 581, -88, 108, - -88, 34, -88, -88, 53, -88, 54, 78, 55, -88, - 62, -88, 57, 1229, -88, -88, -88, -88, -88, 185, - -88, -88, 26, -88, -88, -88, -88, -88, -88, 1229, - -88, -88, 171, -88, 173, 68, 1313, 52, 41, 59, - 36, 1481, 581, -88, 33, 581, 32, -88, 39, 48, - -88, -88, 50, -88, -88, -88, -88, -88, -88, -88, - 115, -88, -88, -88, -88, 111, -88, -88, -88, -88, - -88, 61, 65, 581, 102, 76, -88, -88, 735, -88, - 84, 4, -63, -88, 256, 7, -47, 504, 10, 94, - 343, 165, -18, 581, 237, 581, 581, 581, 581, 343, - 581, 581, 581, 581, 581, 211, 278, 278, 192, 199, - 255, 272, 343, 581, -60, 581, 22, 581, -88, 344, - 581, -88, 581, 13, -55, 581, -41, 1313, -88, 581, - 144, 1313, -88, 581, -44, 581, 581, 3, -5, 581, - -88, 51, 133, -30, -88, -88, 581, -88, -11, 581, - -88, -4, 581, -1, 1313, -88, 581, 98, 1313, -88, - -10, 18, -14, 21, 1229, 8, -88, 1313, -88, 581, - 99, 1313, 42, 1313, -88, 49, 45, 6, -88, -88, - 1313, 0, 149, 19, 152, 105, 581, 1313, 37, -3, - 97, 28, -2, 419, 25, 24, 893, 20, -6, 29, - 581, 35, 12, 581, 14, 581, 5, 2, 581, -88, - 1145, 30, -88, -88, -88, -88, 581, -88, -88, -88, - -88, 182, -88, 581, -31, -88, 81, -88, -88, 581, - 110, 27, -88, 134, -88, 46, 92, 581, -88, 44, - 43, -88, -27, -88, 1313, -88, 215, 1313, -88, 190, - -88, -88, 140, 1313, -20, -88, -29, -13, -88, -7, - -36, -8, -88, -88, -88, -88, 581, 90, 1313, -88, - 581, 96, 1313, -88, -9, -88, 179, -88, -88, 581, - -88, -88, 47, -88, -88, 123, 69, 812, -88, 66, - -88, 658, -88, -88, -88, -88, -88, 95, -88, -88, - -88, -88, -88, -88, -88, 1397, 58, -88, 101, 183, - -88, 109, -88, 91, -88, -88, -88, + 588, -88, 1152, 132, -88, 588, -88, -88, 192, 588, + 252, 588, 588, 588, 588, 312, 588, 588, 588, 588, + 588, 588, 231, 588, 588, 588, 128, 89, 93, 175, + 197, 190, 183, 150, 292, 322, 302, 588, -2, 588, + 71, 984, 588, 588, -88, -88, -88, 109, 588, -88, + -88, 68, 52, -88, 588, -88, -88, -88, -88, -88, + 588, -88, -88, -88, -88, -88, -88, -88, -88, -88, + -88, -88, -88, -88, 588, 43, 588, 588, 64, 63, + 588, -88, 984, 588, 588, -88, 143, -88, 8, -88, + -88, -88, 96, -88, -88, -88, -88, 122, -88, -88, + -88, -88, -88, -88, 73, 74, 588, 99, 76, -88, + -88, 823, -88, 6, -36, -66, -88, 260, 51, -60, + 511, 1, 82, 350, 239, -13, 588, 266, 588, 588, + 588, 588, 350, 588, 588, 588, 588, 588, 235, 198, + 204, 227, 221, 350, 350, 267, 588, -61, 588, 23, + 588, -88, 367, 588, -88, 588, 20, -35, 588, -38, + 1236, -88, 588, 138, 1236, -88, 588, -44, 588, 588, + 7, -1, 588, -88, 18, 95, 32, -88, -88, 588, + -88, 2, 588, -88, -9, 588, -10, 1236, -88, 588, + 107, 1236, -88, 41, 1236, -88, 588, 103, 1236, 45, + 1236, -88, -88, 1236, 16, 135, 38, 172, 91, 588, + 1236, 47, 15, 77, 42, 3, 399, 31, 30, 669, + 27, -3, 25, 588, 34, 12, 588, 19, 588, 11, + 10, -88, -88, 180, -88, 588, -17, -88, 110, -88, + -88, 588, 212, -25, -88, 37, -88, 39, 106, 588, + -88, 35, 29, -88, 5, -88, 1236, -88, 101, 1236, + -88, 219, -88, -88, 108, 1236, 36, -88, 22, 24, + -88, 26, -33, -22, -88, -88, -88, -88, 588, 133, + 1236, -88, 588, 146, 1236, -88, 117, 21, 900, -88, + 9, -88, 746, -88, -88, -88, -88, -88, 116, -88, + -88, -88, -88, -88, -88, -88, 83, -88, 182, -88, + -88, 588, -88, -88, 49, -88, -88, 246, -88, -88, + 254, -88, -88, 44, 58, 588, 115, -88, 1488, 57, + -88, 112, 113, -88, 60, 126, -88, 111, -88, 65, + -88, -88, 1404, -88, 97, 114, -88, 147, -88, -88, - -97, -97, -97, -97, -97, 29, -97, -97, -97, -97, - -97, -97, -97, -97, -97, 11, -97, 27, -97, -97, - 40, -97, -97, -97, -97, 33, -97, -97, -97, -97, - -97, -97, -97, -97, 47, -97, -43, -97, -97, -97, - -97, -97, -97, -97, -97, -97, 64, -97, -97, -97, - -97, -97, -97, -97, 17, 114, 123, 121, 122, -97, - -97, 110, 106, -97, -97, 98, -97, 103, 126, -97, - 101, 214, -97, -97, -97, -97, 130, 138, 127, -97, - -97, -97, -97, 131, -97, 107, 137, 141, 87, -97, - 55, 70, 73, 72, 69, 94, -97, 58, 63, 61, - -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, - -97, 145, -97, 82, -97, -18, 39, 41, -97, -97, - -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, - -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, - -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, - -97, -97, -97, 49, -97, -97, -97, -97, -97, 42, - -97, -97, -97, 35, -97, -97, -97, -97, -97, -97, - -97, -97, -97, -97, -97, -97, -97, 97, -97, 34, - 4, -97, -97, 8, -97, 51, -1, 50, -97, -97, - -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, - -97, -97, -97, 21, -97, -97, -97, -97, -97, -97, - -97, -97, -97, -97, -97, -97, -97, -97, -97, 53, - -97, -97, -97, -97, -97, -97, 12, -97, -97, -97, - -97, -97, -2, -97, -97, 36, -16, -97, -97, -97, - -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, - -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, - -97, -97, -97, 76, -97, -97, -97, -97, 52, -97, - -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, - -97, -97, -97, 180, -97, 183, 168, 169, 172, -97, - 90, 91, 83, 80, 79, -97, -97, -97, -97, -97, - -97, -97, -97, 146, -97, 160, -97, 144, -97, -97, - 181, -97, 62, -97, -97, 65, -97, 13, -97, 15, - -97, -7, -97, 148, -97, 150, 156, -97, -97, 182, - -97, -97, -97, -97, -97, -97, 191, -97, -44, 57, - -97, -97, 93, -97, 38, -97, 46, -97, -3, -97, - -97, -40, -97, -97, 59, -97, -97, 10, -97, 3, - -97, -9, -97, -10, -97, -97, -97, -97, -97, -97, - 23, -97, -97, -97, -97, -97, 54, 31, -97, -97, - -97, -97, -97, 74, -97, -97, 24, -97, -97, -97, - 26, -97, 5, 133, -97, 134, -97, -97, 48, -97, - 32, -97, -97, -97, -97, -97, 37, -97, -97, -97, - -97, -97, -97, 113, -97, -97, -97, -97, -97, -5, - -97, -97, -97, -97, -97, -81, -97, 7, -97, -63, - -97, -97, -97, -97, -46, -97, -97, -54, -97, -97, - -97, -97, -97, -97, -42, -97, -97, -28, -97, -97, - -97, -50, -97, -97, -97, -97, 2, -97, 1, -97, - 45, -97, 43, -97, -97, -97, -97, -97, -97, 19, - -97, -97, -34, -97, -97, -97, -97, 25, -97, 30, - -97, 44, -97, -97, -97, -97, -97, -97, -97, -97, - -97, -97, -97, -97, -97, 28, -97, -97, 22, 6, - -97, -97, -97, 9, -97, -97, -97}; + -98, -98, -98, -98, -98, 30, -98, -98, -98, -98, + -98, -98, -98, -98, -98, -98, -98, 48, -98, -98, + -98, -98, -98, -98, -98, -98, -98, 67, -98, -98, + -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, + -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, + -46, -98, -98, -98, -98, -98, -98, -98, -98, -98, + -98, -98, 201, -98, -98, -98, -98, -98, -98, 117, + -98, -98, 6, -98, -98, -98, -98, -98, -98, -98, + 37, 118, 114, 150, 146, -98, -98, 141, 138, 53, + -98, -98, -98, -98, 43, 78, -98, -7, 91, -98, + 88, -98, -98, -98, -98, -98, -98, -98, -98, 94, + 95, -98, -98, -98, -98, -98, -98, -98, 103, 99, + 100, -98, -98, -98, -98, -98, -51, -98, -98, 180, + -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, + -5, -98, -8, -98, -98, -9, -98, -98, -98, 96, + -98, 136, 124, 129, 133, -98, 132, 122, 38, 39, + 58, 56, -98, 62, 36, 55, -98, -98, -98, -98, + -98, -98, -98, -98, -98, -98, -98, 57, -98, 64, + -98, 12, 29, 25, -98, -98, -98, -98, 23, -98, + -98, -98, -98, -98, 8, -98, -98, -98, -98, -98, + 44, -98, -98, -98, -98, -98, -98, -98, -98, -98, + -98, -98, -98, -98, 68, -98, 65, 60, -98, -98, + -17, -98, 54, 41, 119, -98, -98, -98, -98, -98, + -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, + -98, -98, -98, -98, -98, -98, -1, -98, -98, -98, + -98, 70, -98, -98, -98, -98, -98, -98, -98, -98, + -98, -98, -98, -98, -98, -98, 196, -98, 185, 174, + 168, 186, -98, 79, 72, 71, 106, 107, -98, -98, + -98, -98, -98, -98, -98, -98, 167, -98, 153, -98, + 155, -98, -98, 165, -98, 128, -98, -98, 63, -98, + 26, -98, 24, -98, 27, -98, 154, -98, 145, 166, + -98, -98, 178, -98, -98, -98, -98, -98, -98, 189, + -98, -52, 85, -98, -98, 110, -98, 17, -98, 19, + -98, 22, -98, -98, 21, -98, 18, -98, 13, -98, + 47, -98, -98, 51, -98, -98, -98, -98, -98, 83, + 45, -98, -98, -98, -98, -98, 92, -98, -98, 34, + -98, -98, -98, 40, -98, -34, 121, -98, 149, -98, + -98, -98, -98, -98, -98, 230, -98, -98, -98, -98, + -98, -6, -98, -98, -98, -98, -98, -84, -98, 7, + -98, -63, -98, -98, -98, -98, -54, -98, -98, -64, + -98, -98, -98, -98, -98, -98, -77, -98, -98, -37, + -98, -98, -98, -42, -98, -98, -98, -98, 10, -98, + 5, -98, -3, -98, -10, -98, -98, -98, -14, -98, + -11, -98, -19, -98, -98, -98, -98, -98, -98, -98, + -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, + -98, 28, -98, -98, -16, -98, -98, 49, -98, -98, + 42, -98, -98, -98, -98, 52, 50, -98, 46, -98, + -98, 20, 35, -98, 16, -98, -98, -98, -98, 73, + -98, -98, 32, -98, 31, 151, -98, -98, -98, -98}; const int JavaScriptGrammar::action_info [] = { - 447, 346, 329, 177, 303, 323, 315, 449, 469, 111, - 83, 331, 323, 305, 312, 307, 305, 113, 331, 317, - 443, 153, 450, 283, 451, 443, 351, -48, 433, 415, - 419, -49, -67, 268, 359, -47, -70, 406, 460, 478, - 195, 456, -72, -219, -59, 443, 353, 199, -218, 427, - 434, 427, 303, 400, 354, 410, 398, 342, 363, 344, - 423, 408, 177, 356, 159, 443, 357, 23, 336, 419, - 350, 111, 359, 3, 478, 456, 464, 484, 83, 464, - 7, 247, 183, 199, 460, 283, 200, 506, 268, 196, - 203, 201, 113, 24, 192, 25, 17, 153, 153, 12, - 3, 263, 430, 153, 153, 8, 153, 153, 357, 0, - 153, 70, 70, 70, 70, 202, 153, 503, 153, 0, - 12, 74, 71, 71, 71, 71, 195, 161, 153, 260, - 259, 479, 75, -287, 17, 262, 179, 267, 266, 427, - 180, 338, 418, 417, 325, 154, 446, 431, 326, 495, - 458, 12, 153, 17, 13, 488, 462, 496, 348, 361, - 447, 97, 265, 98, 190, 504, 260, 259, 10, 9, - 421, 0, 258, 257, 99, 13, 253, 252, 250, 480, - 76, 255, 97, 97, 98, 98, 97, 472, 98, 12, - 97, 478, 98, 153, 339, 99, 99, 185, 153, 99, - 250, 0, 255, 99, 321, 0, 13, 0, 115, 76, - 251, 249, 12, 256, 254, 21, 186, 97, 413, 98, - 76, 0, 437, 153, 97, 77, 98, 116, 0, 117, - 99, 78, 251, 249, 256, 254, 97, 99, 98, 0, - 473, 471, 185, 12, 13, 0, 246, 245, 0, 99, - 0, 441, 440, 0, 77, 285, 286, 85, 86, 0, - 78, 186, 0, 187, 0, 77, 0, 13, 0, 19, - 0, 78, 85, 86, 285, 286, 0, 0, 290, 291, - 0, 0, 287, 288, 87, 88, 0, 292, 0, 0, - 293, 0, 294, 0, 0, 290, 291, 0, 13, 87, - 88, 287, 288, 97, 292, 98, 0, 293, 0, 294, - 90, 91, 0, 0, 0, 0, 99, 0, 92, 93, - 90, 91, 94, 0, 95, 0, 0, 0, 92, 93, - 90, 91, 94, 0, 95, 0, 0, 0, 92, 93, - 90, 91, 94, 0, 95, 0, 0, 164, 92, 93, - 90, 91, 94, 0, 95, 0, 0, 165, 92, 93, - 0, 166, 94, 0, 95, 0, 290, 291, 0, 0, - 167, 0, 168, 0, 0, 292, 0, 0, 293, 0, - 294, 0, 0, 169, 164, 170, 74, 0, 0, 0, - 0, 0, 0, 171, 165, 0, 172, 75, 166, 0, - 0, 0, 173, 0, 0, 0, 0, 167, 174, 168, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 169, 175, 170, 74, 0, 0, 0, 0, 0, 0, - 171, 47, 48, 172, 75, 0, 0, 0, 0, 173, - 0, 50, 0, 0, 0, 174, 0, 0, 51, 0, - 0, 0, 52, 53, 0, 54, 0, 0, 175, 0, - 0, 0, 57, 0, 0, 0, 60, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 63, 0, 64, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 59, 66, 49, - 0, 0, 0, 0, 0, 0, 0, 164, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 165, 0, 0, - 0, 166, 0, 0, 0, 0, 0, 0, 0, 0, - 167, 0, 168, 0, 0, 319, 0, 0, 0, 0, - 0, 0, 0, 169, 0, 170, 74, 0, 0, 0, - 0, 0, 0, 171, 0, 0, 172, 75, 0, 0, - 0, 0, 173, 0, 0, 0, 0, 0, 174, 0, + 23, 325, 128, 336, 316, 177, 342, 296, 415, 336, + 318, 435, 316, 129, 131, 318, 344, 459, 207, 209, + 170, 27, 330, 25, 296, 172, 328, 443, 218, 465, + 244, 344, -75, 411, -53, 349, 426, -54, -72, 366, + 419, -77, 419, 407, 419, 435, 452, 448, -224, -52, + 357, 281, 355, 26, -64, 442, 439, 435, 441, 320, + 425, 370, 179, 359, 3, 495, 244, -223, 259, 126, + 250, 402, 179, 494, 209, 7, 224, 20, 476, 8, + 3, 435, 411, 487, 19, 493, 519, 24, 125, 448, + 452, 207, 459, 487, 504, 229, 476, 364, 281, 23, + 481, 363, 366, 351, 364, 20, 125, 218, 429, 218, + 276, 218, 226, -292, 438, 218, 422, 218, 512, 364, + 116, 459, 459, 218, 218, 460, 499, 498, 439, 109, + 487, 117, 338, 109, 509, 499, 339, 280, 279, 175, + 110, 218, 504, 504, 110, 487, 218, 275, 487, 10, + 9, 218, 272, 271, 218, 509, 352, 265, 264, 278, + 118, 423, 0, 368, 262, 219, 0, 361, 109, 109, + 252, 410, 409, 461, 246, 193, 469, 194, 247, 110, + 110, 118, 510, 270, 269, 13, 272, 271, 195, 253, + 484, 254, 14, 450, 0, 252, 263, 261, 334, 257, + 193, 267, 194, 518, 118, 119, 454, 262, 193, 0, + 194, 120, 0, 195, 253, 193, 405, 194, 267, 0, + 218, 195, 193, 193, 194, 194, 119, 218, 195, 193, + 13, 194, 120, 268, 266, 195, 195, 14, 0, 263, + 261, 218, 195, 485, 483, 0, 193, 15, 194, 119, + 268, 266, 193, 0, 194, 120, 193, 0, 194, 195, + 193, 193, 194, 194, 193, 195, 194, 0, 13, 195, + 181, 182, 413, 195, 195, 14, 13, 195, 298, 299, + 433, 432, 0, 14, 298, 299, 181, 182, 0, 0, + 303, 304, 15, 0, 228, 227, 0, 183, 184, 305, + 211, 489, 306, 0, 307, 300, 301, 0, 0, 491, + 0, 300, 301, 183, 184, 186, 187, 0, 0, 212, + 0, 213, 0, 188, 189, 186, 187, 190, 0, 191, + 15, 0, 0, 188, 189, 186, 187, 190, 15, 191, + 0, 0, 0, 188, 189, 186, 187, 190, 0, 191, + 0, 0, 231, 188, 189, 186, 187, 190, 0, 191, + 0, 0, 232, 188, 189, 0, 233, 190, 0, 191, + 231, 0, 0, 303, 304, 234, 0, 235, 0, 0, + 232, 0, 305, 0, 233, 306, 0, 307, 236, 0, + 237, 116, 0, 234, 0, 235, 0, 0, 238, 0, + 0, 239, 117, 0, 0, 0, 236, 240, 237, 116, + 0, 70, 71, 241, 0, 0, 238, 0, 0, 239, + 117, 113, 0, 0, 0, 240, 242, 0, 114, 0, + 0, 241, 115, 79, 0, 80, 0, 0, 70, 71, + 0, 0, 83, 0, 242, 0, 86, 0, 113, 0, + 0, 0, 0, 0, 0, 114, 0, 0, 0, 115, + 79, 0, 80, 0, 91, 0, 93, 0, 0, 83, + 0, 0, 0, 86, 0, 0, 0, 85, 96, 73, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 175, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 46, 47, 48, 0, 0, 0, 0, 0, - 0, 0, 0, 50, 0, 0, 0, 0, 0, 0, - 51, 0, 0, 0, 52, 53, 0, 54, 0, 0, - 0, 55, 0, 56, 57, 58, 0, 0, 60, 0, - 0, 0, 61, 0, 62, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 63, 0, 64, 0, - 65, 0, 67, 0, 68, 0, 0, 0, 0, 59, - 66, 49, 0, 0, 0, 0, 0, 0, 0, 46, - 47, 48, 0, 0, 0, 0, 0, 0, 0, 0, - 50, 0, 0, 0, 0, 0, 0, 51, 0, 0, - 0, 52, 53, 0, 54, 0, 0, 0, 55, 0, - 56, 57, 58, 0, 0, 60, 0, 0, 0, 61, - 0, 62, 0, 0, 483, 0, 0, 0, 0, 0, - 0, 0, 0, 63, 0, 64, 0, 65, 0, 67, - 0, 68, 0, 0, 0, 0, 59, 66, 49, 0, - 0, 0, 0, 0, 0, 0, 46, 47, 48, 0, - 0, 0, 0, 0, 0, 0, 0, 50, 0, 0, - 0, 0, 0, 0, 51, 0, 0, 0, 52, 53, - 0, 54, 0, 0, 0, 55, 0, 56, 57, 58, - 0, 0, 60, 0, 0, 0, 61, 0, 62, 0, + 0, 91, 0, 93, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 85, 96, 73, 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, 69, + 70, 71, 0, 0, 0, 0, 0, 0, 0, 0, + 113, 0, 0, 0, 0, 0, 0, 114, 0, 0, + 0, 115, 79, 0, 80, 0, 0, 0, 81, 0, + 82, 83, 84, 0, 0, 86, 0, 0, 0, 87, + 0, 88, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 91, 0, 93, 0, 95, 0, 98, + 0, 100, 0, 0, 0, 0, 85, 96, 73, 0, + 0, 0, 0, 0, 0, 0, -73, 0, 0, 0, + 69, 70, 71, 0, 0, 0, 0, 0, 0, 0, + 0, 113, 0, 0, 0, 0, 0, 0, 114, 0, + 0, 0, 115, 79, 0, 80, 0, 0, 0, 81, + 0, 82, 83, 84, 0, 0, 86, 0, 0, 0, + 87, 0, 88, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 91, 0, 93, 0, 95, 0, + 98, 0, 100, 0, 0, 0, 0, 85, 96, 73, + 0, 0, 0, 0, 0, 0, 0, 69, 70, 71, + 0, 0, 0, 0, 0, 0, 0, 0, 113, 0, + 0, 0, 0, 0, 0, 114, 0, 0, 0, 115, + 79, 0, 80, 0, 0, 0, 81, 0, 82, 83, + 84, 0, 0, 86, 0, 0, 0, 87, 0, 88, + 0, 0, 464, 0, 0, 0, 0, 0, 0, 0, + 0, 91, 0, 93, 0, 95, 0, 98, 0, 100, + 0, 0, 0, 0, 85, 96, 73, 0, 0, 0, + 0, 0, 0, 0, 69, 70, 71, 0, 0, 0, + 0, 0, 0, 0, 0, 113, 0, 0, 0, 0, + 0, 0, 114, 0, 0, 0, 115, 79, 0, 80, + 0, 0, 0, 81, 0, 82, 83, 84, 0, 0, + 86, 0, 0, 0, 87, 0, 88, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 91, 0, + 93, 0, 95, 0, 98, 295, 100, 0, 0, 0, + 0, 85, 96, 73, 0, 0, 0, 0, 0, 0, + 0, 69, 70, 71, 0, 0, 0, 0, 0, 0, + 0, 0, 113, 0, 0, 0, 0, 0, 0, 114, + 0, 0, 0, 115, 79, 0, 80, 0, 0, 0, + 81, 0, 82, 83, 84, 0, 0, 86, 0, 0, + 0, 87, 0, 88, 0, 0, 467, 0, 0, 0, + 0, 0, 0, 0, 0, 91, 0, 93, 0, 95, + 0, 98, 0, 100, 0, 0, 0, 0, 85, 96, + 73, 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, - 63, 0, 64, 0, 65, 0, 67, 282, 68, 0, - 0, 0, 0, 59, 66, 49, 0, 0, 0, 0, - 0, 0, 0, 46, 47, 48, 0, 0, 0, 0, - 0, 0, 0, 0, 50, 0, 0, 0, 0, 0, - 0, 51, 0, 0, 0, 52, 53, 0, 54, 0, - 0, 0, 55, 0, 56, 57, 58, 0, 0, 60, - 0, 0, 0, 61, 0, 62, 0, 0, 486, 0, - 0, 0, 0, 0, 0, 0, 0, 63, 0, 64, - 0, 65, 0, 67, 0, 68, 0, 0, 0, 0, - 59, 66, 49, 0, 0, 0, 0, 0, 0, 0, - -68, 0, 0, 0, 46, 47, 48, 0, 0, 0, - 0, 0, 0, 0, 0, 50, 0, 0, 0, 0, - 0, 0, 51, 0, 0, 0, 52, 53, 0, 54, - 0, 0, 0, 55, 0, 56, 57, 58, 0, 0, - 60, 0, 0, 0, 61, 0, 62, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, - 64, 0, 65, 0, 67, 0, 68, 0, 0, 0, - 0, 59, 66, 49, 0, 0, 0, 0, 0, 0, - 0, 120, 121, 122, 0, 0, 124, 126, 127, 0, - 0, 128, 0, 129, 0, 0, 0, 131, 132, 133, - 0, 0, 0, 0, 0, 0, 134, 135, 136, 137, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 138, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 141, 0, 0, 0, - 0, 0, 0, 142, 143, 144, 0, 146, 147, 148, - 149, 150, 151, 0, 0, 139, 145, 130, 123, 125, - 140, 0, 0, 0, 0, 120, 121, 122, 0, 0, - 124, 126, 127, 0, 0, 128, 0, 129, 0, 0, - 0, 131, 132, 133, 0, 0, 0, 0, 0, 0, - 402, 135, 136, 137, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 138, 0, 0, 0, 403, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 141, 0, 0, 0, 0, 0, 405, 142, 143, 144, - 0, 146, 147, 148, 149, 150, 151, 0, 0, 139, - 145, 130, 123, 125, 140, 0, 0, 0, 0, 120, - 121, 122, 0, 0, 124, 126, 127, 0, 0, 128, - 0, 129, 0, 0, 0, 131, 132, 133, 0, 0, - 0, 0, 0, 0, 402, 135, 136, 137, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 138, 0, - 0, 0, 403, 0, 0, 0, 0, 0, 0, 0, - 404, 0, 0, 0, 141, 0, 0, 0, 0, 0, - 405, 142, 143, 144, 0, 146, 147, 148, 149, 150, - 151, 0, 0, 139, 145, 130, 123, 125, 140, 0, - 0, 0, 0, 222, 0, 0, 0, 0, 224, 0, - 46, 47, 48, 226, 0, 0, 0, 0, 0, 0, - 227, 228, 0, 0, 0, 0, 0, 0, 229, 230, - 0, 0, 231, 53, 0, 54, 0, 0, 0, 55, - 0, 56, 57, 58, 0, 0, 60, 0, 0, 0, - 61, 0, 62, 0, 0, 0, 0, 0, 232, 0, - 233, 0, 0, 0, 63, 234, 64, 235, 65, 236, - 67, 237, 68, 238, 239, 0, 0, 59, 66, 49, - 223, 225, 0, 0, 0, 0, 0, 222, 0, 0, - 0, 0, 224, 0, 46, 47, 48, 226, 0, 0, - 0, 0, 0, 0, 227, 50, 0, 0, 0, 0, - 0, 0, 229, 230, 0, 0, 231, 53, 0, 54, - 0, 0, 0, 55, 0, 56, 57, 58, 0, 0, - 60, 0, 0, 0, 61, 0, 62, 0, 0, 0, - 0, 0, 232, 0, 233, 0, 0, 0, 63, 234, - 64, 235, 65, 236, 67, 237, 68, 238, 239, 0, - 0, 59, 66, 49, 223, 225, 0, 0, 0, 0, - 0, 222, 0, 0, 0, 0, 224, 0, 46, 47, - 48, 226, 0, 0, 0, 0, 0, 0, 227, 50, - 0, 0, 0, 0, 0, 0, 498, 230, 0, 0, - 231, 499, 0, 54, 0, 0, 0, 55, 0, 56, - 57, 58, 0, 0, 60, 0, 0, 0, 61, 0, - 62, 0, 0, 0, 0, 0, 232, 0, 233, 0, - 0, 0, 63, 234, 64, 235, 65, 236, 67, 237, - 68, 238, 239, 0, 0, 59, 66, 49, 223, 225, - 0, 0, 0, 0, 0, 372, 121, 122, 0, 0, - 374, 126, 376, 47, 48, 377, 0, 129, 0, 0, - 0, 131, 379, 380, 0, 0, 0, 0, 0, 0, - 381, 382, 136, 137, 231, 53, 0, 54, 0, 0, - 0, 55, 0, 56, 383, 58, 0, 0, 385, 0, - 0, 0, 61, 0, 62, 0, -214, 0, 0, 0, - 386, 0, 233, 0, 0, 0, 387, 388, 389, 390, - 65, 392, 393, 394, 395, 396, 397, 0, 0, 384, - 391, 378, 373, 375, 140, 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, + 65, 0, 0, 0, 0, 67, 0, 69, 70, 71, + 72, 0, 0, 0, 0, 0, 0, 74, 113, 0, + 0, 0, 0, 0, 0, 76, 77, 0, 0, 78, + 79, 0, 80, 0, 0, 0, 81, 0, 82, 83, + 84, 0, 0, 86, 0, 0, 0, 87, 0, 88, + 0, 0, 0, 0, 0, 89, 0, 90, 0, 0, + 0, 91, 92, 93, 94, 95, 97, 98, 99, 100, + 101, 102, 0, 0, 85, 96, 73, 66, 68, 0, + 0, 0, 0, 0, 65, 0, 0, 0, 0, 67, + 0, 69, 70, 71, 72, 0, 0, 0, 0, 0, + 0, 74, 75, 0, 0, 0, 0, 0, 0, 76, + 77, 0, 0, 78, 79, 0, 80, 0, 0, 0, + 81, 0, 82, 83, 84, 0, 0, 86, 0, 0, + 0, 87, 0, 88, 0, 0, 0, 0, 0, 89, + 0, 90, 0, 0, 0, 91, 92, 93, 94, 95, + 97, 98, 99, 100, 101, 102, 0, 0, 85, 96, + 73, 66, 68, 0, 0, 0, 0, 0, 65, 0, + 0, 0, 0, 67, 0, 69, 70, 71, 72, 0, + 0, 0, 0, 0, 0, 74, 113, 0, 0, 0, + 0, 0, 0, 514, 77, 0, 0, 78, 515, 0, + 80, 0, 0, 0, 81, 0, 82, 83, 84, 0, + 0, 86, 0, 0, 0, 87, 0, 88, 0, 0, + 0, 0, 0, 89, 0, 90, 0, 0, 0, 91, + 92, 93, 94, 95, 97, 98, 99, 100, 101, 102, + 0, 0, 85, 96, 73, 66, 68, 0, 0, 0, + 0, 0, 65, 0, 0, 0, 0, 67, 0, 69, + 70, 71, 72, 0, 0, 0, 0, 0, 0, 74, + 113, 0, 0, 0, 0, 0, 0, 501, 77, 0, + 0, 78, 502, 0, 80, 0, 0, 0, 81, 0, + 82, 83, 84, 0, 0, 86, 0, 0, 0, 87, + 0, 88, 0, 0, 0, 0, 0, 89, 0, 90, + 0, 0, 0, 91, 92, 93, 94, 95, 97, 98, + 99, 100, 101, 102, 0, 0, 85, 96, 73, 66, + 68, 0, 0, 0, 0, 0, 375, 137, 138, 0, + 0, 377, 142, 379, 70, 71, 380, 0, 145, 0, + 0, 0, 147, 382, 383, 0, 0, 0, 0, 0, + 0, 384, 385, 152, 153, 78, 79, 0, 80, 0, + 0, 0, 81, 0, 82, 386, 84, 0, 0, 388, + 0, 0, 0, 87, 0, 88, 0, -219, 0, 0, + 0, 389, 0, 90, 0, 0, 0, 390, 391, 392, + 393, 95, 395, 396, 397, 398, 399, 400, 0, 0, + 387, 394, 381, 376, 378, 157, 0, 0, 0, 0, - 364, 362, 119, 322, 428, 452, 420, 349, 163, 313, - 189, 459, 502, 457, 360, 505, 438, 22, 436, 432, - 358, 182, 261, 318, 435, 184, 320, 453, 487, 20, - 500, 220, 340, 409, 11, 313, 470, 439, 497, 442, - 474, 261, 485, 481, 34, 448, 22, 439, 345, 352, - 152, 401, 176, 463, 407, 162, 461, 347, 158, 160, - 442, 482, 72, 220, 0, 399, 155, 158, 313, 220, - 0, 119, 188, 313, 191, 0, 313, 0, 181, 0, - 277, 0, 72, 72, 193, 281, 72, 264, 96, 72, - 100, 72, 72, 102, 193, 101, 411, 72, 72, 412, - 72, 72, 106, 103, 313, 105, 104, 72, 72, 341, - 72, 72, 299, 298, 314, 72, 297, 316, 72, 72, - 114, 110, 72, 295, 296, 72, 72, 107, 494, 72, - 158, 72, 73, 454, 72, 72, 493, 414, 72, 178, - 492, 89, 72, 411, 489, 343, 412, 0, 248, 355, - 72, 72, 491, 490, 72, 72, 455, 81, 72, 72, - 79, 72, 72, 454, 455, 72, 72, 84, 80, 72, - 0, 108, 309, 72, 72, 109, 72, 281, 72, 281, - 0, 281, 0, 281, 309, 112, 0, 304, 72, 281, - 0, 324, 0, 281, 308, 327, 72, 72, 0, 306, - 72, 281, 281, 300, 301, 281, 328, 302, 72, 309, - 309, 72, 0, 281, 281, 281, 281, 284, 289, 309, - 0, 0, 0, 0, 281, 0, 0, 0, 0, 0, - 0, 311, 330, 0, 0, 0, 0, 0, 0, 0, - 0, 337, 72, 0, 0, 82, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 463, 455, 251, 420, 462, 466, 412, 230, 430, 453, + 176, 277, 440, 173, 171, 444, 451, 274, 427, 428, + 445, 424, 449, 434, 369, 508, 353, 225, 358, 503, + 367, 360, 365, 362, 215, 11, 333, 331, 335, 127, + 516, 217, 220, 513, 223, 507, 326, 482, 492, 468, + 434, 490, 431, 256, 492, 431, 274, 500, 371, 497, + 486, 0, 401, 243, 496, 326, 111, 0, 111, 111, + 197, 0, 0, 200, 201, 326, 215, 255, 63, 249, + 45, 511, 0, 507, 0, 111, 111, 111, 111, 198, + 0, 203, 111, 202, 111, 111, 196, 326, 111, 208, + 290, 111, 111, 0, 210, 294, 310, 309, 111, 111, + 475, 248, 245, 111, 308, 273, 403, 329, 111, 404, + 447, 111, 326, 446, 111, 111, 111, 112, 178, 111, + 111, 122, 123, 111, 180, 121, 111, 111, 223, 354, + 326, 311, 312, 0, 111, 258, 471, 111, 111, 273, + 470, 111, 111, 446, 111, 0, 0, 199, 517, 111, + 204, 507, 111, 111, 356, 205, 111, 192, 111, 206, + 474, 111, 185, 473, 403, 111, 111, 404, 472, 111, + 294, 447, 327, 111, 111, 322, 0, 0, 294, 294, + 294, 63, 340, 45, 319, 322, 322, 111, 111, 337, + 294, 294, 294, 294, 111, 314, 0, 321, 322, 294, + 317, 313, 63, 294, 45, 111, 111, 324, 341, 322, + 294, 294, 302, 315, 294, 0, 111, 0, 0, 0, + 343, 294, 0, 0, 0, 297, 0, 0, 0, 0, + 0, 350, 0, 0, 0, 0, 0, 0, 0, 223, + 0, 0, 0, 0, 0, 0, 406, 0, 0, 0, 0, 0, 0, 0, 0, 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, 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}; const int JavaScriptGrammar::action_check [] = { - 20, 31, 7, 2, 48, 2, 61, 36, 17, 48, - 1, 29, 2, 76, 61, 8, 76, 76, 29, 60, - 33, 8, 29, 1, 60, 33, 36, 7, 55, 60, - 36, 7, 7, 36, 36, 7, 7, 7, 36, 8, - 29, 36, 7, 29, 7, 33, 60, 29, 29, 5, - 7, 5, 48, 8, 33, 55, 7, 61, 16, 60, - 33, 55, 2, 55, 8, 33, 7, 29, 17, 36, - 29, 48, 36, 85, 8, 36, 29, 8, 1, 29, - 0, 55, 7, 29, 36, 1, 8, 29, 36, 36, - 33, 29, 76, 29, 60, 7, 33, 8, 8, 29, - 85, 36, 10, 8, 8, 65, 8, 8, 7, -1, - 8, 40, 40, 40, 40, 60, 8, 8, 8, -1, - 29, 42, 51, 51, 51, 51, 29, 60, 8, 61, - 62, 8, 53, 36, 33, 74, 50, 61, 62, 5, - 54, 8, 61, 62, 50, 56, 6, 55, 54, 7, - 60, 29, 8, 33, 84, 60, 60, 15, 60, 60, - 20, 25, 60, 27, 56, 56, 61, 62, 61, 62, - 60, -1, 61, 62, 38, 84, 61, 62, 29, 56, - 12, 29, 25, 25, 27, 27, 25, 8, 27, 29, - 25, 8, 27, 8, 61, 38, 38, 15, 8, 38, - 29, -1, 29, 38, 60, -1, 84, -1, 15, 12, - 61, 62, 29, 61, 62, 55, 34, 25, 36, 27, - 12, -1, 7, 8, 25, 57, 27, 34, -1, 36, - 38, 63, 61, 62, 61, 62, 25, 38, 27, -1, - 61, 62, 15, 29, 84, -1, 61, 62, -1, 38, - -1, 61, 62, -1, 57, 18, 19, 18, 19, -1, - 63, 34, -1, 36, -1, 57, -1, 84, -1, 55, - -1, 63, 18, 19, 18, 19, -1, -1, 23, 24, - -1, -1, 45, 46, 45, 46, -1, 32, -1, -1, - 35, -1, 37, -1, -1, 23, 24, -1, 84, 45, - 46, 45, 46, 25, 32, 27, -1, 35, -1, 37, - 23, 24, -1, -1, -1, -1, 38, -1, 31, 32, - 23, 24, 35, -1, 37, -1, -1, -1, 31, 32, - 23, 24, 35, -1, 37, -1, -1, -1, 31, 32, - 23, 24, 35, -1, 37, -1, -1, 3, 31, 32, - 23, 24, 35, -1, 37, -1, -1, 13, 31, 32, - -1, 17, 35, -1, 37, -1, 23, 24, -1, -1, - 26, -1, 28, -1, -1, 32, -1, -1, 35, -1, - 37, -1, -1, 39, 3, 41, 42, -1, -1, -1, - -1, -1, -1, 49, 13, -1, 52, 53, 17, -1, - -1, -1, 58, -1, -1, -1, -1, 26, 64, 28, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 39, 77, 41, 42, -1, -1, -1, -1, -1, -1, - 49, 12, 13, 52, 53, -1, -1, -1, -1, 58, - -1, 22, -1, -1, -1, 64, -1, -1, 29, -1, - -1, -1, 33, 34, -1, 36, -1, -1, 77, -1, - -1, -1, 43, -1, -1, -1, 47, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 65, -1, 67, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 78, 79, 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, + 29, 61, 60, 2, 48, 55, 7, 1, 33, 2, + 76, 33, 48, 33, 55, 76, 29, 8, 48, 76, + 7, 33, 60, 29, 1, 8, 61, 60, 8, 8, + 2, 29, 7, 36, 7, 17, 7, 7, 7, 36, + 5, 7, 5, 60, 5, 33, 36, 36, 29, 7, + 60, 36, 61, 60, 7, 29, 20, 33, 36, 8, + 55, 16, 1, 31, 85, 7, 2, 29, 60, 36, + 7, 55, 1, 29, 76, 0, 8, 36, 29, 65, + 85, 33, 36, 33, 29, 29, 29, 8, 29, 36, + 36, 48, 8, 33, 29, 55, 29, 7, 36, 29, + 17, 29, 36, 8, 7, 36, 29, 8, 7, 8, + 36, 8, 60, 36, 6, 8, 10, 8, 7, 7, + 42, 8, 8, 8, 8, 8, 15, 7, 20, 40, + 33, 53, 50, 40, 8, 15, 54, 61, 62, 7, + 51, 8, 29, 29, 51, 33, 8, 74, 33, 61, + 62, 8, 61, 62, 8, 8, 61, 61, 62, 60, + 12, 55, -1, 60, 29, 56, -1, 60, 40, 40, + 15, 61, 62, 56, 50, 25, 60, 27, 54, 51, + 51, 12, 56, 61, 62, 22, 61, 62, 38, 34, + 8, 36, 29, 60, -1, 15, 61, 62, 60, 56, + 25, 29, 27, 56, 12, 57, 60, 29, 25, -1, + 27, 63, -1, 38, 34, 25, 36, 27, 29, -1, + 8, 38, 25, 25, 27, 27, 57, 8, 38, 25, + 22, 27, 63, 61, 62, 38, 38, 29, -1, 61, + 62, 8, 38, 61, 62, -1, 25, 84, 27, 57, + 61, 62, 25, -1, 27, 63, 25, -1, 27, 38, + 25, 25, 27, 27, 25, 38, 27, -1, 22, 38, + 18, 19, 60, 38, 38, 29, 22, 38, 18, 19, + 61, 62, -1, 29, 18, 19, 18, 19, -1, -1, + 23, 24, 84, -1, 61, 62, -1, 45, 46, 32, + 15, 55, 35, -1, 37, 45, 46, -1, -1, 55, + -1, 45, 46, 45, 46, 23, 24, -1, -1, 34, + -1, 36, -1, 31, 32, 23, 24, 35, -1, 37, + 84, -1, -1, 31, 32, 23, 24, 35, 84, 37, + -1, -1, -1, 31, 32, 23, 24, 35, -1, 37, + -1, -1, 3, 31, 32, 23, 24, 35, -1, 37, + -1, -1, 13, 31, 32, -1, 17, 35, -1, 37, + 3, -1, -1, 23, 24, 26, -1, 28, -1, -1, + 13, -1, 32, -1, 17, 35, -1, 37, 39, -1, + 41, 42, -1, 26, -1, 28, -1, -1, 49, -1, + -1, 52, 53, -1, -1, -1, 39, 58, 41, 42, + -1, 12, 13, 64, -1, -1, 49, -1, -1, 52, + 53, 22, -1, -1, -1, 58, 77, -1, 29, -1, + -1, 64, 33, 34, -1, 36, -1, -1, 12, 13, + -1, -1, 43, -1, 77, -1, 47, -1, 22, -1, + -1, -1, -1, -1, -1, 29, -1, -1, -1, 33, + 34, -1, 36, -1, 65, -1, 67, -1, -1, 43, + -1, -1, -1, 47, -1, -1, -1, 78, 79, 80, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 77, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 11, 12, 13, -1, -1, -1, -1, -1, - -1, -1, -1, 22, -1, -1, -1, -1, -1, -1, - 29, -1, -1, -1, 33, 34, -1, 36, -1, -1, - -1, 40, -1, 42, 43, 44, -1, -1, 47, -1, - -1, -1, 51, -1, 53, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 65, -1, 67, -1, - 69, -1, 71, -1, 73, -1, -1, -1, -1, 78, - 79, 80, -1, -1, -1, -1, -1, -1, -1, 11, + -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, 56, -1, -1, -1, -1, -1, + -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, -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, 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, -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, 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, + 67, -1, 69, -1, 71, 72, 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, 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, - 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, 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, + -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, - 10, 10, 20, 10, 85, 55, 11, 10, 51, 11, - 11, 10, 6, 11, 11, 6, 70, 6, 11, 82, - 10, 17, 10, 10, 70, 17, 11, 55, 11, 2, - 8, 10, 76, 10, 5, 11, 17, 11, 10, 55, - 74, 10, 17, 13, 11, 87, 6, 11, 10, 89, - 11, 19, 17, 10, 17, 8, 11, 11, 17, 17, - 55, 17, 28, 10, -1, 17, 17, 17, 11, 10, - -1, 20, 21, 11, 24, -1, 11, -1, 44, -1, - 28, -1, 28, 28, 30, 33, 28, 11, 33, 28, - 32, 28, 28, 32, 30, 32, 22, 28, 28, 25, - 28, 28, 33, 33, 11, 33, 33, 28, 28, 52, - 28, 28, 33, 33, 52, 28, 33, 52, 28, 28, - 38, 34, 28, 33, 33, 28, 28, 33, 30, 28, - 17, 28, 31, 30, 28, 28, 30, 24, 28, 42, - 30, 34, 28, 22, 30, 52, 25, -1, 95, 90, - 28, 28, 30, 30, 28, 28, 30, 30, 28, 28, - 30, 28, 28, 30, 30, 28, 28, 36, 30, 28, - -1, 34, 28, 28, 28, 34, 28, 33, 28, 33, - -1, 33, -1, 33, 28, 40, -1, 41, 28, 33, - -1, 43, -1, 33, 50, 45, 28, 28, -1, 39, - 28, 33, 33, 35, 35, 33, 50, 35, 28, 28, - 28, 28, -1, 33, 33, 33, 33, 37, 35, 28, - -1, -1, -1, -1, 33, -1, -1, -1, -1, -1, - -1, 50, 50, -1, -1, -1, -1, -1, -1, -1, - -1, 50, 28, -1, -1, 31, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 19, 11, 19, 87, 15, 19, 12, 53, 72, 12, + 19, 12, 89, 21, 19, 57, 11, 11, 72, 12, + 57, 84, 12, 57, 11, 9, 78, 19, 11, 9, + 12, 12, 11, 11, 22, 5, 12, 11, 11, 90, + 9, 12, 19, 11, 19, 10, 12, 19, 6, 12, + 57, 2, 12, 12, 6, 12, 11, 11, 11, 9, + 76, -1, 11, 19, 12, 12, 30, -1, 30, 30, + 34, -1, -1, 35, 35, 12, 22, 23, 11, 19, + 13, 8, -1, 10, -1, 30, 30, 30, 30, 34, + -1, 35, 30, 35, 30, 30, 34, 12, 30, 42, + 30, 30, 30, -1, 40, 35, 35, 35, 30, 30, + 32, 46, 44, 30, 35, 32, 24, 54, 30, 27, + 32, 30, 12, 32, 30, 30, 30, 33, 33, 30, + 30, 32, 32, 30, 38, 32, 30, 30, 19, 54, + 12, 35, 35, -1, 30, 26, 32, 30, 30, 32, + 32, 30, 30, 32, 30, -1, -1, 35, 7, 30, + 36, 10, 30, 30, 54, 36, 30, 35, 30, 36, + 32, 30, 36, 32, 24, 30, 30, 27, 32, 30, + 35, 32, 54, 30, 30, 30, -1, -1, 35, 35, + 35, 11, 47, 13, 41, 30, 30, 30, 30, 45, + 35, 35, 35, 35, 30, 37, -1, 52, 30, 35, + 43, 37, 11, 35, 13, 30, 30, 52, 52, 30, + 35, 35, 37, 37, 35, -1, 30, -1, -1, -1, + 52, 35, -1, -1, -1, 39, -1, -1, -1, -1, + -1, 52, -1, -1, -1, -1, -1, -1, -1, 19, + -1, -1, -1, -1, -1, -1, 26, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 91, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -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}; diff --git a/src/declarative/qml/parser/javascriptgrammar_p.h b/src/declarative/qml/parser/javascriptgrammar_p.h index 10f0313..3d52a9e 100644 --- a/src/declarative/qml/parser/javascriptgrammar_p.h +++ b/src/declarative/qml/parser/javascriptgrammar_p.h @@ -96,14 +96,14 @@ public: T_XOR_EQ = 77, ACCEPT_STATE = 7, - RULE_COUNT = 291, - STATE_COUNT = 507, + RULE_COUNT = 296, + STATE_COUNT = 520, TERMINAL_COUNT = 88, - NON_TERMINAL_COUNT = 97, + NON_TERMINAL_COUNT = 98, - GOTO_INDEX_OFFSET = 507, - GOTO_INFO_OFFSET = 1569, - GOTO_CHECK_OFFSET = 1569 + GOTO_INDEX_OFFSET = 520, + GOTO_INFO_OFFSET = 1660, + GOTO_CHECK_OFFSET = 1660 }; static const char *const spell []; diff --git a/src/declarative/qml/parser/javascriptparser.cpp b/src/declarative/qml/parser/javascriptparser.cpp index a399c36..11d7e4b 100644 --- a/src/declarative/qml/parser/javascriptparser.cpp +++ b/src/declarative/qml/parser/javascriptparser.cpp @@ -224,23 +224,23 @@ case 13: { node->rbraceToken = loc(3); sym(1).Node = node; } break; - -case 14: { + case 14: +case 15: { AST::UiObjectBinding *node = makeAstNode (driver->nodePool(), sym(1).UiQualifiedId->finish(), sym(3).sval, sym(4).UiObjectInitializer); node->colonToken = loc(2); node->identifierToken = loc(3); sym(1).Node = node; } break; - -case 15: { + case 16: +case 17: { AST::UiObjectDefinition *node = makeAstNode (driver->nodePool(), sym(1).sval, sym(2).UiObjectInitializer); node->identifierToken = loc(1); sym(1).Node = node; } break; - -case 16: { + case 18: +case 19: { AST::UiArrayBinding *node = makeAstNode (driver->nodePool(), sym(1).UiQualifiedId->finish(), sym(4).UiObjectMemberList->finish()); node->colonToken = loc(2); @@ -248,15 +248,15 @@ case 16: { node->rbraceToken = loc(5); sym(1).Node = node; } break; - -case 17: { + case 20: +case 21: { AST::UiScriptBinding *node = makeAstNode (driver->nodePool(), sym(1).UiQualifiedId->finish(), sym(3).Statement); node->colonToken = loc(2); sym(1).Node = node; } break; -case 18: { +case 22: { AST::UiPublicMember *node = makeAstNode (driver->nodePool(), sym(2).sval, sym(3).sval, sym(5).Expression, sym(6).UiObjectInitializer); node->publicToken = loc(1); @@ -266,7 +266,7 @@ case 18: { sym(1).Node = node; } break; -case 19: { +case 23: { AST::UiPublicMember *node = makeAstNode (driver->nodePool(), sym(2).sval, sym(3).sval); node->publicToken = loc(1); node->attributeTypeToken = loc(2); @@ -274,7 +274,7 @@ case 19: { sym(1).Node = node; } break; -case 20: { +case 24: { AST::UiPublicMember *node = makeAstNode (driver->nodePool(), sym(2).sval, sym(3).sval, sym(5).Expression, static_cast(0)); node->publicToken = loc(1); @@ -284,61 +284,62 @@ case 20: { sym(1).Node = node; } break; -case 21: { + +case 26: { AST::UiQualifiedId *node = makeAstNode (driver->nodePool(), sym(1).sval); node->identifierToken = loc(1); sym(1).Node = node; } break; -case 22: { +case 27: { AST::UiQualifiedId *node = makeAstNode (driver->nodePool(), sym(1).UiQualifiedId, sym(3).sval); node->identifierToken = loc(3); sym(1).Node = node; } break; -case 23: { +case 28: { AST::ThisExpression *node = makeAstNode (driver->nodePool()); node->thisToken = loc(1); sym(1).Node = node; } break; -case 24: { +case 29: { AST::IdentifierExpression *node = makeAstNode (driver->nodePool(), sym(1).sval); node->identifierToken = loc(1); sym(1).Node = node; } break; -case 25: { +case 30: { AST::NullExpression *node = makeAstNode (driver->nodePool()); node->nullToken = loc(1); sym(1).Node = node; } break; -case 26: { +case 31: { AST::TrueLiteral *node = makeAstNode (driver->nodePool()); node->trueToken = loc(1); sym(1).Node = node; } break; -case 27: { +case 32: { AST::FalseLiteral *node = makeAstNode (driver->nodePool()); node->falseToken = loc(1); sym(1).Node = node; } break; -case 28: { +case 33: { AST::NumericLiteral *node = makeAstNode (driver->nodePool(), sym(1).dval); node->literalToken = loc(1); sym(1).Node = node; } break; -case 29: { +case 34: { AST::StringLiteral *node = makeAstNode (driver->nodePool(), sym(1).sval); node->literalToken = loc(1); sym(1).Node = node; } break; -case 30: { +case 35: { bool rx = lexer->scanRegExp(Lexer::NoPrefix); if (!rx) { diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, lexer->startLineNo(), @@ -350,7 +351,7 @@ case 30: { sym(1).Node = node; } break; -case 31: { +case 36: { bool rx = lexer->scanRegExp(Lexer::EqualPrefix); if (!rx) { diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, lexer->startLineNo(), @@ -362,91 +363,81 @@ case 31: { sym(1).Node = node; } break; -case 32: { +case 37: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Elision); } break; -case 33: { +case 38: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).ElementList->finish ()); } break; -case 34: { +case 39: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).ElementList->finish (), sym(4).Elision); } break; -case 35: { +case 40: { if (sym(2).Node) sym(1).Node = makeAstNode (driver->nodePool(), sym(2).PropertyNameAndValueList->finish ()); else sym(1).Node = makeAstNode (driver->nodePool()); } break; -case 36: { +case 41: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).PropertyNameAndValueList->finish ()); } break; -case 37: { +case 42: { sym(1) = sym(2); } break; -case 38: { +case 43: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Elision, sym(2).Expression); } break; -case 39: { +case 44: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).ElementList, sym(3).Elision, sym(4).Expression); } break; -case 40: { +case 45: { sym(1).Node = makeAstNode (driver->nodePool()); } break; -case 41: { +case 46: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Elision); } break; -case 42: { +case 47: { sym(1).Node = 0; } break; -case 43: { +case 48: { sym(1).Elision = sym(1).Elision->finish (); } break; -case 44: { +case 49: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).PropertyName, sym(3).Expression); } break; -case 45: { +case 50: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).PropertyNameAndValueList, sym(3).PropertyName, sym(5).Expression); } break; -case 46: { +case 51: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).sval); } break; -case 47: { +case 52: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).sval); } break; -case 48: { +case 53: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).dval); } break; -case 49: { +case 54: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).sval); } break; -case 50: - -case 51: - -case 52: - -case 53: - -case 54: - case 55: case 56: @@ -498,22 +489,32 @@ case 78: case 79: case 80: + +case 81: + +case 82: + +case 83: + +case 84: + +case 85: { sym(1).sval = driver->intern(lexer->characterBuffer(), lexer->characterCount()); } break; -case 85: { +case 90: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression); } break; -case 86: { +case 91: { AST::FieldMemberExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).sval); node->dotToken = loc(2); node->identifierToken = loc(3); sym(1).Node = node; } break; -case 87: { +case 92: { AST::NewMemberExpression *node = makeAstNode (driver->nodePool(), sym(2).Expression, sym(4).ArgumentList); node->newToken = loc(1); node->lparenToken = loc(3); @@ -521,541 +522,541 @@ case 87: { sym(1).Node = node; } break; -case 89: { +case 94: { AST::NewExpression *node = makeAstNode (driver->nodePool(), sym(2).Expression); node->newToken = loc(1); sym(1).Node = node; } break; -case 90: { +case 95: { AST::CallExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).ArgumentList); node->lparenToken = loc(2); node->rparenToken = loc(4); sym(1).Node = node; } break; -case 91: { +case 96: { AST::CallExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).ArgumentList); node->lparenToken = loc(2); node->rparenToken = loc(4); sym(1).Node = node; } break; -case 92: { +case 97: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression); } break; -case 93: { +case 98: { AST::FieldMemberExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).sval); node->dotToken = loc(2); node->identifierToken = loc(3); sym(1).Node = node; } break; -case 94: { +case 99: { sym(1).Node = 0; } break; -case 95: { +case 100: { sym(1).Node = sym(1).ArgumentList->finish(); } break; -case 96: { +case 101: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression); } break; -case 97: { +case 102: { AST::ArgumentList *node = makeAstNode (driver->nodePool(), sym(1).ArgumentList, sym(3).Expression); node->commaToken = loc(2); sym(1).Node = node; } break; -case 101: { +case 106: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression); } break; -case 102: { +case 107: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression); } break; -case 104: { +case 109: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); } break; -case 105: { +case 110: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); } break; -case 106: { +case 111: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); } break; -case 107: { +case 112: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); } break; -case 108: { +case 113: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); } break; -case 109: { +case 114: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); } break; -case 110: { +case 115: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); } break; -case 111: { +case 116: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); } break; -case 112: { +case 117: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); } break; -case 114: { +case 119: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Mul, sym(3).Expression); } break; -case 115: { +case 120: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Div, sym(3).Expression); } break; -case 116: { +case 121: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Mod, sym(3).Expression); } break; -case 118: { +case 123: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Add, sym(3).Expression); } break; -case 119: { +case 124: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Sub, sym(3).Expression); } break; -case 121: { +case 126: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::LShift, sym(3).Expression); } break; -case 122: { +case 127: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::RShift, sym(3).Expression); } break; -case 123: { +case 128: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::URShift, sym(3).Expression); } break; -case 125: { +case 130: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Lt, sym(3).Expression); } break; -case 126: { +case 131: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Gt, sym(3).Expression); } break; -case 127: { +case 132: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Le, sym(3).Expression); } break; -case 128: { +case 133: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Ge, sym(3).Expression); } break; -case 129: { +case 134: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::InstanceOf, sym(3).Expression); } break; -case 130: { +case 135: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::In, sym(3).Expression); } break; -case 132: { +case 137: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Lt, sym(3).Expression); } break; -case 133: { +case 138: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Gt, sym(3).Expression); } break; -case 134: { +case 139: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Le, sym(3).Expression); } break; -case 135: { +case 140: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Ge, sym(3).Expression); } break; -case 136: { +case 141: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::InstanceOf, sym(3).Expression); } break; -case 138: { +case 143: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Equal, sym(3).Expression); } break; -case 139: { +case 144: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::NotEqual, sym(3).Expression); } break; -case 140: { +case 145: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::StrictEqual, sym(3).Expression); } break; -case 141: { +case 146: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::StrictNotEqual, sym(3).Expression); } break; -case 143: { +case 148: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Equal, sym(3).Expression); } break; -case 144: { +case 149: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::NotEqual, sym(3).Expression); } break; -case 145: { +case 150: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::StrictEqual, sym(3).Expression); } break; -case 146: { +case 151: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::StrictNotEqual, sym(3).Expression); } break; -case 148: { +case 153: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::BitAnd, sym(3).Expression); } break; -case 150: { +case 155: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::BitAnd, sym(3).Expression); } break; -case 152: { +case 157: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::BitXor, sym(3).Expression); } break; -case 154: { +case 159: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::BitXor, sym(3).Expression); } break; -case 156: { +case 161: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::BitOr, sym(3).Expression); } break; -case 158: { +case 163: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::BitOr, sym(3).Expression); } break; -case 160: { +case 165: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::And, sym(3).Expression); } break; -case 162: { +case 167: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::And, sym(3).Expression); } break; -case 164: { +case 169: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Or, sym(3).Expression); } break; -case 166: { +case 171: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Or, sym(3).Expression); } break; -case 168: { +case 173: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression, sym(5).Expression); } break; -case 170: { +case 175: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression, sym(5).Expression); } break; -case 172: { +case 177: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(2).ival, sym(3).Expression); } break; -case 174: { +case 179: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(2).ival, sym(3).Expression); } break; -case 175: { +case 180: { sym(1).ival = QSOperator::Assign; } break; -case 176: { +case 181: { sym(1).ival = QSOperator::InplaceMul; } break; -case 177: { +case 182: { sym(1).ival = QSOperator::InplaceDiv; } break; -case 178: { +case 183: { sym(1).ival = QSOperator::InplaceMod; } break; -case 179: { +case 184: { sym(1).ival = QSOperator::InplaceAdd; } break; -case 180: { +case 185: { sym(1).ival = QSOperator::InplaceSub; } break; -case 181: { +case 186: { sym(1).ival = QSOperator::InplaceLeftShift; } break; -case 182: { +case 187: { sym(1).ival = QSOperator::InplaceRightShift; } break; -case 183: { +case 188: { sym(1).ival = QSOperator::InplaceURightShift; } break; -case 184: { +case 189: { sym(1).ival = QSOperator::InplaceAnd; } break; -case 185: { +case 190: { sym(1).ival = QSOperator::InplaceXor; } break; -case 186: { +case 191: { sym(1).ival = QSOperator::InplaceOr; } break; -case 188: { +case 193: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression); } break; -case 189: { +case 194: { sym(1).Node = 0; } break; -case 192: { +case 197: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression); } break; -case 193: { +case 198: { sym(1).Node = 0; } break; -case 210: { +case 215: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).StatementList); } break; -case 211: { +case 216: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Statement); } break; -case 212: { +case 217: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).StatementList, sym(2).Statement); } break; -case 213: { +case 218: { sym(1).Node = 0; } break; -case 214: { +case 219: { sym(1).Node = sym(1).StatementList->finish (); } break; -case 216: { +case 221: { AST::VariableStatement *node = makeAstNode (driver->nodePool(), sym(2).VariableDeclarationList->finish (/*readOnly=*/sym(1).ival == T_CONST)); node->declarationKindToken = loc(1); node->semicolonToken = loc(3); sym(1).Node = node; } break; -case 217: { +case 222: { sym(1).ival = T_CONST; } break; -case 218: { +case 223: { sym(1).ival = T_VAR; } break; -case 219: { +case 224: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).VariableDeclaration); } break; -case 220: { +case 225: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).VariableDeclarationList, sym(3).VariableDeclaration); } break; -case 221: { +case 226: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).VariableDeclaration); } break; -case 222: { +case 227: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).VariableDeclarationList, sym(3).VariableDeclaration); } break; -case 223: { +case 228: { AST::VariableDeclaration *node = makeAstNode (driver->nodePool(), sym(1).sval, sym(2).Expression); node->identifierToken = loc(1); sym(1).Node = node; } break; -case 224: { +case 229: { AST::VariableDeclaration *node = makeAstNode (driver->nodePool(), sym(1).sval, sym(2).Expression); node->identifierToken = loc(1); sym(1).Node = node; } break; -case 225: { +case 230: { sym(1) = sym(2); } break; -case 226: { +case 231: { sym(1).Node = 0; } break; -case 228: { +case 233: { sym(1) = sym(2); } break; -case 229: { +case 234: { sym(1).Node = 0; } break; -case 231: { +case 236: { sym(1).Node = makeAstNode (driver->nodePool()); } break; -case 233: { +case 238: { AST::ExpressionStatement *node = makeAstNode (driver->nodePool(), sym(1).Expression); node->semicolonToken = loc(2); sym(1).Node = node; } break; -case 234: { +case 239: { sym(1).Node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Statement, sym(7).Statement); } break; -case 235: { +case 240: { sym(1).Node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Statement); } break; -case 237: { +case 242: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Statement, sym(5).Expression); } break; -case 238: { +case 243: { sym(1).Node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Statement); } break; -case 239: { +case 244: { sym(1).Node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Expression, sym(7).Expression, sym(9).Statement); } break; -case 240: { +case 245: { sym(1).Node = makeAstNode (driver->nodePool(), sym(4).VariableDeclarationList->finish (/*readOnly=*/false), sym(6).Expression, sym(8).Expression, sym(10).Statement); } break; -case 241: { +case 246: { sym(1).Node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Expression, sym(7).Statement); } break; -case 242: { +case 247: { sym(1).Node = makeAstNode (driver->nodePool(), sym(4).VariableDeclaration, sym(6).Expression, sym(8).Statement); } break; -case 244: { +case 249: { sym(1).Node = makeAstNode (driver->nodePool()); } break; -case 246: { +case 251: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).sval); } break; -case 248: { +case 253: { sym(1).Node = makeAstNode (driver->nodePool()); } break; -case 250: { +case 255: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).sval); } break; -case 252: { +case 257: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); } break; -case 253: { +case 258: { sym(1).Node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Statement); } break; -case 254: { +case 259: { sym(1).Node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).CaseBlock); } break; -case 255: { +case 260: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).CaseClauses); } break; -case 256: { +case 261: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).CaseClauses, sym(3).DefaultClause, sym(4).CaseClauses); } break; -case 257: { +case 262: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).CaseClause); } break; -case 258: { +case 263: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).CaseClauses, sym(2).CaseClause); } break; -case 259: { +case 264: { sym(1).Node = 0; } break; -case 260: { +case 265: { sym(1).Node = sym(1).CaseClauses->finish (); } break; -case 261: { +case 266: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression, sym(4).StatementList); } break; -case 262: { +case 267: { sym(1).Node = makeAstNode (driver->nodePool(), sym(3).StatementList); } break; -case 263: { +case 268: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).sval, sym(3).Statement); } break; -case 265: { +case 270: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); } break; -case 266: { +case 271: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Statement, sym(3).Catch); } break; -case 267: { +case 272: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Statement, sym(3).Finally); } break; -case 268: { +case 273: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Statement, sym(3).Catch, sym(4).Finally); } break; -case 269: { +case 274: { sym(1).Node = makeAstNode (driver->nodePool(), sym(3).sval, sym(5).Statement); } break; -case 270: { +case 275: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Statement); } break; -case 272: { +case 277: { sym(1).Node = makeAstNode (driver->nodePool()); } break; -case 273: { +case 278: { AST::FunctionDeclaration *node = makeAstNode (driver->nodePool(), sym(2).sval, sym(4).FormalParameterList, sym(7).FunctionBody); node->functionToken = loc(1); node->identifierToken = loc(2); @@ -1066,7 +1067,7 @@ case 273: { sym(1).Node = node; } break; -case 274: { +case 279: { AST::FunctionExpression *node = makeAstNode (driver->nodePool(), sym(2).sval, sym(4).FormalParameterList, sym(7).FunctionBody); node->functionToken = loc(1); if (sym(2).sval) @@ -1078,56 +1079,56 @@ case 274: { sym(1).Node = node; } break; -case 275: { +case 280: { AST::FormalParameterList *node = makeAstNode (driver->nodePool(), sym(1).sval); node->identifierToken = loc(1); sym(1).Node = node; } break; -case 276: { +case 281: { AST::FormalParameterList *node = makeAstNode (driver->nodePool(), sym(1).FormalParameterList, sym(3).sval); node->commaToken = loc(2); node->identifierToken = loc(3); sym(1).Node = node; } break; -case 277: { +case 282: { sym(1).Node = 0; } break; -case 278: { +case 283: { sym(1).Node = sym(1).FormalParameterList->finish (); } break; -case 279: { +case 284: { sym(1).Node = 0; } break; -case 281: { +case 286: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).SourceElements->finish ()); } break; -case 282: { +case 287: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).SourceElement); } break; -case 283: { +case 288: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).SourceElements, sym(2).SourceElement); } break; -case 284: { +case 289: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Statement); } break; -case 285: { +case 290: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).FunctionDeclaration); } break; -case 286: { +case 291: { sym(1).sval = 0; } break; -case 288: { +case 293: { sym(1).Node = 0; } break; diff --git a/src/declarative/qml/parser/javascriptparser_p.h b/src/declarative/qml/parser/javascriptparser_p.h index e982985..d31597b 100644 --- a/src/declarative/qml/parser/javascriptparser_p.h +++ b/src/declarative/qml/parser/javascriptparser_p.h @@ -203,9 +203,9 @@ protected: }; -#define J_SCRIPT_REGEXPLITERAL_RULE1 30 +#define J_SCRIPT_REGEXPLITERAL_RULE1 35 -#define J_SCRIPT_REGEXPLITERAL_RULE2 31 +#define J_SCRIPT_REGEXPLITERAL_RULE2 36 QT_END_NAMESPACE -- cgit v0.12 From 98f3c22d57ce9b4a2dff8e8eef1c786b89426645 Mon Sep 17 00:00:00 2001 From: Roberto Raggi Date: Mon, 20 Apr 2009 18:15:54 +0200 Subject: Generate ASTs for function and variable declarations. --- src/declarative/qml/parser/javascript.g | 10 + src/declarative/qml/parser/javascriptast.cpp | 9 + src/declarative/qml/parser/javascriptast_p.h | 16 +- src/declarative/qml/parser/javascriptastfwd_p.h | 1 + .../qml/parser/javascriptastvisitor_p.h | 2 + src/declarative/qml/parser/javascriptgrammar.cpp | 1157 ++++++++++---------- src/declarative/qml/parser/javascriptgrammar_p.h | 10 +- src/declarative/qml/parser/javascriptparser.cpp | 357 +++--- src/declarative/qml/parser/javascriptparser_p.h | 4 +- 9 files changed, 808 insertions(+), 758 deletions(-) diff --git a/src/declarative/qml/parser/javascript.g b/src/declarative/qml/parser/javascript.g index 3a4061b..baec64f 100644 --- a/src/declarative/qml/parser/javascript.g +++ b/src/declarative/qml/parser/javascript.g @@ -656,6 +656,16 @@ case $rule_number: { UiObjectMember: FunctionDeclaration ; /. +case $rule_number: { + sym(1).Node = makeAstNode(driver->nodePool(), sym(1).Statement); +} break; +./ + +UiObjectMember: VariableStatement ; +/. +case $rule_number: { + sym(1).Node = makeAstNode(driver->nodePool(), sym(1).Statement); +} break; ./ UiQualifiedId: T_IDENTIFIER ; diff --git a/src/declarative/qml/parser/javascriptast.cpp b/src/declarative/qml/parser/javascriptast.cpp index f779f04..4ceb9ad 100644 --- a/src/declarative/qml/parser/javascriptast.cpp +++ b/src/declarative/qml/parser/javascriptast.cpp @@ -888,6 +888,15 @@ void UiImportList::accept0(Visitor *visitor) visitor->endVisit(this); } +void UiSourceElement::accept0(Visitor *visitor) +{ + if (visitor->visit(this)) { + acceptChild(sourceElement, visitor); + } + + visitor->endVisit(this); +} + } } // namespace JavaScript::AST QT_END_NAMESPACE diff --git a/src/declarative/qml/parser/javascriptast_p.h b/src/declarative/qml/parser/javascriptast_p.h index 4a5f553..de34ab2 100644 --- a/src/declarative/qml/parser/javascriptast_p.h +++ b/src/declarative/qml/parser/javascriptast_p.h @@ -215,7 +215,8 @@ public: Kind_UiScriptBinding, Kind_UiArrayBinding, Kind_UiObjectMemberList, - Kind_UiQualifiedId + Kind_UiQualifiedId, + Kind_UiSourceElement }; inline Node() @@ -1674,6 +1675,19 @@ public: SourceLocation rbraceToken; }; +class UiSourceElement: public UiObjectMember +{ +public: + UiSourceElement(Statement *sourceElement) + : sourceElement(sourceElement) + { kind = Kind_UiSourceElement; } + + virtual void accept0(Visitor *visitor); + +// attributes + Statement *sourceElement; +}; + class UiObjectBinding: public UiObjectMember { public: diff --git a/src/declarative/qml/parser/javascriptastfwd_p.h b/src/declarative/qml/parser/javascriptastfwd_p.h index f53c0e5..e3951ed 100644 --- a/src/declarative/qml/parser/javascriptastfwd_p.h +++ b/src/declarative/qml/parser/javascriptastfwd_p.h @@ -150,6 +150,7 @@ class UiObjectDefinition; class UiObjectInitializer; class UiObjectBinding; class UiScriptBinding; +class UiSourceElement; class UiArrayBinding; class UiObjectMember; class UiObjectMemberList; diff --git a/src/declarative/qml/parser/javascriptastvisitor_p.h b/src/declarative/qml/parser/javascriptastvisitor_p.h index bc9a8a6..e5f1427 100644 --- a/src/declarative/qml/parser/javascriptastvisitor_p.h +++ b/src/declarative/qml/parser/javascriptastvisitor_p.h @@ -73,6 +73,7 @@ public: virtual bool visit(UiImportList *) { return true; } virtual bool visit(UiImport *) { return true; } virtual bool visit(UiPublicMember *) { return true; } + virtual bool visit(UiSourceElement *) { return true; } virtual bool visit(UiObjectDefinition *) { return true; } virtual bool visit(UiObjectInitializer *) { return true; } virtual bool visit(UiObjectBinding *) { return true; } @@ -85,6 +86,7 @@ public: virtual void endVisit(UiImportList *) {} virtual void endVisit(UiImport *) {} virtual void endVisit(UiPublicMember *) {} + virtual void endVisit(UiSourceElement *) {} virtual void endVisit(UiObjectDefinition *) {} virtual void endVisit(UiObjectInitializer *) {} virtual void endVisit(UiObjectBinding *) {} diff --git a/src/declarative/qml/parser/javascriptgrammar.cpp b/src/declarative/qml/parser/javascriptgrammar.cpp index 35af821..0b25807 100644 --- a/src/declarative/qml/parser/javascriptgrammar.cpp +++ b/src/declarative/qml/parser/javascriptgrammar.cpp @@ -15,533 +15,529 @@ 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, 102, 102, - 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, - 102, 102, 102, 104, 104, 108, 108, 103, 103, 106, - 106, 109, 109, 109, 109, 110, 110, 110, 110, 110, - 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, - 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, - 110, 110, 110, 110, 110, 110, 111, 111, 112, 112, - 112, 112, 112, 115, 115, 116, 116, 116, 116, 114, - 114, 117, 117, 118, 118, 119, 119, 119, 120, 120, - 120, 120, 120, 120, 120, 120, 120, 120, 121, 121, - 121, 121, 122, 122, 122, 123, 123, 123, 123, 124, - 124, 124, 124, 124, 124, 124, 125, 125, 125, 125, - 125, 125, 126, 126, 126, 126, 126, 127, 127, 127, - 127, 127, 128, 128, 129, 129, 130, 130, 131, 131, - 132, 132, 133, 133, 134, 134, 135, 135, 136, 136, - 137, 137, 138, 138, 139, 139, 107, 107, 140, 140, - 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, - 141, 141, 100, 100, 142, 142, 143, 143, 144, 144, - 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, - 99, 99, 99, 99, 99, 145, 161, 161, 160, 160, - 146, 146, 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, 113, - 181, 181, 178, 178, 179, 179, 182, 183, 183, 184, - 184, 180, 180, 105, 105, 185}; + 96, 94, 94, 94, 94, 94, 94, 98, 98, 103, + 103, 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, 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}; 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, 6, 3, 5, 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, 6, 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, 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, 3, 1, 3, 1, 3, 1, 3, 1, 3, - 1, 3, 1, 5, 1, 5, 1, 3, 1, 3, + 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, 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, 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, 1, 1, 1, 1, 1, 3, 1, 2, 0, + 1, 3, 3, 1, 1, 1, 3, 1, 3, 2, + 2, 2, 0, 1, 2, 0, 1, 1, 2, 2, + 7, 5, 7, 7, 5, 9, 10, 7, 8, 2, + 2, 3, 3, 2, 2, 3, 3, 3, 3, 5, + 5, 3, 5, 1, 2, 0, 1, 4, 3, 3, + 3, 3, 3, 3, 4, 5, 2, 2, 2, 8, + 8, 1, 3, 0, 1, 0, 1, 1, 1, 2, + 1, 1, 0, 1, 0, 1, 2}; const int JavaScriptGrammar::action_default [] = { - 8, 2, 0, 0, 4, 3, 0, 296, 0, 6, - 7, 5, 26, 0, 27, 0, 9, 1, 0, 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, 223, 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, 224, - 0, 0, 0, 213, 214, 119, 0, 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, 232, 225, 0, 233, - 229, 0, 231, 221, 0, 222, 226, 0, 18, 13, + 8, 2, 0, 0, 4, 3, 0, 297, 0, 6, + 7, 5, 26, 224, 0, 28, 0, 225, 9, 1, + 0, 0, 27, 0, 284, 285, 0, 282, 0, 283, + 0, 286, 127, 194, 158, 166, 162, 202, 209, 106, + 178, 208, 216, 204, 154, 0, 205, 287, 0, 292, + 91, 206, 207, 212, 107, 170, 174, 95, 124, 105, + 110, 90, 144, 210, 131, 289, 288, 291, 213, 0, + 0, 0, 0, 37, 38, 0, 34, 0, 293, 31, + 0, 295, 49, 0, 0, 0, 0, 0, 32, 35, + 0, 0, 196, 238, 36, 0, 30, 0, 0, 33, + 0, 0, 0, 0, 0, 214, 215, 120, 203, 211, + 0, 0, 107, 126, 293, 31, 295, 109, 108, 0, + 0, 0, 122, 123, 121, 0, 294, 284, 0, 0, + 286, 0, 281, 0, 296, 0, 56, 57, 58, 59, + 84, 60, 85, 61, 62, 63, 64, 65, 66, 67, + 68, 53, 69, 70, 71, 72, 73, 55, 86, 74, + 54, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 87, 0, 51, 0, 0, 43, 0, 52, 42, 125, + 0, 155, 0, 0, 0, 0, 145, 0, 0, 0, + 0, 0, 0, 135, 0, 0, 0, 129, 130, 128, + 133, 137, 136, 134, 132, 147, 146, 148, 0, 163, + 0, 159, 0, 0, 101, 100, 89, 88, 0, 0, + 99, 195, 102, 0, 103, 0, 104, 98, 239, 240, + 280, 0, 191, 184, 182, 189, 190, 188, 187, 193, + 186, 185, 183, 192, 179, 0, 167, 0, 0, 171, + 0, 0, 175, 0, 0, 101, 93, 0, 92, 0, + 97, 290, 254, 0, 255, 256, 257, 250, 0, 251, + 252, 253, 278, 279, 111, 0, 0, 0, 0, 0, + 243, 244, 200, 198, 160, 168, 164, 180, 156, 201, + 0, 107, 172, 176, 149, 138, 0, 0, 157, 0, + 0, 0, 0, 150, 0, 0, 0, 0, 0, 142, + 140, 143, 141, 139, 152, 151, 153, 0, 165, 0, + 161, 0, 199, 107, 0, 181, 196, 197, 0, 196, + 0, 0, 246, 0, 0, 0, 248, 0, 169, 0, + 0, 173, 0, 0, 177, 236, 0, 228, 237, 231, + 0, 235, 0, 196, 229, 0, 196, 0, 0, 247, + 0, 0, 0, 249, 294, 0, 270, 0, 0, 0, + 242, 0, 241, 218, 221, 0, 57, 84, 60, 85, + 62, 63, 34, 67, 68, 31, 69, 72, 32, 35, + 196, 36, 75, 30, 77, 33, 79, 80, 81, 82, + 83, 87, 219, 217, 95, 96, 101, 0, 94, 0, + 258, 259, 0, 0, 0, 261, 266, 264, 267, 0, + 0, 265, 266, 0, 262, 0, 263, 220, 269, 0, + 220, 268, 0, 271, 272, 0, 220, 273, 274, 0, + 0, 275, 0, 0, 0, 276, 277, 113, 112, 0, + 0, 0, 245, 0, 0, 0, 260, 0, 50, 0, + 47, 49, 40, 0, 46, 41, 48, 45, 39, 0, + 44, 117, 115, 119, 116, 114, 118, 0, 18, 13, 0, 14, 10, 0, 24, 0, 25, 23, 0, 0, - 22, 30, 48, 16, 27, 0, 11, 0, 17, 0, - 20, 12, 0, 21, 30, 48, 15, 0, 19, 28}; + 22, 31, 49, 16, 28, 0, 11, 0, 17, 0, + 20, 12, 0, 21, 31, 49, 15, 0, 19, 29, + 233, 226, 0, 234, 230, 0, 232, 222, 0, 223, + 227}; const int JavaScriptGrammar::goto_default [] = { - 2, 6, 17, 1, 5, 4, 16, 505, 506, 488, - 18, 372, 41, 12, 57, 458, 456, 134, 133, 29, - 457, 132, 135, 214, 53, 46, 222, 55, 35, 221, - 50, 56, 105, 54, 28, 60, 58, 293, 40, 287, - 30, 283, 32, 285, 31, 284, 51, 291, 52, 292, - 36, 286, 282, 323, 408, 288, 289, 33, 107, 39, - 42, 47, 48, 37, 34, 59, 108, 49, 64, 103, - 104, 38, 374, 373, 106, 478, 477, 345, 346, 480, - 348, 479, 347, 414, 418, 421, 417, 416, 436, 437, - 22, 44, 124, 21, 43, 62, 61, 0}; + 2, 6, 19, 1, 5, 4, 18, 495, 496, 478, + 20, 373, 45, 12, 108, 61, 459, 457, 135, 134, + 33, 458, 133, 136, 215, 57, 50, 223, 59, 39, + 222, 54, 60, 107, 58, 32, 64, 62, 294, 44, + 288, 34, 284, 36, 286, 35, 285, 55, 292, 56, + 293, 40, 287, 283, 324, 409, 289, 290, 37, 43, + 46, 51, 52, 41, 38, 63, 109, 53, 68, 105, + 106, 42, 375, 374, 21, 512, 511, 346, 347, 514, + 349, 513, 348, 415, 419, 422, 418, 417, 437, 438, + 26, 48, 125, 25, 47, 66, 65, 0}; const int JavaScriptGrammar::action_index [] = { - -21, -88, 75, 14, -88, -5, 208, -88, 88, -88, - -88, -88, -88, 55, 50, 56, -88, 163, 120, 69, - 70, 79, -7, -88, -6, -88, -12, 1320, 129, -88, - 61, -30, -57, -88, -88, 285, -88, -88, -88, -88, - 268, 233, -88, -88, 40, -88, -88, -88, -88, -88, - 349, 28, 124, 155, 148, -88, -88, -88, 332, -88, - 236, -88, 1320, -88, -88, 178, -88, 189, 125, 588, - -88, -88, 1236, -88, 62, 72, 90, 66, 1572, 84, - 588, 588, 588, 426, 588, -88, -88, 588, 588, 588, - -88, -88, 46, -88, 588, 588, -88, 48, 588, -88, - 588, 53, 54, -88, -88, -88, 67, -88, -88, 588, - 588, 78, 169, 59, -88, 1068, -88, -88, 588, 588, - 588, -88, -88, -88, 33, -88, -29, -58, -20, 1320, - -41, -88, 13, 17, -50, -88, -88, -88, -88, -88, + -19, -88, 70, 4, -88, -6, 252, -88, 75, -88, + -88, -88, -88, -88, 46, 50, 52, -88, -88, 241, + 100, 65, -88, -17, -12, 16, -30, -88, -1, -88, + -7, 1307, 114, -88, 14, -44, -75, -88, -88, 199, + -88, -88, -88, -88, 250, 228, -88, -88, -22, -88, + -88, -88, -88, -88, 498, 140, 96, 172, 195, -88, + -88, -88, 311, -88, 216, -88, 1307, -88, -88, 194, + 198, 99, 575, -88, -88, 1223, -88, 72, 67, 92, + 64, 1559, 90, 575, 575, 575, 374, 575, -88, -88, + 575, 575, 575, -88, -88, 48, -88, 575, 575, -88, + 55, 575, 575, 51, 59, -88, -88, -88, -88, -88, + 575, 575, 77, 168, 60, -88, 1055, -88, -88, 575, + 575, 575, -88, -88, -88, 24, -88, -18, -55, 43, + 1307, -26, -88, 84, 85, 63, -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, - 588, -88, 1152, 132, -88, 588, -88, -88, 192, 588, - 252, 588, 588, 588, 588, 312, 588, 588, 588, 588, - 588, 588, 231, 588, 588, 588, 128, 89, 93, 175, - 197, 190, 183, 150, 292, 322, 302, 588, -2, 588, - 71, 984, 588, 588, -88, -88, -88, 109, 588, -88, - -88, 68, 52, -88, 588, -88, -88, -88, -88, -88, - 588, -88, -88, -88, -88, -88, -88, -88, -88, -88, - -88, -88, -88, -88, 588, 43, 588, 588, 64, 63, - 588, -88, 984, 588, 588, -88, 143, -88, 8, -88, - -88, -88, 96, -88, -88, -88, -88, 122, -88, -88, - -88, -88, -88, -88, 73, 74, 588, 99, 76, -88, - -88, 823, -88, 6, -36, -66, -88, 260, 51, -60, - 511, 1, 82, 350, 239, -13, 588, 266, 588, 588, - 588, 588, 350, 588, 588, 588, 588, 588, 235, 198, - 204, 227, 221, 350, 350, 267, 588, -61, 588, 23, - 588, -88, 367, 588, -88, 588, 20, -35, 588, -38, - 1236, -88, 588, 138, 1236, -88, 588, -44, 588, 588, - 7, -1, 588, -88, 18, 95, 32, -88, -88, 588, - -88, 2, 588, -88, -9, 588, -10, 1236, -88, 588, - 107, 1236, -88, 41, 1236, -88, 588, 103, 1236, 45, - 1236, -88, -88, 1236, 16, 135, 38, 172, 91, 588, - 1236, 47, 15, 77, 42, 3, 399, 31, 30, 669, - 27, -3, 25, 588, 34, 12, 588, 19, 588, 11, - 10, -88, -88, 180, -88, 588, -17, -88, 110, -88, - -88, 588, 212, -25, -88, 37, -88, 39, 106, 588, - -88, 35, 29, -88, 5, -88, 1236, -88, 101, 1236, - -88, 219, -88, -88, 108, 1236, 36, -88, 22, 24, - -88, 26, -33, -22, -88, -88, -88, -88, 588, 133, - 1236, -88, 588, 146, 1236, -88, 117, 21, 900, -88, - 9, -88, 746, -88, -88, -88, -88, -88, 116, -88, - -88, -88, -88, -88, -88, -88, 83, -88, 182, -88, - -88, 588, -88, -88, 49, -88, -88, 246, -88, -88, - 254, -88, -88, 44, 58, 588, 115, -88, 1488, 57, - -88, 112, 113, -88, 60, 126, -88, 111, -88, 65, - -88, -88, 1404, -88, 97, 114, -88, 147, -88, -88, + -88, 575, -88, 1139, 30, -88, 575, -88, -88, 208, + 575, 232, 575, 575, 575, 575, 321, 575, 575, 575, + 575, 575, 575, 219, 575, 575, 575, 127, 134, 122, + 154, 159, 174, 166, 173, 413, 413, 295, 575, -3, + 575, 71, 971, 575, 575, -88, -88, -88, 97, 575, + -88, -88, 69, 62, -88, 575, -88, -88, -88, -88, + -88, 575, -88, -88, -88, -88, -88, -88, -88, -88, + -88, -88, -88, -88, -88, 575, 49, 575, 575, 140, + 58, 575, -88, 971, 575, 575, -88, 126, -88, 11, + -88, -88, -88, 86, -88, -88, -88, -88, 78, -88, + -88, -88, -88, -88, -88, 28, 68, 575, 149, 66, + -88, -88, 887, -88, 54, -28, -58, -88, 254, 8, + -47, 429, 19, 79, 280, 192, -4, 575, 248, 575, + 575, 575, 575, 348, 575, 575, 575, 575, 575, 188, + 283, 191, 207, 215, 348, 348, 274, 575, -74, 575, + 54, 575, -88, 498, 575, -88, 575, -5, -61, 575, + -33, 1223, -88, 575, 220, 1223, -88, 575, -38, 575, + 575, 7, 0, 575, -88, -9, 98, 1, -88, -88, + 575, -88, 21, 575, -88, 3, 575, 2, 1223, -88, + 575, 112, 1223, -88, 27, 1223, -88, 575, 106, 1223, + 41, 1223, -88, -88, 1223, -16, 141, 9, 176, 82, + 575, 1223, 33, 10, 74, 38, 12, 355, 40, 37, + 656, 35, -2, 34, 575, 29, 20, 575, 32, 575, + 31, 42, -88, -88, 160, -88, 575, -8, -88, 94, + -88, -88, 575, 150, 25, -88, 17, -88, 44, 113, + 575, -88, 26, 36, -88, -20, -88, 1223, -88, 105, + 1223, -88, 214, -88, -88, 115, 1223, 39, -88, 18, + 23, -88, 22, -54, -21, -88, -88, -88, -88, 575, + 161, 1223, -88, 575, 130, 1223, -88, 133, 5, 810, + -88, 15, -88, 733, -88, -88, -88, -88, -88, 123, + -88, -88, -88, -88, -88, -88, -88, 285, -88, -88, + 309, -88, -88, 45, 61, 575, 155, -88, 1391, 53, + -88, 119, 103, -88, 47, 93, -88, 102, -88, 56, + -88, -88, 1475, -88, 118, 116, -88, 108, -88, -88, + 73, -88, 187, -88, -88, 575, -88, -88, 57, -88, + -88, - -98, -98, -98, -98, -98, 30, -98, -98, -98, -98, - -98, -98, -98, -98, -98, -98, -98, 48, -98, -98, - -98, -98, -98, -98, -98, -98, -98, 67, -98, -98, - -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, - -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, - -46, -98, -98, -98, -98, -98, -98, -98, -98, -98, - -98, -98, 201, -98, -98, -98, -98, -98, -98, 117, - -98, -98, 6, -98, -98, -98, -98, -98, -98, -98, - 37, 118, 114, 150, 146, -98, -98, 141, 138, 53, - -98, -98, -98, -98, 43, 78, -98, -7, 91, -98, - 88, -98, -98, -98, -98, -98, -98, -98, -98, 94, - 95, -98, -98, -98, -98, -98, -98, -98, 103, 99, - 100, -98, -98, -98, -98, -98, -51, -98, -98, 180, + -98, -98, -98, -98, -98, 31, 17, -98, -98, -98, + -98, -98, -98, -98, -98, -98, -98, -98, -98, 67, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, + -98, 63, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, + -98, -98, -98, -98, -45, -98, -98, -98, -98, -98, + -98, -98, -98, -98, -98, -98, 186, -98, -98, -98, + -98, -98, 113, -98, -98, -11, -98, -98, -98, -98, + -98, -98, -98, 43, 116, 112, 134, 147, -98, -98, + 153, 152, 42, -98, -98, -98, -98, 37, 87, -98, + -15, 90, 84, -98, -98, -98, -98, -98, -98, -98, + 78, 94, -98, -98, -98, -98, -98, -98, -98, 103, + 102, 96, -98, -98, -98, -98, -98, -49, -98, -98, + 253, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, - -5, -98, -8, -98, -98, -9, -98, -98, -98, 96, - -98, 136, 124, 129, 133, -98, 132, 122, 38, 39, - 58, 56, -98, 62, 36, 55, -98, -98, -98, -98, - -98, -98, -98, -98, -98, -98, -98, 57, -98, 64, - -98, 12, 29, 25, -98, -98, -98, -98, 23, -98, - -98, -98, -98, -98, 8, -98, -98, -98, -98, -98, - 44, -98, -98, -98, -98, -98, -98, -98, -98, -98, - -98, -98, -98, -98, 68, -98, 65, 60, -98, -98, - -17, -98, 54, 41, 119, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, - -98, -98, -98, -98, -98, -98, -1, -98, -98, -98, - -98, 70, -98, -98, -98, -98, -98, -98, -98, -98, - -98, -98, -98, -98, -98, -98, 196, -98, 185, 174, - 168, 186, -98, 79, 72, 71, 106, 107, -98, -98, - -98, -98, -98, -98, -98, -98, 167, -98, 153, -98, - 155, -98, -98, 165, -98, 128, -98, -98, 63, -98, - 26, -98, 24, -98, 27, -98, 154, -98, 145, 166, - -98, -98, 178, -98, -98, -98, -98, -98, -98, 189, - -98, -52, 85, -98, -98, 110, -98, 17, -98, 19, - -98, 22, -98, -98, 21, -98, 18, -98, 13, -98, - 47, -98, -98, 51, -98, -98, -98, -98, -98, 83, - 45, -98, -98, -98, -98, -98, 92, -98, -98, 34, - -98, -98, -98, 40, -98, -34, 121, -98, 149, -98, - -98, -98, -98, -98, -98, 230, -98, -98, -98, -98, - -98, -6, -98, -98, -98, -98, -98, -84, -98, 7, - -98, -63, -98, -98, -98, -98, -54, -98, -98, -64, - -98, -98, -98, -98, -98, -98, -77, -98, -98, -37, - -98, -98, -98, -42, -98, -98, -98, -98, 10, -98, - 5, -98, -3, -98, -10, -98, -98, -98, -14, -98, - -11, -98, -19, -98, -98, -98, -98, -98, -98, -98, + -98, 1, -98, -17, -98, -98, -7, -98, -98, -98, + 133, -98, 119, 123, 130, 132, -98, 121, 34, 46, + 33, 61, 59, -98, 68, 48, 40, -98, -98, -98, + -98, -98, -98, -98, -98, -98, -98, -98, 57, -98, + 55, -98, 28, 32, 22, -98, -98, -98, -98, 25, + -98, -98, -98, -98, -98, 8, -98, -98, -98, -98, + -98, 7, -98, -98, -98, -98, -98, -98, -98, -98, + -98, -98, -98, -98, -98, 60, -98, 54, -18, -98, + -98, -10, -98, 117, -8, 131, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, - -98, 28, -98, -98, -16, -98, -98, 49, -98, -98, - 42, -98, -98, -98, -98, 52, 50, -98, 46, -98, - -98, 20, 35, -98, 16, -98, -98, -98, -98, 73, - -98, -98, 32, -98, 31, 151, -98, -98, -98, -98}; + -98, -98, -98, -98, -98, -98, -98, 5, -98, -98, + -98, -98, 62, -98, -98, -98, -98, -98, -98, -98, + -98, -98, -98, -98, -98, -98, -98, 188, -98, 198, + 185, 179, 189, -98, 83, 77, 80, 95, 106, -98, + -98, -98, -98, -98, -98, -98, -98, 170, -98, 160, + -98, 158, -98, -98, 177, -98, 98, -98, -98, 120, + -98, 26, -98, 27, -98, 29, -98, 157, -98, 156, + 159, -98, -98, 169, -98, -98, -98, -98, -98, -98, + 195, -98, -52, 126, -98, -98, 127, -98, 18, -98, + 20, -98, 23, -98, -98, 24, -98, 21, -98, 19, + -98, 47, -98, -98, 50, -98, -98, -98, -98, -98, + 91, 52, -98, -98, -98, -98, -98, 79, -98, -98, + 36, -98, -98, -98, 44, -98, -34, 135, -98, 146, + -98, -98, -98, -98, -98, -98, 128, -98, -98, -98, + -98, -98, 75, -98, -98, -98, -98, -98, -80, -98, + 6, -98, -65, -98, -98, -98, -98, -57, -98, -98, + -58, -98, -98, -98, -98, -98, -98, -69, -98, -98, + -42, -98, -98, -98, -46, -98, -98, -98, -98, 10, + -98, 12, -98, -1, -98, -5, -98, -98, -98, -19, + -98, -13, -98, -12, -98, -98, -98, -98, -98, -98, + -98, -98, -98, -98, -98, -98, -98, 92, -98, -98, + 66, -98, -98, -98, -98, 45, 38, -98, 41, -98, + -98, 53, 49, -98, 51, -98, -98, -98, -98, 58, + -98, -98, 35, -98, 16, 166, -98, -98, -98, -98, + -98, -98, -98, -98, -98, 30, -98, -98, -38, -98, + -98}; const int JavaScriptGrammar::action_info [] = { - 23, 325, 128, 336, 316, 177, 342, 296, 415, 336, - 318, 435, 316, 129, 131, 318, 344, 459, 207, 209, - 170, 27, 330, 25, 296, 172, 328, 443, 218, 465, - 244, 344, -75, 411, -53, 349, 426, -54, -72, 366, - 419, -77, 419, 407, 419, 435, 452, 448, -224, -52, - 357, 281, 355, 26, -64, 442, 439, 435, 441, 320, - 425, 370, 179, 359, 3, 495, 244, -223, 259, 126, - 250, 402, 179, 494, 209, 7, 224, 20, 476, 8, - 3, 435, 411, 487, 19, 493, 519, 24, 125, 448, - 452, 207, 459, 487, 504, 229, 476, 364, 281, 23, - 481, 363, 366, 351, 364, 20, 125, 218, 429, 218, - 276, 218, 226, -292, 438, 218, 422, 218, 512, 364, - 116, 459, 459, 218, 218, 460, 499, 498, 439, 109, - 487, 117, 338, 109, 509, 499, 339, 280, 279, 175, - 110, 218, 504, 504, 110, 487, 218, 275, 487, 10, - 9, 218, 272, 271, 218, 509, 352, 265, 264, 278, - 118, 423, 0, 368, 262, 219, 0, 361, 109, 109, - 252, 410, 409, 461, 246, 193, 469, 194, 247, 110, - 110, 118, 510, 270, 269, 13, 272, 271, 195, 253, - 484, 254, 14, 450, 0, 252, 263, 261, 334, 257, - 193, 267, 194, 518, 118, 119, 454, 262, 193, 0, - 194, 120, 0, 195, 253, 193, 405, 194, 267, 0, - 218, 195, 193, 193, 194, 194, 119, 218, 195, 193, - 13, 194, 120, 268, 266, 195, 195, 14, 0, 263, - 261, 218, 195, 485, 483, 0, 193, 15, 194, 119, - 268, 266, 193, 0, 194, 120, 193, 0, 194, 195, - 193, 193, 194, 194, 193, 195, 194, 0, 13, 195, - 181, 182, 413, 195, 195, 14, 13, 195, 298, 299, - 433, 432, 0, 14, 298, 299, 181, 182, 0, 0, - 303, 304, 15, 0, 228, 227, 0, 183, 184, 305, - 211, 489, 306, 0, 307, 300, 301, 0, 0, 491, - 0, 300, 301, 183, 184, 186, 187, 0, 0, 212, - 0, 213, 0, 188, 189, 186, 187, 190, 0, 191, - 15, 0, 0, 188, 189, 186, 187, 190, 15, 191, - 0, 0, 0, 188, 189, 186, 187, 190, 0, 191, - 0, 0, 231, 188, 189, 186, 187, 190, 0, 191, - 0, 0, 232, 188, 189, 0, 233, 190, 0, 191, - 231, 0, 0, 303, 304, 234, 0, 235, 0, 0, - 232, 0, 305, 0, 233, 306, 0, 307, 236, 0, - 237, 116, 0, 234, 0, 235, 0, 0, 238, 0, - 0, 239, 117, 0, 0, 0, 236, 240, 237, 116, - 0, 70, 71, 241, 0, 0, 238, 0, 0, 239, - 117, 113, 0, 0, 0, 240, 242, 0, 114, 0, - 0, 241, 115, 79, 0, 80, 0, 0, 70, 71, - 0, 0, 83, 0, 242, 0, 86, 0, 113, 0, - 0, 0, 0, 0, 0, 114, 0, 0, 0, 115, - 79, 0, 80, 0, 91, 0, 93, 0, 0, 83, - 0, 0, 0, 86, 0, 0, 0, 85, 96, 73, + 329, 210, 319, 219, 208, 129, 444, 343, 350, 337, + 317, 27, 436, 466, 326, 180, 321, 27, 319, 24, + 317, 337, 420, 460, 28, 345, 31, 331, 29, 132, + 30, 420, 360, 230, 412, 426, -78, 176, -224, 403, + -65, -76, -54, 427, -55, -53, 282, -73, 367, 420, + 345, 443, 408, 436, 442, 297, 436, 371, 416, 440, + 127, -225, 358, 24, 356, 251, 3, 449, 485, 8, + 7, 260, 180, 210, 484, 23, 130, 225, 453, 3, + 477, 483, 509, 477, 412, 494, 510, 449, 436, 126, + 515, 171, 0, 173, 510, 453, 364, 208, 460, 365, + 367, 499, 276, 126, 277, 219, 352, 488, 282, 502, + -293, 460, 430, 219, 219, 489, 499, 489, 178, 117, + 219, 439, 227, 423, 460, 365, 365, 281, 280, 339, + 118, 219, 494, 340, 219, 440, 10, 9, 219, 271, + 270, 461, 245, 273, 272, 494, 247, 266, 265, 500, + 248, 477, 477, 220, 110, 411, 410, 219, 219, 353, + 273, 272, 110, 219, 508, 111, 369, 110, 424, 219, + 263, 0, 362, 111, 110, 253, 0, 0, 111, 194, + 119, 195, 258, 470, 194, 111, 195, 253, 477, 462, + 455, 194, 196, 195, 254, 518, 406, 196, 194, 194, + 195, 195, 264, 262, 196, 268, 254, 119, 255, 279, + 414, 196, 196, 194, 212, 195, 194, 194, 195, 195, + 119, 451, 219, 263, 0, 120, 196, 268, 219, 196, + 196, 121, 194, 213, 195, 214, 219, 269, 267, 0, + 194, 194, 195, 195, 194, 196, 195, 0, 519, 517, + 182, 183, 120, 196, 196, 264, 262, 196, 121, 269, + 267, 0, 0, 14, 0, 120, 299, 300, 182, 183, + 15, 121, 299, 300, 14, 434, 433, 184, 185, 0, + 335, 15, 0, 0, 0, 0, 0, 0, 0, 229, + 228, 0, 0, 301, 302, 184, 185, 304, 305, 301, + 302, 0, 0, 304, 305, 0, 306, 14, 194, 307, + 195, 308, 306, 17, 15, 307, 0, 308, 187, 188, + 0, 196, 13, 0, 17, 16, 189, 190, 0, 0, + 191, 14, 192, 13, 187, 188, 16, 0, 15, 0, + 479, 0, 189, 190, 187, 188, 191, 0, 192, 0, + 0, 0, 189, 190, 0, 0, 191, 17, 192, 0, + 0, 0, 0, 0, 481, 0, 13, 73, 74, 16, + 0, 304, 305, 0, 0, 0, 0, 114, 0, 0, + 306, 17, 0, 307, 115, 308, 73, 74, 116, 82, + 13, 83, 0, 16, 0, 0, 114, 0, 86, 0, + 0, 0, 89, 115, 0, 0, 0, 116, 82, 0, + 83, 0, 0, 0, 0, 0, 0, 86, 0, 0, + 94, 89, 96, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 232, 88, 99, 76, 187, 188, 0, 94, + 0, 96, 233, 0, 189, 190, 234, 0, 191, 0, + 192, 0, 88, 99, 76, 235, 0, 236, 0, 0, + 333, 0, 0, 0, 0, 0, 0, 0, 237, 0, + 238, 117, 0, 0, 0, 0, 0, 0, 239, 0, + 0, 240, 118, 0, 0, 0, 0, 241, 0, 0, + 0, 0, 0, 242, 0, 0, 0, 0, 0, 0, + 0, 232, 0, 0, 0, 0, 243, 0, 0, 0, + 0, 233, 0, 0, 0, 234, 0, 0, 0, 0, + 0, 0, 0, 0, 235, 0, 236, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 237, 0, 238, + 117, 0, 0, 0, 0, 0, 0, 239, 0, 0, + 240, 118, 0, 0, 0, 0, 241, 0, 0, 0, + 0, 0, 242, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 243, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 72, 73, 74, 0, + 0, 0, 0, 0, 0, 0, 0, 114, 0, 0, + 0, 0, 0, 0, 115, 0, 0, 0, 116, 82, + 0, 83, 0, 0, 0, 84, 0, 85, 86, 87, + 0, 0, 89, 0, 0, 0, 90, 0, 91, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 91, 0, 93, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 85, 96, 73, 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, 69, - 70, 71, 0, 0, 0, 0, 0, 0, 0, 0, - 113, 0, 0, 0, 0, 0, 0, 114, 0, 0, - 0, 115, 79, 0, 80, 0, 0, 0, 81, 0, - 82, 83, 84, 0, 0, 86, 0, 0, 0, 87, - 0, 88, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 91, 0, 93, 0, 95, 0, 98, - 0, 100, 0, 0, 0, 0, 85, 96, 73, 0, - 0, 0, 0, 0, 0, 0, -73, 0, 0, 0, - 69, 70, 71, 0, 0, 0, 0, 0, 0, 0, - 0, 113, 0, 0, 0, 0, 0, 0, 114, 0, - 0, 0, 115, 79, 0, 80, 0, 0, 0, 81, - 0, 82, 83, 84, 0, 0, 86, 0, 0, 0, - 87, 0, 88, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 91, 0, 93, 0, 95, 0, - 98, 0, 100, 0, 0, 0, 0, 85, 96, 73, - 0, 0, 0, 0, 0, 0, 0, 69, 70, 71, - 0, 0, 0, 0, 0, 0, 0, 0, 113, 0, - 0, 0, 0, 0, 0, 114, 0, 0, 0, 115, - 79, 0, 80, 0, 0, 0, 81, 0, 82, 83, - 84, 0, 0, 86, 0, 0, 0, 87, 0, 88, - 0, 0, 464, 0, 0, 0, 0, 0, 0, 0, - 0, 91, 0, 93, 0, 95, 0, 98, 0, 100, - 0, 0, 0, 0, 85, 96, 73, 0, 0, 0, - 0, 0, 0, 0, 69, 70, 71, 0, 0, 0, - 0, 0, 0, 0, 0, 113, 0, 0, 0, 0, - 0, 0, 114, 0, 0, 0, 115, 79, 0, 80, - 0, 0, 0, 81, 0, 82, 83, 84, 0, 0, - 86, 0, 0, 0, 87, 0, 88, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 91, 0, - 93, 0, 95, 0, 98, 295, 100, 0, 0, 0, - 0, 85, 96, 73, 0, 0, 0, 0, 0, 0, - 0, 69, 70, 71, 0, 0, 0, 0, 0, 0, - 0, 0, 113, 0, 0, 0, 0, 0, 0, 114, - 0, 0, 0, 115, 79, 0, 80, 0, 0, 0, - 81, 0, 82, 83, 84, 0, 0, 86, 0, 0, - 0, 87, 0, 88, 0, 0, 467, 0, 0, 0, - 0, 0, 0, 0, 0, 91, 0, 93, 0, 95, - 0, 98, 0, 100, 0, 0, 0, 0, 85, 96, - 73, 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, + 94, 0, 96, 0, 98, 0, 101, 0, 102, 0, + 0, 0, 0, 88, 99, 76, 0, 0, 0, 0, + 0, 0, 0, -74, 0, 0, 0, 72, 73, 74, + 0, 0, 0, 0, 0, 0, 0, 0, 114, 0, + 0, 0, 0, 0, 0, 115, 0, 0, 0, 116, + 82, 0, 83, 0, 0, 0, 84, 0, 85, 86, + 87, 0, 0, 89, 0, 0, 0, 90, 0, 91, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 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, - 65, 0, 0, 0, 0, 67, 0, 69, 70, 71, - 72, 0, 0, 0, 0, 0, 0, 74, 113, 0, - 0, 0, 0, 0, 0, 76, 77, 0, 0, 78, - 79, 0, 80, 0, 0, 0, 81, 0, 82, 83, - 84, 0, 0, 86, 0, 0, 0, 87, 0, 88, - 0, 0, 0, 0, 0, 89, 0, 90, 0, 0, - 0, 91, 92, 93, 94, 95, 97, 98, 99, 100, - 101, 102, 0, 0, 85, 96, 73, 66, 68, 0, - 0, 0, 0, 0, 65, 0, 0, 0, 0, 67, - 0, 69, 70, 71, 72, 0, 0, 0, 0, 0, - 0, 74, 75, 0, 0, 0, 0, 0, 0, 76, - 77, 0, 0, 78, 79, 0, 80, 0, 0, 0, - 81, 0, 82, 83, 84, 0, 0, 86, 0, 0, - 0, 87, 0, 88, 0, 0, 0, 0, 0, 89, - 0, 90, 0, 0, 0, 91, 92, 93, 94, 95, - 97, 98, 99, 100, 101, 102, 0, 0, 85, 96, - 73, 66, 68, 0, 0, 0, 0, 0, 65, 0, - 0, 0, 0, 67, 0, 69, 70, 71, 72, 0, - 0, 0, 0, 0, 0, 74, 113, 0, 0, 0, - 0, 0, 0, 514, 77, 0, 0, 78, 515, 0, - 80, 0, 0, 0, 81, 0, 82, 83, 84, 0, - 0, 86, 0, 0, 0, 87, 0, 88, 0, 0, - 0, 0, 0, 89, 0, 90, 0, 0, 0, 91, - 92, 93, 94, 95, 97, 98, 99, 100, 101, 102, - 0, 0, 85, 96, 73, 66, 68, 0, 0, 0, - 0, 0, 65, 0, 0, 0, 0, 67, 0, 69, - 70, 71, 72, 0, 0, 0, 0, 0, 0, 74, - 113, 0, 0, 0, 0, 0, 0, 501, 77, 0, - 0, 78, 502, 0, 80, 0, 0, 0, 81, 0, - 82, 83, 84, 0, 0, 86, 0, 0, 0, 87, - 0, 88, 0, 0, 0, 0, 0, 89, 0, 90, - 0, 0, 0, 91, 92, 93, 94, 95, 97, 98, - 99, 100, 101, 102, 0, 0, 85, 96, 73, 66, - 68, 0, 0, 0, 0, 0, 375, 137, 138, 0, - 0, 377, 142, 379, 70, 71, 380, 0, 145, 0, - 0, 0, 147, 382, 383, 0, 0, 0, 0, 0, - 0, 384, 385, 152, 153, 78, 79, 0, 80, 0, - 0, 0, 81, 0, 82, 386, 84, 0, 0, 388, - 0, 0, 0, 87, 0, 88, 0, -219, 0, 0, - 0, 389, 0, 90, 0, 0, 0, 390, 391, 392, - 393, 95, 395, 396, 397, 398, 399, 400, 0, 0, - 387, 394, 381, 376, 378, 157, 0, 0, 0, 0, + 0, 94, 0, 96, 0, 98, 0, 101, 0, 102, + 0, 0, 0, 0, 88, 99, 76, 0, 0, 0, + 0, 0, 0, 0, 72, 73, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 114, 0, 0, 0, 0, + 0, 0, 115, 0, 0, 0, 116, 82, 0, 83, + 0, 0, 0, 84, 0, 85, 86, 87, 0, 0, + 89, 0, 0, 0, 90, 0, 91, 0, 0, 465, + 0, 0, 0, 0, 0, 0, 0, 0, 94, 0, + 96, 0, 98, 0, 101, 0, 102, 0, 0, 0, + 0, 88, 99, 76, 0, 0, 0, 0, 0, 0, + 0, 72, 73, 74, 0, 0, 0, 0, 0, 0, + 0, 0, 114, 0, 0, 0, 0, 0, 0, 115, + 0, 0, 0, 116, 82, 0, 83, 0, 0, 0, + 84, 0, 85, 86, 87, 0, 0, 89, 0, 0, + 0, 90, 0, 91, 0, 0, 468, 0, 0, 0, + 0, 0, 0, 0, 0, 94, 0, 96, 0, 98, + 0, 101, 0, 102, 0, 0, 0, 0, 88, 99, + 76, 0, 0, 0, 0, 0, 0, 0, 72, 73, + 74, 0, 0, 0, 0, 0, 0, 0, 0, 114, + 0, 0, 0, 0, 0, 0, 115, 0, 0, 0, + 116, 82, 0, 83, 0, 0, 0, 84, 0, 85, + 86, 87, 0, 0, 89, 0, 0, 0, 90, 0, + 91, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 94, 0, 96, 0, 98, 0, 101, 296, + 102, 0, 0, 0, 0, 88, 99, 76, 0, 0, + 0, 0, 0, 0, 0, 137, 138, 139, 0, 0, + 141, 143, 144, 0, 0, 145, 0, 146, 0, 0, + 0, 148, 149, 150, 0, 0, 0, 0, 0, 0, + 217, 152, 153, 154, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 155, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 159, 0, 0, 0, 0, 0, 0, 161, 162, 163, + 0, 165, 166, 167, 168, 169, 170, 0, 0, 156, + 164, 147, 140, 142, 158, 0, 0, 0, 0, 137, + 138, 139, 0, 0, 141, 143, 144, 0, 0, 145, + 0, 146, 0, 0, 0, 148, 149, 150, 0, 0, + 0, 0, 0, 0, 151, 152, 153, 154, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 155, 0, + 0, 0, 157, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 159, 0, 0, 0, 0, 0, + 160, 161, 162, 163, 0, 165, 166, 167, 168, 169, + 170, 0, 0, 156, 164, 147, 140, 142, 158, 0, + 0, 0, 0, 137, 138, 139, 0, 0, 141, 143, + 144, 0, 0, 145, 0, 146, 0, 0, 0, 148, + 149, 150, 0, 0, 0, 0, 0, 0, 151, 152, + 153, 154, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 155, 0, 0, 0, 157, 0, 0, 0, + 0, 0, 0, 0, 175, 0, 0, 0, 159, 0, + 0, 0, 0, 0, 160, 161, 162, 163, 0, 165, + 166, 167, 168, 169, 170, 0, 0, 156, 164, 147, + 140, 142, 158, 0, 0, 0, 0, 69, 0, 0, + 0, 0, 70, 0, 72, 73, 74, 75, 0, 0, + 0, 0, 0, 0, 77, 114, 0, 0, 0, 0, + 0, 0, 79, 80, 0, 0, 81, 82, 0, 83, + 0, 0, 0, 84, 0, 85, 86, 87, 0, 0, + 89, 0, 0, 0, 90, 0, 91, 0, 0, 0, + 0, 0, 92, 0, 93, 0, 0, 0, 94, 95, + 96, 97, 98, 100, 101, 17, 102, 103, 104, 0, + 0, 88, 99, 76, 13, 71, 0, 0, 0, 0, + 0, 69, 0, 0, 0, 0, 70, 0, 72, 73, + 74, 75, 0, 0, 0, 0, 0, 0, 77, 78, + 0, 0, 0, 0, 0, 0, 79, 80, 0, 0, + 81, 82, 0, 83, 0, 0, 0, 84, 0, 85, + 86, 87, 0, 0, 89, 0, 0, 0, 90, 0, + 91, 0, 0, 0, 0, 0, 92, 0, 93, 0, + 0, 0, 94, 95, 96, 97, 98, 100, 101, 17, + 102, 103, 104, 0, 0, 88, 99, 76, 13, 71, + 0, 0, 0, 0, 0, 69, 0, 0, 0, 0, + 70, 0, 72, 73, 74, 75, 0, 0, 0, 0, + 0, 0, 77, 114, 0, 0, 0, 0, 0, 0, + 491, 80, 0, 0, 81, 492, 0, 83, 0, 0, + 0, 84, 0, 85, 86, 87, 0, 0, 89, 0, + 0, 0, 90, 0, 91, 0, 0, 0, 0, 0, + 92, 0, 93, 0, 0, 0, 94, 95, 96, 97, + 98, 100, 101, 17, 102, 103, 104, 0, 0, 88, + 99, 76, 13, 71, 0, 0, 0, 0, 0, 69, + 0, 0, 0, 0, 70, 0, 72, 73, 74, 75, + 0, 0, 0, 0, 0, 0, 77, 114, 0, 0, + 0, 0, 0, 0, 504, 80, 0, 0, 81, 505, + 0, 83, 0, 0, 0, 84, 0, 85, 86, 87, + 0, 0, 89, 0, 0, 0, 90, 0, 91, 0, + 0, 0, 0, 0, 92, 0, 93, 0, 0, 0, + 94, 95, 96, 97, 98, 100, 101, 17, 102, 103, + 104, 0, 0, 88, 99, 76, 13, 71, 0, 0, + 0, 0, 0, 376, 138, 139, 0, 0, 378, 143, + 380, 73, 74, 381, 0, 146, 0, 0, 0, 148, + 383, 384, 0, 0, 0, 0, 0, 0, 385, 386, + 153, 154, 81, 82, 0, 83, 0, 0, 0, 84, + 0, 85, 387, 87, 0, 0, 389, 0, 0, 0, + 90, 0, 91, 0, -220, 0, 0, 0, 390, 0, + 93, 0, 0, 0, 391, 392, 393, 394, 98, 396, + 397, 398, 399, 400, 401, 0, 0, 388, 395, 382, + 377, 379, 158, 0, 0, 0, 0, - 463, 455, 251, 420, 462, 466, 412, 230, 430, 453, - 176, 277, 440, 173, 171, 444, 451, 274, 427, 428, - 445, 424, 449, 434, 369, 508, 353, 225, 358, 503, - 367, 360, 365, 362, 215, 11, 333, 331, 335, 127, - 516, 217, 220, 513, 223, 507, 326, 482, 492, 468, - 434, 490, 431, 256, 492, 431, 274, 500, 371, 497, - 486, 0, 401, 243, 496, 326, 111, 0, 111, 111, - 197, 0, 0, 200, 201, 326, 215, 255, 63, 249, - 45, 511, 0, 507, 0, 111, 111, 111, 111, 198, - 0, 203, 111, 202, 111, 111, 196, 326, 111, 208, - 290, 111, 111, 0, 210, 294, 310, 309, 111, 111, - 475, 248, 245, 111, 308, 273, 403, 329, 111, 404, - 447, 111, 326, 446, 111, 111, 111, 112, 178, 111, - 111, 122, 123, 111, 180, 121, 111, 111, 223, 354, - 326, 311, 312, 0, 111, 258, 471, 111, 111, 273, - 470, 111, 111, 446, 111, 0, 0, 199, 517, 111, - 204, 507, 111, 111, 356, 205, 111, 192, 111, 206, - 474, 111, 185, 473, 403, 111, 111, 404, 472, 111, - 294, 447, 327, 111, 111, 322, 0, 0, 294, 294, - 294, 63, 340, 45, 319, 322, 322, 111, 111, 337, - 294, 294, 294, 294, 111, 314, 0, 321, 322, 294, - 317, 313, 63, 294, 45, 111, 111, 324, 341, 322, - 294, 294, 302, 315, 294, 0, 111, 0, 0, 0, - 343, 294, 0, 0, 0, 297, 0, 0, 0, 0, - 0, 350, 0, 0, 0, 0, 0, 0, 0, 223, - 0, 0, 0, 0, 0, 0, 406, 0, 0, 0, + 275, 467, 250, 463, 257, 174, 456, 421, 464, 231, + 252, 454, 445, 177, 431, 428, 446, 278, 429, 425, + 441, 172, 450, 452, 435, 506, 354, 244, 226, 359, + 370, 22, 361, 368, 363, 366, 11, 332, 520, 334, + 336, 128, 224, 435, 218, 221, 503, 487, 327, 432, + 516, 216, 490, 0, 327, 469, 432, 486, 372, 497, + 498, 402, 493, 275, 112, 112, 501, 0, 497, 202, + 200, 112, 482, 482, 67, 199, 49, 112, 0, 112, + 22, 22, 201, 198, 0, 112, 112, 413, 112, 0, + 112, 112, 112, 291, 480, 204, 211, 203, 295, 112, + 209, 249, 0, 197, 404, 246, 22, 405, 112, 112, + 327, 112, 113, 310, 112, 112, 311, 448, 112, 309, + 476, 112, 112, 447, 274, 112, 112, 112, 179, 124, + 0, 312, 327, 112, 112, 123, 122, 112, 327, 327, + 216, 256, 313, 112, 112, 472, 274, 112, 224, 471, + 112, 224, 112, 328, 112, 407, 186, 193, 259, 404, + 205, 112, 405, 112, 112, 0, 112, 206, 447, 207, + 0, 0, 181, 507, 0, 330, 497, 112, 112, 448, + 473, 355, 357, 112, 112, 475, 474, 112, 112, 323, + 323, 112, 295, 295, 295, 295, 295, 67, 0, 49, + 323, 112, 320, 338, 341, 295, 295, 0, 323, 0, + 112, 322, 342, 295, 318, 295, 112, 315, 0, 112, + 112, 295, 344, 314, 295, 295, 323, 316, 298, 112, + 325, 295, 0, 0, 295, 0, 303, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 351, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 67, 0, 49, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 261, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 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, 131, 0, 0, 0, 0, 0, + 0}; const int JavaScriptGrammar::action_check [] = { - 29, 61, 60, 2, 48, 55, 7, 1, 33, 2, - 76, 33, 48, 33, 55, 76, 29, 8, 48, 76, - 7, 33, 60, 29, 1, 8, 61, 60, 8, 8, - 2, 29, 7, 36, 7, 17, 7, 7, 7, 36, - 5, 7, 5, 60, 5, 33, 36, 36, 29, 7, - 60, 36, 61, 60, 7, 29, 20, 33, 36, 8, - 55, 16, 1, 31, 85, 7, 2, 29, 60, 36, - 7, 55, 1, 29, 76, 0, 8, 36, 29, 65, - 85, 33, 36, 33, 29, 29, 29, 8, 29, 36, - 36, 48, 8, 33, 29, 55, 29, 7, 36, 29, - 17, 29, 36, 8, 7, 36, 29, 8, 7, 8, - 36, 8, 60, 36, 6, 8, 10, 8, 7, 7, - 42, 8, 8, 8, 8, 8, 15, 7, 20, 40, - 33, 53, 50, 40, 8, 15, 54, 61, 62, 7, - 51, 8, 29, 29, 51, 33, 8, 74, 33, 61, - 62, 8, 61, 62, 8, 8, 61, 61, 62, 60, - 12, 55, -1, 60, 29, 56, -1, 60, 40, 40, - 15, 61, 62, 56, 50, 25, 60, 27, 54, 51, - 51, 12, 56, 61, 62, 22, 61, 62, 38, 34, - 8, 36, 29, 60, -1, 15, 61, 62, 60, 56, - 25, 29, 27, 56, 12, 57, 60, 29, 25, -1, - 27, 63, -1, 38, 34, 25, 36, 27, 29, -1, - 8, 38, 25, 25, 27, 27, 57, 8, 38, 25, - 22, 27, 63, 61, 62, 38, 38, 29, -1, 61, - 62, 8, 38, 61, 62, -1, 25, 84, 27, 57, - 61, 62, 25, -1, 27, 63, 25, -1, 27, 38, - 25, 25, 27, 27, 25, 38, 27, -1, 22, 38, - 18, 19, 60, 38, 38, 29, 22, 38, 18, 19, - 61, 62, -1, 29, 18, 19, 18, 19, -1, -1, - 23, 24, 84, -1, 61, 62, -1, 45, 46, 32, - 15, 55, 35, -1, 37, 45, 46, -1, -1, 55, - -1, 45, 46, 45, 46, 23, 24, -1, -1, 34, - -1, 36, -1, 31, 32, 23, 24, 35, -1, 37, - 84, -1, -1, 31, 32, 23, 24, 35, 84, 37, - -1, -1, -1, 31, 32, 23, 24, 35, -1, 37, - -1, -1, 3, 31, 32, 23, 24, 35, -1, 37, - -1, -1, 13, 31, 32, -1, 17, 35, -1, 37, - 3, -1, -1, 23, 24, 26, -1, 28, -1, -1, - 13, -1, 32, -1, 17, 35, -1, 37, 39, -1, - 41, 42, -1, 26, -1, 28, -1, -1, 49, -1, - -1, 52, 53, -1, -1, -1, 39, 58, 41, 42, - -1, 12, 13, 64, -1, -1, 49, -1, -1, 52, - 53, 22, -1, -1, -1, 58, 77, -1, 29, -1, - -1, 64, 33, 34, -1, 36, -1, -1, 12, 13, - -1, -1, 43, -1, 77, -1, 47, -1, 22, -1, - -1, -1, -1, -1, -1, 29, -1, -1, -1, 33, - 34, -1, 36, -1, 65, -1, 67, -1, -1, 43, - -1, -1, -1, 47, -1, -1, -1, 78, 79, 80, + 61, 76, 76, 8, 48, 60, 60, 7, 17, 2, + 48, 29, 33, 8, 61, 1, 8, 29, 76, 36, + 48, 2, 5, 8, 8, 29, 33, 60, 29, 55, + 60, 5, 31, 55, 36, 55, 7, 7, 29, 55, + 7, 7, 7, 7, 7, 7, 36, 7, 36, 5, + 29, 29, 60, 33, 36, 1, 33, 16, 33, 20, + 36, 29, 60, 36, 61, 7, 85, 36, 7, 65, + 0, 60, 1, 76, 29, 29, 33, 8, 36, 85, + 33, 29, 29, 33, 36, 29, 29, 36, 33, 29, + 17, 7, -1, 8, 29, 36, 29, 48, 8, 7, + 36, 8, 74, 29, 36, 8, 8, 7, 36, 7, + 36, 8, 7, 8, 8, 15, 8, 15, 55, 42, + 8, 6, 60, 10, 8, 7, 7, 61, 62, 50, + 53, 8, 29, 54, 8, 20, 61, 62, 8, 61, + 62, 8, 2, 61, 62, 29, 50, 61, 62, 56, + 54, 33, 33, 56, 40, 61, 62, 8, 8, 61, + 61, 62, 40, 8, 56, 51, 60, 40, 55, 8, + 29, -1, 60, 51, 40, 15, -1, -1, 51, 25, + 12, 27, 56, 60, 25, 51, 27, 15, 33, 56, + 60, 25, 38, 27, 34, 8, 36, 38, 25, 25, + 27, 27, 61, 62, 38, 29, 34, 12, 36, 60, + 60, 38, 38, 25, 15, 27, 25, 25, 27, 27, + 12, 60, 8, 29, -1, 57, 38, 29, 8, 38, + 38, 63, 25, 34, 27, 36, 8, 61, 62, -1, + 25, 25, 27, 27, 25, 38, 27, -1, 61, 62, + 18, 19, 57, 38, 38, 61, 62, 38, 63, 61, + 62, -1, -1, 22, -1, 57, 18, 19, 18, 19, + 29, 63, 18, 19, 22, 61, 62, 45, 46, -1, + 60, 29, -1, -1, -1, -1, -1, -1, -1, 61, + 62, -1, -1, 45, 46, 45, 46, 23, 24, 45, + 46, -1, -1, 23, 24, -1, 32, 22, 25, 35, + 27, 37, 32, 72, 29, 35, -1, 37, 23, 24, + -1, 38, 81, -1, 72, 84, 31, 32, -1, -1, + 35, 22, 37, 81, 23, 24, 84, -1, 29, -1, + 55, -1, 31, 32, 23, 24, 35, -1, 37, -1, + -1, -1, 31, 32, -1, -1, 35, 72, 37, -1, + -1, -1, -1, -1, 55, -1, 81, 12, 13, 84, + -1, 23, 24, -1, -1, -1, -1, 22, -1, -1, + 32, 72, -1, 35, 29, 37, 12, 13, 33, 34, + 81, 36, -1, 84, -1, -1, 22, -1, 43, -1, + -1, -1, 47, 29, -1, -1, -1, 33, 34, -1, + 36, -1, -1, -1, -1, -1, -1, 43, -1, -1, + 65, 47, 67, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 3, 78, 79, 80, 23, 24, -1, 65, + -1, 67, 13, -1, 31, 32, 17, -1, 35, -1, + 37, -1, 78, 79, 80, 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, 3, -1, -1, -1, -1, 77, -1, -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, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 65, -1, 67, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 78, 79, 80, -1, -1, -1, - -1, -1, -1, -1, 3, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 13, -1, -1, -1, 17, -1, - -1, -1, -1, -1, -1, -1, -1, 26, -1, 28, - -1, -1, 31, -1, -1, -1, -1, -1, -1, -1, - 39, -1, 41, 42, -1, -1, -1, -1, -1, -1, - 49, -1, -1, 52, 53, -1, -1, -1, -1, 58, - -1, -1, -1, -1, -1, 64, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 77, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 11, - 12, 13, -1, -1, -1, -1, -1, -1, -1, -1, - 22, -1, -1, -1, -1, -1, -1, 29, -1, -1, - -1, 33, 34, -1, 36, -1, -1, -1, 40, -1, - 42, 43, 44, -1, -1, 47, -1, -1, -1, 51, - -1, 53, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 65, -1, 67, -1, 69, -1, 71, - -1, 73, -1, -1, -1, -1, 78, 79, 80, -1, - -1, -1, -1, -1, -1, -1, 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, + 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, 56, -1, -1, -1, -1, -1, -1, -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, 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, + 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, 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, @@ -550,106 +546,117 @@ 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, 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, + 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, 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, - -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, + 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, - 19, 11, 19, 87, 15, 19, 12, 53, 72, 12, - 19, 12, 89, 21, 19, 57, 11, 11, 72, 12, - 57, 84, 12, 57, 11, 9, 78, 19, 11, 9, - 12, 12, 11, 11, 22, 5, 12, 11, 11, 90, - 9, 12, 19, 11, 19, 10, 12, 19, 6, 12, - 57, 2, 12, 12, 6, 12, 11, 11, 11, 9, - 76, -1, 11, 19, 12, 12, 30, -1, 30, 30, - 34, -1, -1, 35, 35, 12, 22, 23, 11, 19, - 13, 8, -1, 10, -1, 30, 30, 30, 30, 34, - -1, 35, 30, 35, 30, 30, 34, 12, 30, 42, - 30, 30, 30, -1, 40, 35, 35, 35, 30, 30, - 32, 46, 44, 30, 35, 32, 24, 54, 30, 27, - 32, 30, 12, 32, 30, 30, 30, 33, 33, 30, - 30, 32, 32, 30, 38, 32, 30, 30, 19, 54, - 12, 35, 35, -1, 30, 26, 32, 30, 30, 32, - 32, 30, 30, 32, 30, -1, -1, 35, 7, 30, - 36, 10, 30, 30, 54, 36, 30, 35, 30, 36, - 32, 30, 36, 32, 24, 30, 30, 27, 32, 30, - 35, 32, 54, 30, 30, 30, -1, -1, 35, 35, - 35, 11, 47, 13, 41, 30, 30, 30, 30, 45, - 35, 35, 35, 35, 30, 37, -1, 52, 30, 35, - 43, 37, 11, 35, 13, 30, 30, 52, 52, 30, - 35, 35, 37, 37, 35, -1, 30, -1, -1, -1, - 52, 35, -1, -1, -1, 39, -1, -1, -1, -1, - -1, 52, -1, -1, -1, -1, -1, -1, -1, 19, - -1, -1, -1, -1, -1, -1, 26, -1, -1, -1, + 11, 20, 20, 16, 12, 22, 11, 87, 20, 54, + 20, 12, 58, 20, 72, 72, 58, 12, 12, 84, + 89, 20, 12, 11, 58, 9, 78, 20, 20, 11, + 11, 14, 12, 12, 11, 11, 5, 11, 76, 12, + 11, 90, 20, 58, 12, 20, 11, 9, 12, 12, + 20, 23, 11, -1, 12, 12, 12, 12, 11, 10, + 9, 11, 9, 11, 31, 31, 8, -1, 10, 36, + 36, 31, 6, 6, 11, 35, 13, 31, -1, 31, + 14, 14, 36, 35, -1, 31, 31, 12, 31, -1, + 31, 31, 31, 31, 2, 36, 41, 36, 36, 31, + 43, 47, -1, 35, 25, 45, 14, 28, 31, 31, + 12, 31, 34, 36, 31, 31, 36, 33, 31, 36, + 33, 31, 31, 33, 33, 31, 31, 31, 34, 33, + -1, 36, 12, 31, 31, 33, 33, 31, 12, 12, + 23, 24, 36, 31, 31, 33, 33, 31, 20, 33, + 31, 20, 31, 55, 31, 27, 37, 36, 27, 25, + 37, 31, 28, 31, 31, -1, 31, 37, 33, 37, + -1, -1, 39, 7, -1, 55, 10, 31, 31, 33, + 33, 55, 55, 31, 31, 33, 33, 31, 31, 31, + 31, 31, 36, 36, 36, 36, 36, 11, -1, 13, + 31, 31, 42, 46, 48, 36, 36, -1, 31, -1, + 31, 53, 53, 36, 44, 36, 31, 38, -1, 31, + 31, 36, 53, 38, 36, 36, 31, 38, 40, 31, + 53, 36, -1, -1, 36, -1, 38, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 53, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 11, -1, 13, -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, 91, -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, 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, 91, -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 3d52a9e..aac4c7e 100644 --- a/src/declarative/qml/parser/javascriptgrammar_p.h +++ b/src/declarative/qml/parser/javascriptgrammar_p.h @@ -96,14 +96,14 @@ public: T_XOR_EQ = 77, ACCEPT_STATE = 7, - RULE_COUNT = 296, - STATE_COUNT = 520, + RULE_COUNT = 297, + STATE_COUNT = 521, TERMINAL_COUNT = 88, NON_TERMINAL_COUNT = 98, - GOTO_INDEX_OFFSET = 520, - GOTO_INFO_OFFSET = 1660, - GOTO_CHECK_OFFSET = 1660 + GOTO_INDEX_OFFSET = 521, + GOTO_INFO_OFFSET = 1647, + GOTO_CHECK_OFFSET = 1647 }; static const char *const spell []; diff --git a/src/declarative/qml/parser/javascriptparser.cpp b/src/declarative/qml/parser/javascriptparser.cpp index 11d7e4b..af55b27 100644 --- a/src/declarative/qml/parser/javascriptparser.cpp +++ b/src/declarative/qml/parser/javascriptparser.cpp @@ -284,62 +284,69 @@ case 24: { sym(1).Node = node; } break; +case 25: { + sym(1).Node = makeAstNode(driver->nodePool(), sym(1).Statement); +} break; case 26: { + sym(1).Node = makeAstNode(driver->nodePool(), sym(1).Statement); +} break; + +case 27: { AST::UiQualifiedId *node = makeAstNode (driver->nodePool(), sym(1).sval); node->identifierToken = loc(1); sym(1).Node = node; } break; -case 27: { +case 28: { AST::UiQualifiedId *node = makeAstNode (driver->nodePool(), sym(1).UiQualifiedId, sym(3).sval); node->identifierToken = loc(3); sym(1).Node = node; } break; -case 28: { +case 29: { AST::ThisExpression *node = makeAstNode (driver->nodePool()); node->thisToken = loc(1); sym(1).Node = node; } break; -case 29: { +case 30: { AST::IdentifierExpression *node = makeAstNode (driver->nodePool(), sym(1).sval); node->identifierToken = loc(1); sym(1).Node = node; } break; -case 30: { +case 31: { AST::NullExpression *node = makeAstNode (driver->nodePool()); node->nullToken = loc(1); sym(1).Node = node; } break; -case 31: { +case 32: { AST::TrueLiteral *node = makeAstNode (driver->nodePool()); node->trueToken = loc(1); sym(1).Node = node; } break; -case 32: { +case 33: { AST::FalseLiteral *node = makeAstNode (driver->nodePool()); node->falseToken = loc(1); sym(1).Node = node; } break; -case 33: { +case 34: { AST::NumericLiteral *node = makeAstNode (driver->nodePool(), sym(1).dval); node->literalToken = loc(1); sym(1).Node = node; } break; -case 34: { +case 35: { AST::StringLiteral *node = makeAstNode (driver->nodePool(), sym(1).sval); node->literalToken = loc(1); sym(1).Node = node; } break; -case 35: { +case 36: { bool rx = lexer->scanRegExp(Lexer::NoPrefix); if (!rx) { diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, lexer->startLineNo(), @@ -351,7 +358,7 @@ case 35: { sym(1).Node = node; } break; -case 36: { +case 37: { bool rx = lexer->scanRegExp(Lexer::EqualPrefix); if (!rx) { diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, lexer->startLineNo(), @@ -363,83 +370,81 @@ case 36: { sym(1).Node = node; } break; -case 37: { +case 38: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Elision); } break; -case 38: { +case 39: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).ElementList->finish ()); } break; -case 39: { +case 40: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).ElementList->finish (), sym(4).Elision); } break; -case 40: { +case 41: { if (sym(2).Node) sym(1).Node = makeAstNode (driver->nodePool(), sym(2).PropertyNameAndValueList->finish ()); else sym(1).Node = makeAstNode (driver->nodePool()); } break; -case 41: { +case 42: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).PropertyNameAndValueList->finish ()); } break; -case 42: { +case 43: { sym(1) = sym(2); } break; -case 43: { +case 44: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Elision, sym(2).Expression); } break; -case 44: { +case 45: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).ElementList, sym(3).Elision, sym(4).Expression); } break; -case 45: { +case 46: { sym(1).Node = makeAstNode (driver->nodePool()); } break; -case 46: { +case 47: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Elision); } break; -case 47: { +case 48: { sym(1).Node = 0; } break; -case 48: { +case 49: { sym(1).Elision = sym(1).Elision->finish (); } break; -case 49: { +case 50: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).PropertyName, sym(3).Expression); } break; -case 50: { +case 51: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).PropertyNameAndValueList, sym(3).PropertyName, sym(5).Expression); } break; -case 51: { +case 52: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).sval); } break; -case 52: { +case 53: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).sval); } break; -case 53: { +case 54: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).dval); } break; -case 54: { +case 55: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).sval); } break; -case 55: - case 56: case 57: @@ -499,22 +504,24 @@ case 83: case 84: case 85: + +case 86: { sym(1).sval = driver->intern(lexer->characterBuffer(), lexer->characterCount()); } break; -case 90: { +case 91: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression); } break; -case 91: { +case 92: { AST::FieldMemberExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).sval); node->dotToken = loc(2); node->identifierToken = loc(3); sym(1).Node = node; } break; -case 92: { +case 93: { AST::NewMemberExpression *node = makeAstNode (driver->nodePool(), sym(2).Expression, sym(4).ArgumentList); node->newToken = loc(1); node->lparenToken = loc(3); @@ -522,541 +529,541 @@ case 92: { sym(1).Node = node; } break; -case 94: { +case 95: { AST::NewExpression *node = makeAstNode (driver->nodePool(), sym(2).Expression); node->newToken = loc(1); sym(1).Node = node; } break; -case 95: { +case 96: { AST::CallExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).ArgumentList); node->lparenToken = loc(2); node->rparenToken = loc(4); sym(1).Node = node; } break; -case 96: { +case 97: { AST::CallExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).ArgumentList); node->lparenToken = loc(2); node->rparenToken = loc(4); sym(1).Node = node; } break; -case 97: { +case 98: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression); } break; -case 98: { +case 99: { AST::FieldMemberExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).sval); node->dotToken = loc(2); node->identifierToken = loc(3); sym(1).Node = node; } break; -case 99: { +case 100: { sym(1).Node = 0; } break; -case 100: { +case 101: { sym(1).Node = sym(1).ArgumentList->finish(); } break; -case 101: { +case 102: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression); } break; -case 102: { +case 103: { AST::ArgumentList *node = makeAstNode (driver->nodePool(), sym(1).ArgumentList, sym(3).Expression); node->commaToken = loc(2); sym(1).Node = node; } break; -case 106: { +case 107: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression); } break; -case 107: { +case 108: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression); } break; -case 109: { +case 110: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); } break; -case 110: { +case 111: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); } break; -case 111: { +case 112: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); } break; -case 112: { +case 113: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); } break; -case 113: { +case 114: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); } break; -case 114: { +case 115: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); } break; -case 115: { +case 116: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); } break; -case 116: { +case 117: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); } break; -case 117: { +case 118: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); } break; -case 119: { +case 120: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Mul, sym(3).Expression); } break; -case 120: { +case 121: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Div, sym(3).Expression); } break; -case 121: { +case 122: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Mod, sym(3).Expression); } break; -case 123: { +case 124: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Add, sym(3).Expression); } break; -case 124: { +case 125: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Sub, sym(3).Expression); } break; -case 126: { +case 127: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::LShift, sym(3).Expression); } break; -case 127: { +case 128: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::RShift, sym(3).Expression); } break; -case 128: { +case 129: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::URShift, sym(3).Expression); } break; -case 130: { +case 131: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Lt, sym(3).Expression); } break; -case 131: { +case 132: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Gt, sym(3).Expression); } break; -case 132: { +case 133: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Le, sym(3).Expression); } break; -case 133: { +case 134: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Ge, sym(3).Expression); } break; -case 134: { +case 135: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::InstanceOf, sym(3).Expression); } break; -case 135: { +case 136: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::In, sym(3).Expression); } break; -case 137: { +case 138: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Lt, sym(3).Expression); } break; -case 138: { +case 139: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Gt, sym(3).Expression); } break; -case 139: { +case 140: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Le, sym(3).Expression); } break; -case 140: { +case 141: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Ge, sym(3).Expression); } break; -case 141: { +case 142: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::InstanceOf, sym(3).Expression); } break; -case 143: { +case 144: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Equal, sym(3).Expression); } break; -case 144: { +case 145: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::NotEqual, sym(3).Expression); } break; -case 145: { +case 146: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::StrictEqual, sym(3).Expression); } break; -case 146: { +case 147: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::StrictNotEqual, sym(3).Expression); } break; -case 148: { +case 149: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Equal, sym(3).Expression); } break; -case 149: { +case 150: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::NotEqual, sym(3).Expression); } break; -case 150: { +case 151: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::StrictEqual, sym(3).Expression); } break; -case 151: { +case 152: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::StrictNotEqual, sym(3).Expression); } break; -case 153: { +case 154: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::BitAnd, sym(3).Expression); } break; -case 155: { +case 156: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::BitAnd, sym(3).Expression); } break; -case 157: { +case 158: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::BitXor, sym(3).Expression); } break; -case 159: { +case 160: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::BitXor, sym(3).Expression); } break; -case 161: { +case 162: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::BitOr, sym(3).Expression); } break; -case 163: { +case 164: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::BitOr, sym(3).Expression); } break; -case 165: { +case 166: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::And, sym(3).Expression); } break; -case 167: { +case 168: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::And, sym(3).Expression); } break; -case 169: { +case 170: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Or, sym(3).Expression); } break; -case 171: { +case 172: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Or, sym(3).Expression); } break; -case 173: { +case 174: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression, sym(5).Expression); } break; -case 175: { +case 176: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression, sym(5).Expression); } break; -case 177: { +case 178: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(2).ival, sym(3).Expression); } break; -case 179: { +case 180: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(2).ival, sym(3).Expression); } break; -case 180: { +case 181: { sym(1).ival = QSOperator::Assign; } break; -case 181: { +case 182: { sym(1).ival = QSOperator::InplaceMul; } break; -case 182: { +case 183: { sym(1).ival = QSOperator::InplaceDiv; } break; -case 183: { +case 184: { sym(1).ival = QSOperator::InplaceMod; } break; -case 184: { +case 185: { sym(1).ival = QSOperator::InplaceAdd; } break; -case 185: { +case 186: { sym(1).ival = QSOperator::InplaceSub; } break; -case 186: { +case 187: { sym(1).ival = QSOperator::InplaceLeftShift; } break; -case 187: { +case 188: { sym(1).ival = QSOperator::InplaceRightShift; } break; -case 188: { +case 189: { sym(1).ival = QSOperator::InplaceURightShift; } break; -case 189: { +case 190: { sym(1).ival = QSOperator::InplaceAnd; } break; -case 190: { +case 191: { sym(1).ival = QSOperator::InplaceXor; } break; -case 191: { +case 192: { sym(1).ival = QSOperator::InplaceOr; } break; -case 193: { +case 194: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression); } break; -case 194: { +case 195: { sym(1).Node = 0; } break; -case 197: { +case 198: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression); } break; -case 198: { +case 199: { sym(1).Node = 0; } break; -case 215: { +case 216: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).StatementList); } break; -case 216: { +case 217: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Statement); } break; -case 217: { +case 218: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).StatementList, sym(2).Statement); } break; -case 218: { +case 219: { sym(1).Node = 0; } break; -case 219: { +case 220: { sym(1).Node = sym(1).StatementList->finish (); } break; -case 221: { +case 222: { AST::VariableStatement *node = makeAstNode (driver->nodePool(), sym(2).VariableDeclarationList->finish (/*readOnly=*/sym(1).ival == T_CONST)); node->declarationKindToken = loc(1); node->semicolonToken = loc(3); sym(1).Node = node; } break; -case 222: { +case 223: { sym(1).ival = T_CONST; } break; -case 223: { +case 224: { sym(1).ival = T_VAR; } break; -case 224: { +case 225: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).VariableDeclaration); } break; -case 225: { +case 226: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).VariableDeclarationList, sym(3).VariableDeclaration); } break; -case 226: { +case 227: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).VariableDeclaration); } break; -case 227: { +case 228: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).VariableDeclarationList, sym(3).VariableDeclaration); } break; -case 228: { +case 229: { AST::VariableDeclaration *node = makeAstNode (driver->nodePool(), sym(1).sval, sym(2).Expression); node->identifierToken = loc(1); sym(1).Node = node; } break; -case 229: { +case 230: { AST::VariableDeclaration *node = makeAstNode (driver->nodePool(), sym(1).sval, sym(2).Expression); node->identifierToken = loc(1); sym(1).Node = node; } break; -case 230: { +case 231: { sym(1) = sym(2); } break; -case 231: { +case 232: { sym(1).Node = 0; } break; -case 233: { +case 234: { sym(1) = sym(2); } break; -case 234: { +case 235: { sym(1).Node = 0; } break; -case 236: { +case 237: { sym(1).Node = makeAstNode (driver->nodePool()); } break; -case 238: { +case 239: { AST::ExpressionStatement *node = makeAstNode (driver->nodePool(), sym(1).Expression); node->semicolonToken = loc(2); sym(1).Node = node; } break; -case 239: { +case 240: { sym(1).Node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Statement, sym(7).Statement); } break; -case 240: { +case 241: { sym(1).Node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Statement); } break; -case 242: { +case 243: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Statement, sym(5).Expression); } break; -case 243: { +case 244: { sym(1).Node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Statement); } break; -case 244: { +case 245: { sym(1).Node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Expression, sym(7).Expression, sym(9).Statement); } break; -case 245: { +case 246: { sym(1).Node = makeAstNode (driver->nodePool(), sym(4).VariableDeclarationList->finish (/*readOnly=*/false), sym(6).Expression, sym(8).Expression, sym(10).Statement); } break; -case 246: { +case 247: { sym(1).Node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Expression, sym(7).Statement); } break; -case 247: { +case 248: { sym(1).Node = makeAstNode (driver->nodePool(), sym(4).VariableDeclaration, sym(6).Expression, sym(8).Statement); } break; -case 249: { +case 250: { sym(1).Node = makeAstNode (driver->nodePool()); } break; -case 251: { +case 252: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).sval); } break; -case 253: { +case 254: { sym(1).Node = makeAstNode (driver->nodePool()); } break; -case 255: { +case 256: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).sval); } break; -case 257: { +case 258: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); } break; -case 258: { +case 259: { sym(1).Node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Statement); } break; -case 259: { +case 260: { sym(1).Node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).CaseBlock); } break; -case 260: { +case 261: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).CaseClauses); } break; -case 261: { +case 262: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).CaseClauses, sym(3).DefaultClause, sym(4).CaseClauses); } break; -case 262: { +case 263: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).CaseClause); } break; -case 263: { +case 264: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).CaseClauses, sym(2).CaseClause); } break; -case 264: { +case 265: { sym(1).Node = 0; } break; -case 265: { +case 266: { sym(1).Node = sym(1).CaseClauses->finish (); } break; -case 266: { +case 267: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression, sym(4).StatementList); } break; -case 267: { +case 268: { sym(1).Node = makeAstNode (driver->nodePool(), sym(3).StatementList); } break; -case 268: { +case 269: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).sval, sym(3).Statement); } break; -case 270: { +case 271: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); } break; -case 271: { +case 272: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Statement, sym(3).Catch); } break; -case 272: { +case 273: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Statement, sym(3).Finally); } break; -case 273: { +case 274: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Statement, sym(3).Catch, sym(4).Finally); } break; -case 274: { +case 275: { sym(1).Node = makeAstNode (driver->nodePool(), sym(3).sval, sym(5).Statement); } break; -case 275: { +case 276: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Statement); } break; -case 277: { +case 278: { sym(1).Node = makeAstNode (driver->nodePool()); } break; -case 278: { +case 279: { AST::FunctionDeclaration *node = makeAstNode (driver->nodePool(), sym(2).sval, sym(4).FormalParameterList, sym(7).FunctionBody); node->functionToken = loc(1); node->identifierToken = loc(2); @@ -1067,7 +1074,7 @@ case 278: { sym(1).Node = node; } break; -case 279: { +case 280: { AST::FunctionExpression *node = makeAstNode (driver->nodePool(), sym(2).sval, sym(4).FormalParameterList, sym(7).FunctionBody); node->functionToken = loc(1); if (sym(2).sval) @@ -1079,56 +1086,56 @@ case 279: { sym(1).Node = node; } break; -case 280: { +case 281: { AST::FormalParameterList *node = makeAstNode (driver->nodePool(), sym(1).sval); node->identifierToken = loc(1); sym(1).Node = node; } break; -case 281: { +case 282: { AST::FormalParameterList *node = makeAstNode (driver->nodePool(), sym(1).FormalParameterList, sym(3).sval); node->commaToken = loc(2); node->identifierToken = loc(3); sym(1).Node = node; } break; -case 282: { +case 283: { sym(1).Node = 0; } break; -case 283: { +case 284: { sym(1).Node = sym(1).FormalParameterList->finish (); } break; -case 284: { +case 285: { sym(1).Node = 0; } break; -case 286: { +case 287: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).SourceElements->finish ()); } break; -case 287: { +case 288: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).SourceElement); } break; -case 288: { +case 289: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).SourceElements, sym(2).SourceElement); } break; -case 289: { +case 290: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Statement); } break; -case 290: { +case 291: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).FunctionDeclaration); } break; -case 291: { +case 292: { sym(1).sval = 0; } break; -case 293: { +case 294: { sym(1).Node = 0; } break; diff --git a/src/declarative/qml/parser/javascriptparser_p.h b/src/declarative/qml/parser/javascriptparser_p.h index d31597b..ee9adf6 100644 --- a/src/declarative/qml/parser/javascriptparser_p.h +++ b/src/declarative/qml/parser/javascriptparser_p.h @@ -203,9 +203,9 @@ protected: }; -#define J_SCRIPT_REGEXPLITERAL_RULE1 35 +#define J_SCRIPT_REGEXPLITERAL_RULE1 36 -#define J_SCRIPT_REGEXPLITERAL_RULE2 36 +#define J_SCRIPT_REGEXPLITERAL_RULE2 37 QT_END_NAMESPACE -- cgit v0.12 From fa842094e4d596ed8c7f9839df179aa48a5a9c63 Mon Sep 17 00:00:00 2001 From: mae Date: Mon, 20 Apr 2009 18:39:21 +0200 Subject: parse function declarations in the object declaration and generate script properties. Makes the slider work. --- src/declarative/qml/qmlcompiler.cpp | 2 -- src/declarative/qml/qmlscriptparser.cpp | 21 +++++++++++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/declarative/qml/qmlcompiler.cpp b/src/declarative/qml/qmlcompiler.cpp index dd42581..e1a88bb 100644 --- a/src/declarative/qml/qmlcompiler.cpp +++ b/src/declarative/qml/qmlcompiler.cpp @@ -747,8 +747,6 @@ bool QmlCompiler::compileSignal(Property *prop, Object *obj) if(isBinding(script)) COMPILE_EXCEPTION("Cannot assign binding to signal property"); - qDebug() << "and here we go..."; - int idx = output->indexForString(script); int pr = output->indexForByteArray(prop->name); diff --git a/src/declarative/qml/qmlscriptparser.cpp b/src/declarative/qml/qmlscriptparser.cpp index ddd473a..a141fa4 100644 --- a/src/declarative/qml/qmlscriptparser.cpp +++ b/src/declarative/qml/qmlscriptparser.cpp @@ -77,6 +77,7 @@ protected: virtual bool visit(AST::UiScriptBinding *node); virtual bool visit(AST::UiArrayBinding *node); + virtual bool visit(AST::UiSourceElement *node); void accept(AST::Node *node); @@ -423,6 +424,26 @@ bool ProcessAST::visit(AST::UiArrayBinding *node) return false; } +bool ProcessAST::visit(AST::UiSourceElement *node) +{ + QString source; + QTextStream out(&source); + PrettyPretty pp(out); + + pp(node->sourceElement); + + Object *obj = defineObjectBinding(-1, // ### line + 0, + QLatin1String("Script")); + + Value *value = new Value; + value->primitive = source; + value->line = -1; // ### fix me + obj->getDefaultProperty()->addValue(value); + + return false; +} + } // end of anonymous namespace -- cgit v0.12 From fffc93d70d15bd5d92277e2978294645aeaa5e4d Mon Sep 17 00:00:00 2001 From: mae Date: Mon, 20 Apr 2009 20:21:13 +0200 Subject: make Connection work. --- src/declarative/qml/qmlscriptparser.cpp | 119 ++++++++++++++++++++++++++------ 1 file changed, 96 insertions(+), 23 deletions(-) diff --git a/src/declarative/qml/qmlscriptparser.cpp b/src/declarative/qml/qmlscriptparser.cpp index a141fa4..be01f37 100644 --- a/src/declarative/qml/qmlscriptparser.cpp +++ b/src/declarative/qml/qmlscriptparser.cpp @@ -184,29 +184,28 @@ Object *ProcessAST::defineObjectBinding(int line, v->object = obj; v->line = line; prop->addValue(v); - } - - while (propertyCount--) - _stateStack.pop(); + while (propertyCount--) + _stateStack.pop(); - if (! _parser->tree()) { - _parser->setTree(obj); - _stateStack.pushObject(obj); } else { - const State state = _stateStack.top(); - Value *v = new Value; - v->object = obj; - v->line = line; - if(state.property) - state.property->addValue(v); - else - state.object->getDefaultProperty()->addValue(v); - _stateStack.pushObject(obj); + + if (! _parser->tree()) { + _parser->setTree(obj); + } else { + const State state = _stateStack.top(); + Value *v = new Value; + v->object = obj; + v->line = line; + if(state.property) + state.property->addValue(v); + else + state.object->getDefaultProperty()->addValue(v); + } } + _stateStack.pushObject(obj); accept(initializer); - _stateStack.pop(); return obj; @@ -244,6 +243,19 @@ bool ProcessAST::visit(AST::UiPublicMember *node) _stateStack.pop(); // object _stateStack.pop(); // properties + } else if (type == QLatin1String("signal")) { + _stateStack.pushProperty(QLatin1String("signals"), node->publicToken.startLine); + + Object *obj = defineObjectBinding(node->identifierToken.startLine, + 0, + QLatin1String("Signal")); + + _stateStack.pushObject(obj); + + defineProperty(QLatin1String("name"), node->identifierToken.startLine, name); + + _stateStack.pop(); // object + _stateStack.pop(); // signals } else { qWarning() << "bad public identifier" << type; // ### FIXME } @@ -258,10 +270,72 @@ bool ProcessAST::visit(AST::UiPublicMember *node) // UiObjectMember: T_IDENTIFIER UiObjectInitializer ; bool ProcessAST::visit(AST::UiObjectDefinition *node) { - defineObjectBinding(node->identifierToken.startLine, - 0, - node->name->asString(), - node->initializer); + if (node->name->asString() == QLatin1String("Connection")) { + + AST::UiObjectMemberList *it = node->initializer->members; + int line = node->identifierToken.startLine; + + QString sender; + QString signal; + QString script; + + for (; it; it = it->next) { + if (it->member->kind != AST::Node::Kind_UiScriptBinding) + continue; // ### TODO generate error + AST::UiScriptBinding *scriptBinding = static_cast(it->member); + + QString s; + QTextStream out(&s); + PrettyPretty pp(out); + + QString propertyName = asString(scriptBinding->qualifiedId); + if (propertyName == QLatin1String("signal")) { + // ## TODO verify that this is a function call statement and nothing else. + if (scriptBinding->statement->kind == AST::Node::Kind_ExpressionStatement) { + AST::ExpressionStatement *stmt = static_cast(scriptBinding->statement); + pp(stmt->expression); + int dot = s.lastIndexOf(QLatin1Char('.')); + if (dot >= 0) { + sender = s.left(dot); + signal = s.mid(dot+1); + } else { + // ### TODO generate error + } + } else { + // ### TODO generate error + } + + } else if (propertyName == QLatin1String("onSignal")) { + if (scriptBinding->statement->kind == AST::Node::Kind_ExpressionStatement) { + AST::ExpressionStatement *stmt = static_cast(scriptBinding->statement); + script = getPrimitive("onSignal", stmt->expression); + } else { + pp(scriptBinding->statement); + script = s; + } + } else { + //### TODO generate error + } + } + Object *obj = defineObjectBinding(line, + 0, + QLatin1String("Connection")); + + _stateStack.pushObject(obj); + if (!sender.isEmpty()) + defineProperty(QLatin1String("sender"), line, QLatin1Char('{') + sender + QLatin1Char('}')); + if (!script.isEmpty()) + defineProperty(QLatin1String("script"), line, script); + if (!signal.isEmpty()) + defineProperty(QLatin1String("signal"), line, signal); + _stateStack.pop(); // object + } else { + + defineObjectBinding(node->identifierToken.startLine, + 0, + node->name->asString(), + node->initializer); + } return false; } @@ -303,8 +377,6 @@ bool ProcessAST::visit(AST::UiObjectBinding *node) // #### TODO generate error } - qDebug() << "SetProperty" << target << property << value; - Object *obj = defineObjectBinding(node->identifierToken.startLine, 0, QLatin1String("SetProperty")); @@ -450,6 +522,7 @@ bool ProcessAST::visit(AST::UiSourceElement *node) QmlScriptParser::QmlScriptParser() : root(0), _errorLine(-1) { + } QmlScriptParser::~QmlScriptParser() -- cgit v0.12 From c70d52a5927305b6edd77a47a3d582b4001b25f8 Mon Sep 17 00:00:00 2001 From: mae Date: Mon, 20 Apr 2009 21:18:08 +0200 Subject: optional property debug output when the environment variable DUI_DEBUG is defined. --- src/declarative/qml/qmlparser.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/declarative/qml/qmlparser.cpp b/src/declarative/qml/qmlparser.cpp index 9bcd53d..f019a8b 100644 --- a/src/declarative/qml/qmlparser.cpp +++ b/src/declarative/qml/qmlparser.cpp @@ -152,10 +152,12 @@ Object *QmlParser::Property::getValue() void QmlParser::Property::addValue(Value *v) { - if (v->object) - qDebug() << "Property" << name << "addValue Object(" << v->object->typeName << ")"; - else - qDebug() << "Property" << name << "addValue" << v->primitive; + if (::getenv("DUI_DEBUG")) { + if (v->object) + qDebug() << "Property" << name << "addValue Object(" << v->object->typeName << ")"; + else + qDebug() << "Property" << name << "addValue" << v->primitive; + } values << v; } -- cgit v0.12 From a0f45c904517016319338fb6eda53165f46f0f77 Mon Sep 17 00:00:00 2001 From: Roberto Raggi Date: Tue, 21 Apr 2009 10:39:56 +0200 Subject: Added the `import statements' to UiProgram. --- src/declarative/qml/parser/javascript.g | 3 ++- src/declarative/qml/parser/javascriptast_p.h | 5 +++-- src/declarative/qml/parser/javascriptparser.cpp | 3 ++- src/declarative/qml/qmlscriptparser.cpp | 9 +++++++++ 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/declarative/qml/parser/javascript.g b/src/declarative/qml/parser/javascript.g index baec64f..5ae7a16 100644 --- a/src/declarative/qml/parser/javascript.g +++ b/src/declarative/qml/parser/javascript.g @@ -468,7 +468,8 @@ bool JavaScriptParser::parse(JavaScriptEnginePrivate *driver) Program: UiImportListOpt UiObjectMemberList ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(2).UiObjectMemberList->finish()); + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).UiImportList, + sym(2).UiObjectMemberList->finish()); } break; ./ diff --git a/src/declarative/qml/parser/javascriptast_p.h b/src/declarative/qml/parser/javascriptast_p.h index de34ab2..53d1982 100644 --- a/src/declarative/qml/parser/javascriptast_p.h +++ b/src/declarative/qml/parser/javascriptast_p.h @@ -1555,13 +1555,14 @@ public: class UiProgram: public Node { public: - UiProgram(UiObjectMemberList *members) - : members(members) + UiProgram(UiImportList *imports, UiObjectMemberList *members) + : imports(imports), members(members) { kind = Kind_UiProgram; } virtual void accept0(Visitor *visitor); // attributes + UiImportList *imports; UiObjectMemberList *members; }; diff --git a/src/declarative/qml/parser/javascriptparser.cpp b/src/declarative/qml/parser/javascriptparser.cpp index af55b27..3746a88 100644 --- a/src/declarative/qml/parser/javascriptparser.cpp +++ b/src/declarative/qml/parser/javascriptparser.cpp @@ -163,7 +163,8 @@ bool JavaScriptParser::parse(JavaScriptEnginePrivate *driver) switch (r) { case 0: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(2).UiObjectMemberList->finish()); + sym(1).Node = makeAstNode (driver->nodePool(), sym(1).UiImportList, + sym(2).UiObjectMemberList->finish()); } break; case 2: { diff --git a/src/declarative/qml/qmlscriptparser.cpp b/src/declarative/qml/qmlscriptparser.cpp index be01f37..1ba1444 100644 --- a/src/declarative/qml/qmlscriptparser.cpp +++ b/src/declarative/qml/qmlscriptparser.cpp @@ -71,6 +71,7 @@ protected: using AST::Visitor::visit; using AST::Visitor::endVisit; + virtual bool visit(AST::UiProgram *node); virtual bool visit(AST::UiObjectDefinition *node); virtual bool visit(AST::UiPublicMember *node); virtual bool visit(AST::UiObjectBinding *node); @@ -221,6 +222,14 @@ void ProcessAST::defineProperty(const QString &propertyName, int line, const QSt _stateStack.pop(); } +// UiProgram: UiImportListOpt UiObjectMemberList ; +bool ProcessAST::visit(AST::UiProgram *node) +{ + accept(node->imports); + accept(node->members->member); + return false; +} + // UiObjectMember: T_PUBLIC T_IDENTIFIER T_IDENTIFIER T_COLON Expression UiObjectInitializer ; bool ProcessAST::visit(AST::UiPublicMember *node) { -- cgit v0.12 From 40377ef5ff137d3501c62eb26be786a09027f598 Mon Sep 17 00:00:00 2001 From: mae Date: Tue, 21 Apr 2009 10:54:39 +0200 Subject: imported qmlconv utility for convenience --- tools/qmlconv/qmlconv.cpp | 386 ++++++++++++++++++++++++++++++++++++++++++++++ tools/qmlconv/qmlconv.pro | 10 ++ tools/tools.pro | 2 +- 3 files changed, 397 insertions(+), 1 deletion(-) create mode 100644 tools/qmlconv/qmlconv.cpp create mode 100644 tools/qmlconv/qmlconv.pro diff --git a/tools/qmlconv/qmlconv.cpp b/tools/qmlconv/qmlconv.cpp new file mode 100644 index 0000000..a3a3f79 --- /dev/null +++ b/tools/qmlconv/qmlconv.cpp @@ -0,0 +1,386 @@ +#include +#include +#include +#include +#include +#include + + + + +class Reader +{ + QString outString; + QTextStream out; + QXmlStreamReader xml; + int depth; + bool supressIndent; + + QStringList knownListProperties; + inline QString depthString() {if (supressIndent) { supressIndent = false; return QString(); } + return QString(depth*4, QLatin1Char(' '));} + +public: + Reader(QIODevice *in) + :xml(in) { + + knownListProperties << "states" << "transitions" << "children" << "resources" + << "transform" << "notes"; + depth = 0; + supressIndent = false; + + out.setString(&outString); + + loop(); + + out.flush(); + QTextStream print(stdout); + print << outString; + } + + void comment() + { + if (xml.isComment()) { + out << depthString() << "// " + << xml.text().toString().trimmed().replace(QRegExp("\n\\s*"),"\n"+depthString()+"// ") + << endl; + } + } + + void emptyLoop() { + while (!xml.atEnd()) { + xml.readNext(); + comment(); + if (xml.tokenType() == QXmlStreamReader::EndElement) + return; + } + } + + void loop() + { + while (!xml.atEnd()) { + xml.readNext(); + if (xml.tokenType() == QXmlStreamReader::EndElement) + return; + else if (xml.tokenType() == QXmlStreamReader::StartElement) + startElement(); + comment(); + } + } + + void startElement() { + if (xml.name() == "properties") + startDeclareProperties(); + else if (xml.name() == "signals") + startDeclareSignals(); + else if (knownListProperties.contains(xml.name().toString())) + startList(); + else if (xml.name() == "SetProperties") + startSetProperties(); + else if (xml.name() == "SetProperty") + startSetProperty(); + else if (xml.name() == "ParentChange") + startParentChange(); + else if (xml.name() == "Connection") + startConnection(); + else if (xml.name() == "Script") + startScript(); + else if (xml.name().at(0).isLower() && xml.attributes().isEmpty()) + startObjectProperty(); + else + startItem(); + } + + static void possiblyRemoveBraces(QString *s) { + if (s->startsWith('{') && s->endsWith('}')) + *s = s->mid(1, s->length() - 2); + } + + static bool isNumber(const QString &s) { + bool ok = true; + s.toFloat(&ok); + return ok; + } + + static bool isSignalHandler(const QString &s) { + return s.size() > 3 + && s.startsWith("on") + && s.at(2).isUpper(); + } + + static bool isEnum(const QString &property, const QString &value) { + return !value.contains(' ') && (property == "vAlign" || property == "hAlign" + || property == "style"); + } + + static bool isIdentifier(const QString &s) { + if (s.isEmpty()) + return false; + if (!s.at(1).isLetter()) + return false; + for (int i = 1; i < s.size(); ++i) { + QChar c = s.at(i); + if (c.isLetterOrNumber() + || c == QLatin1Char('_') + || c == QLatin1Char('-')) + continue; + return false; + } + return true; + } + + + void setProperty(const QString &property, const QString &value, bool newline = true) { + QString v = value.trimmed(); + if (v.startsWith('{')) { + possiblyRemoveBraces(&v); + } else if (v == "true" + || v == "false" + || isNumber(v) + || property == "id" + || isEnum(property, value) + ) { + ; + } else if (isSignalHandler(property)) { + // if not a function name, create an anonymous function + if (!isIdentifier(v)) { + v.prepend("function(){ "); + v.append(" }"); + } + } else + + // if (property == "text" || property == "name" || value.contains(' ') + // || value.contains("/") || value.startsWith('#') + // || property == "filename" || property == "source" || property == "src" + // || property == "title" || property == "movieTitle" || property == "movieDescription" + // || property == "properties" || property == "fromState" || property == "toState" + // ) + { + v.prepend('\"'); + v.append('\"'); + } + if (!newline) + out << property << ": " << v; + else + out << depthString() << property << ": " << v << endl; + } + + + typedef QPair StringPair; + QList propertyChangeSet; + void startItem(bool inList = false) { + + QString name = xml.name().toString(); + + out << depthString() << name << " {" << endl; + ++depth; + + if (name == "State") + propertyChangeSet.clear(); + + foreach (QXmlStreamAttribute attribute, xml.attributes()) { + setProperty(attribute.name().toString(), attribute.value().toString()); + } + + loop(); + + if (name == "State" && !propertyChangeSet.isEmpty()) { + out << depthString() << "propertyChangeSet: PropertyChangeSet" << " {" << endl; + ++depth; + foreach(StringPair pair, propertyChangeSet) + setProperty(pair.first, pair.second); + --depth; + out << depthString() << "}" << endl; + propertyChangeSet.clear(); + } + + --depth; + out << depthString() << "}"; + if (!inList) + out << endl; + } + + void startObjectProperty() { + + QString name = xml.name().toString(); + bool hasElements = false; + while (!xml.atEnd()) { + xml.readNext(); + if (xml.tokenType() == QXmlStreamReader::EndElement) + break; + if (xml.tokenType() == QXmlStreamReader::StartElement) { + hasElements = true; + out << depthString() << name << ": "; + supressIndent = true; + startElement(); + } else if (!hasElements && xml.tokenType() == QXmlStreamReader::Characters) { + if (!xml.text().toString().trimmed().isEmpty()) { + setProperty(name, xml.text().toString()); + } + } + comment(); + } + } + + void startDeclareProperty() { + out << depthString() << "public property "; + QString name = xml.attributes().value("name").toString(); + + if (xml.attributes().hasAttribute("value")) + setProperty(name, xml.attributes().value("value").toString(), false); + else out << name; + + QMap attributes; + foreach (QXmlStreamAttribute attribute, xml.attributes()) { + if (attribute.name() == "name" || attribute.name() == "value") + continue; + attributes.insert(attribute.name().toString(), attribute.value().toString()); + } + if (attributes.isEmpty()) { + out << endl; + } else { + out << " {" << endl; + ++depth; + foreach (QString key, attributes.keys()) + setProperty(key, attributes.value(key)); + --depth; + out << depthString() << "}" << endl; + } + emptyLoop(); + } + + void startDeclareProperties() { + while (!xml.atEnd()) { + xml.readNext(); + if (xml.tokenType() == QXmlStreamReader::EndElement) + return; + if (xml.tokenType() == QXmlStreamReader::StartElement) { + if (xml.name() == "Property") + startDeclareProperty(); + } + comment(); + } + } + + void startDeclareSignal() { + out << depthString() << "public signal " << xml.attributes().value("name").toString() << endl; + emptyLoop(); + } + + void startDeclareSignals() { + while (!xml.atEnd()) { + xml.readNext(); + if (xml.tokenType() == QXmlStreamReader::EndElement) + return; + if (xml.tokenType() == QXmlStreamReader::StartElement) { + if (xml.name() == "Signal") + startDeclareSignal(); + } + comment(); + } + } + + + void startSetProperties() { + QString target = xml.attributes().value("target").toString(); + possiblyRemoveBraces(&target); + foreach (QXmlStreamAttribute attribute, xml.attributes()) { + if (attribute.name() == "target") + continue; + propertyChangeSet += StringPair(target + "." + attribute.name().toString(), attribute.value().toString()); + } + emptyLoop(); + } + + void startSetProperty() { + QString target = xml.attributes().value("target").toString(); + possiblyRemoveBraces(&target); + propertyChangeSet += StringPair(target + "." + xml.attributes().value("property").toString(), + xml.attributes().value("value").toString()); + + emptyLoop(); + } + + void startParentChange() { + QString target = xml.attributes().value("target").toString(); + possiblyRemoveBraces(&target); + propertyChangeSet += StringPair(target + ".parent", xml.attributes().value("parent").toString()); + emptyLoop(); + } + + void startConnection() { + QString sender = xml.attributes().value("sender").toString(); + possiblyRemoveBraces(&sender); + out << depthString() << "Connection {" << endl; + ++depth; + out << depthString() << "signal: " << sender + "." + xml.attributes().value("signal").toString() << endl; + out << depthString() << "onSignal: function(){ " << xml.attributes().value("script").toString() << " }" << endl; + --depth; + out << depthString() << "}" << endl; + emptyLoop(); + } + + void startScript() { + if (xml.attributes().hasAttribute(QLatin1String("src"))) { + QString import; + QTextStream ts(&import); + ts << "import \""; + ts << xml.attributes().value(QLatin1String("src")).toString(); + ts << "\"" << endl; + ts.flush(); + outString.prepend(import); + } + QString text = xml.readElementText(); + if (!text.trimmed().isEmpty()) { + out << text << endl; + } + if (xml.tokenType() != QXmlStreamReader::EndElement) + emptyLoop(); + } + + void startList() + { + out << depthString() << xml.name().toString() << ": [" << endl; + ++depth; + bool needComma = false; + + while (!xml.atEnd()) { + xml.readNext(); + if (xml.tokenType() == QXmlStreamReader::EndElement) + break; + if (xml.tokenType() == QXmlStreamReader::StartElement) { + if (needComma) + out << "," << endl; + startItem(true); + needComma = true; + } + comment(); + } + + out << endl; + --depth; + out << depthString() << "]" << endl; + } + +}; + + + +int main(int argc, char *argv[]) +{ + QCoreApplication a(argc, argv); + + if (argc != 2) { + qWarning() << "Usage: qmlconf filename"; + exit(1); + } + + QFile file(argv[1]); + if (file.open(QIODevice::ReadOnly)) { + Reader r(&file); + } + + + file.close(); + return 0; +} diff --git a/tools/qmlconv/qmlconv.pro b/tools/qmlconv/qmlconv.pro new file mode 100644 index 0000000..839d0ff --- /dev/null +++ b/tools/qmlconv/qmlconv.pro @@ -0,0 +1,10 @@ +DESTDIR = ../../bin +QT -= gui +# Input +SOURCES += qmlconv.cpp + +target.path=$$[QT_INSTALL_BINS] +INSTALLS += target + +CONFIG += console + diff --git a/tools/tools.pro b/tools/tools.pro index da4ff67..12da18c 100644 --- a/tools/tools.pro +++ b/tools/tools.pro @@ -24,7 +24,7 @@ mac { SUBDIRS += kmap2qmap -contains(QT_CONFIG, declarative):SUBDIRS += duiviewer +contains(QT_CONFIG, declarative):SUBDIRS += duiviewer qmlconv contains(QT_CONFIG, dbus):SUBDIRS += qdbus !wince*:contains(QT_CONFIG, xmlpatterns): SUBDIRS += xmlpatterns embedded: SUBDIRS += makeqpf -- cgit v0.12 From 1a382dc05c7fc69ded1313abd034492edc6b69ee Mon Sep 17 00:00:00 2001 From: Roberto Raggi Date: Tue, 21 Apr 2009 11:06:46 +0200 Subject: Introduced AST::cast(node). --- src/declarative/qml/parser/javascriptast_p.h | 540 ++++++++++++++++++--------- src/declarative/qml/qmlscriptparser.cpp | 26 +- 2 files changed, 375 insertions(+), 191 deletions(-) diff --git a/src/declarative/qml/parser/javascriptast_p.h b/src/declarative/qml/parser/javascriptast_p.h index 53d1982..fd0e463 100644 --- a/src/declarative/qml/parser/javascriptast_p.h +++ b/src/declarative/qml/parser/javascriptast_p.h @@ -61,6 +61,9 @@ QT_BEGIN_NAMESPACE +#define JAVASCRIPT_DECLARE_AST_NODE(name) \ + enum { K = Kind_##name }; + class JavaScriptNameIdImpl; namespace QSOperator // ### rename @@ -108,6 +111,15 @@ enum Op { namespace JavaScript { namespace AST { +template +_T1 cast(_T2 *ast) +{ + if (ast && ast->kind == static_cast<_T1>(0)->K) + return static_cast<_T1>(ast); + + return 0; +} + class SourceLocation { public: @@ -128,99 +140,100 @@ class Node { public: enum Kind { - Kind_Node, - Kind_ExpressionNode, - Kind_Statement, - Kind_ThisExpression, - Kind_IdentifierExpression, - Kind_NullExpression, - Kind_TrueLiteral, - Kind_FalseLiteral, - Kind_NumericLiteral, - Kind_StringLiteral, - Kind_RegExpLiteral, + Kind_Undefined, + + Kind_ArgumentList, Kind_ArrayLiteral, - Kind_ObjectLiteral, - Kind_ElementList, - Kind_Elision, - Kind_PropertyNameAndValueList, - Kind_PropertyName, - Kind_IdentifierPropertyName, - Kind_StringLiteralPropertyName, - Kind_NumericLiteralPropertyName, Kind_ArrayMemberExpression, - Kind_FieldMemberExpression, - Kind_NewMemberExpression, - Kind_NewExpression, - Kind_CallExpression, - Kind_ArgumentList, - Kind_PostIncrementExpression, - Kind_PostDecrementExpression, - Kind_DeleteExpression, - Kind_VoidExpression, - Kind_TypeOfExpression, - Kind_PreIncrementExpression, - Kind_PreDecrementExpression, - Kind_UnaryPlusExpression, - Kind_UnaryMinusExpression, - Kind_TildeExpression, - Kind_NotExpression, Kind_BinaryExpression, - Kind_ConditionalExpression, - Kind_Expression, Kind_Block, - Kind_StatementList, - Kind_VariableStatement, - Kind_VariableDeclarationList, - Kind_VariableDeclaration, - Kind_EmptyStatement, - Kind_ExpressionStatement, - Kind_IfStatement, - Kind_DoWhileStatement, - Kind_WhileStatement, - Kind_ForStatement, - Kind_LocalForStatement, - Kind_ForEachStatement, - Kind_LocalForEachStatement, - Kind_ContinueStatement, Kind_BreakStatement, - Kind_ReturnStatement, - Kind_WithStatement, - Kind_SwitchStatement, + Kind_CallExpression, Kind_CaseBlock, - Kind_CaseClauses, Kind_CaseClause, - Kind_DefaultClause, - Kind_LabelledStatement, - Kind_ThrowStatement, - Kind_TryStatement, + Kind_CaseClauses, Kind_Catch, + Kind_ConditionalExpression, + Kind_ContinueStatement, + Kind_DebuggerStatement, + Kind_DefaultClause, + Kind_DeleteExpression, + Kind_DoWhileStatement, + Kind_ElementList, + Kind_Elision, + Kind_EmptyStatement, + Kind_Expression, + Kind_ExpressionStatement, + Kind_FalseLiteral, + Kind_FieldMemberExpression, Kind_Finally, - Kind_FunctionDeclaration, - Kind_FunctionExpression, + Kind_ForEachStatement, + Kind_ForStatement, Kind_FormalParameterList, Kind_FunctionBody, + Kind_FunctionDeclaration, + Kind_FunctionExpression, + Kind_FunctionSourceElement, + Kind_IdentifierExpression, + Kind_IdentifierPropertyName, + Kind_IfStatement, + Kind_LabelledStatement, + Kind_LocalForEachStatement, + Kind_LocalForStatement, + Kind_NewExpression, + Kind_NewMemberExpression, + Kind_NotExpression, + Kind_NullExpression, + Kind_NumericLiteral, + Kind_NumericLiteralPropertyName, + Kind_ObjectLiteral, + Kind_PostDecrementExpression, + Kind_PostIncrementExpression, + Kind_PreDecrementExpression, + Kind_PreIncrementExpression, Kind_Program, - Kind_SourceElements, + Kind_PropertyName, + Kind_PropertyNameAndValueList, + Kind_RegExpLiteral, + Kind_ReturnStatement, Kind_SourceElement, - Kind_FunctionSourceElement, + Kind_SourceElements, + Kind_StatementList, Kind_StatementSourceElement, - Kind_DebuggerStatement, + Kind_StringLiteral, + Kind_StringLiteralPropertyName, + Kind_SwitchStatement, + Kind_ThisExpression, + Kind_ThrowStatement, + Kind_TildeExpression, + Kind_TrueLiteral, + Kind_TryStatement, + Kind_TypeOfExpression, + Kind_UnaryMinusExpression, + Kind_UnaryPlusExpression, + Kind_VariableDeclaration, + Kind_VariableDeclarationList, + Kind_VariableStatement, + Kind_VoidExpression, + Kind_WhileStatement, + Kind_WithStatement, - Kind_UiProgram, - Kind_UiPublicMember, + Kind_UiArrayBinding, + Kind_UiImport, + Kind_UiImportList, + Kind_UiObjectBinding, Kind_UiObjectDefinition, Kind_UiObjectInitializer, - Kind_UiObjectBinding, - Kind_UiScriptBinding, - Kind_UiArrayBinding, Kind_UiObjectMemberList, + Kind_UiProgram, + Kind_UiPublicMember, Kind_UiQualifiedId, + Kind_UiScriptBinding, Kind_UiSourceElement }; inline Node() - : kind(Kind_Node) {} + : kind(Kind_Undefined) {} virtual ~Node() {} @@ -244,13 +257,14 @@ public: virtual void accept0(Visitor *visitor) = 0; - Kind kind; +// attributes + int kind; }; class ExpressionNode: public Node { public: - ExpressionNode() { kind = Kind_ExpressionNode; } + ExpressionNode() {} virtual ~ExpressionNode() {} virtual ExpressionNode *expressionCast(); @@ -259,7 +273,7 @@ public: class Statement: public Node { public: - Statement() { kind = Kind_Statement; } + Statement() {} virtual ~Statement() {} virtual Statement *statementCast(); @@ -268,7 +282,9 @@ public: class ThisExpression: public ExpressionNode { public: - ThisExpression() { kind = Kind_ThisExpression; } + JAVASCRIPT_DECLARE_AST_NODE(ThisExpression) + + ThisExpression() { kind = K; } virtual ~ThisExpression() {} virtual void accept0(Visitor *visitor); @@ -280,8 +296,10 @@ public: class IdentifierExpression: public ExpressionNode { public: + JAVASCRIPT_DECLARE_AST_NODE(IdentifierExpression) + IdentifierExpression(JavaScriptNameIdImpl *n): - name (n) { kind = Kind_IdentifierExpression; } + name (n) { kind = K; } virtual ~IdentifierExpression() {} @@ -295,7 +313,9 @@ public: class NullExpression: public ExpressionNode { public: - NullExpression() { kind = Kind_NullExpression; } + JAVASCRIPT_DECLARE_AST_NODE(NullExpression) + + NullExpression() { kind = K; } virtual ~NullExpression() {} virtual void accept0(Visitor *visitor); @@ -307,7 +327,9 @@ public: class TrueLiteral: public ExpressionNode { public: - TrueLiteral() { kind = Kind_TrueLiteral; } + JAVASCRIPT_DECLARE_AST_NODE(TrueLiteral) + + TrueLiteral() { kind = K; } virtual ~TrueLiteral() {} virtual void accept0(Visitor *visitor); @@ -319,7 +341,9 @@ public: class FalseLiteral: public ExpressionNode { public: - FalseLiteral() { kind = Kind_FalseLiteral; } + JAVASCRIPT_DECLARE_AST_NODE(FalseLiteral) + + FalseLiteral() { kind = K; } virtual ~FalseLiteral() {} virtual void accept0(Visitor *visitor); @@ -331,8 +355,10 @@ public: class NumericLiteral: public ExpressionNode { public: + JAVASCRIPT_DECLARE_AST_NODE(NumericLiteral) + NumericLiteral(double v): - value (v) { kind = Kind_NumericLiteral; } + value (v) { kind = K; } virtual ~NumericLiteral() {} virtual void accept0(Visitor *visitor); @@ -345,8 +371,10 @@ public: class StringLiteral: public ExpressionNode { public: + JAVASCRIPT_DECLARE_AST_NODE(StringLiteral) + StringLiteral(JavaScriptNameIdImpl *v): - value (v) { kind = Kind_StringLiteral; } + value (v) { kind = K; } virtual ~StringLiteral() {} @@ -360,8 +388,10 @@ public: class RegExpLiteral: public ExpressionNode { public: + JAVASCRIPT_DECLARE_AST_NODE(RegExpLiteral) + RegExpLiteral(JavaScriptNameIdImpl *p, int f): - pattern (p), flags (f) { kind = Kind_RegExpLiteral; } + pattern (p), flags (f) { kind = K; } virtual ~RegExpLiteral() {} @@ -376,17 +406,19 @@ public: class ArrayLiteral: public ExpressionNode { public: + JAVASCRIPT_DECLARE_AST_NODE(ArrayLiteral) + ArrayLiteral(Elision *e): elements (0), elision (e) - { kind = Kind_ArrayLiteral; } + { kind = K; } ArrayLiteral(ElementList *elts): elements (elts), elision (0) - { kind = Kind_ArrayLiteral; } + { kind = K; } ArrayLiteral(ElementList *elts, Elision *e): elements (elts), elision (e) - { kind = Kind_ArrayLiteral; } + { kind = K; } virtual ~ArrayLiteral() {} @@ -400,11 +432,13 @@ public: class ObjectLiteral: public ExpressionNode { public: + JAVASCRIPT_DECLARE_AST_NODE(ObjectLiteral) + ObjectLiteral(): - properties (0) { kind = Kind_ObjectLiteral; } + properties (0) { kind = K; } ObjectLiteral(PropertyNameAndValueList *plist): - properties (plist) { kind = Kind_ObjectLiteral; } + properties (plist) { kind = K; } virtual ~ObjectLiteral() {} @@ -417,14 +451,16 @@ public: class ElementList: public Node { public: + JAVASCRIPT_DECLARE_AST_NODE(ElementList) + ElementList(Elision *e, ExpressionNode *expr): elision (e), expression (expr), next (this) - { kind = Kind_ElementList; } + { kind = K; } ElementList(ElementList *previous, Elision *e, ExpressionNode *expr): elision (e), expression (expr) { - kind = Kind_ElementList; + kind = K; next = previous->next; previous->next = this; } @@ -449,12 +485,14 @@ public: class Elision: public Node { public: + JAVASCRIPT_DECLARE_AST_NODE(Elision) + Elision(): - next (this) { kind = Kind_Elision; } + next (this) { kind = K; } Elision(Elision *previous) { - kind = Kind_Elision; + kind = K; next = previous->next; previous->next = this; } @@ -477,14 +515,16 @@ public: class PropertyNameAndValueList: public Node { public: + JAVASCRIPT_DECLARE_AST_NODE(PropertyNameAndValueList) + PropertyNameAndValueList(PropertyName *n, ExpressionNode *v): name (n), value (v), next (this) - { kind = Kind_PropertyNameAndValueList; } + { kind = K; } PropertyNameAndValueList(PropertyNameAndValueList *previous, PropertyName *n, ExpressionNode *v): name (n), value (v) { - kind = Kind_PropertyNameAndValueList; + kind = K; next = previous->next; previous->next = this; } @@ -509,15 +549,19 @@ public: class PropertyName: public Node { public: - PropertyName() { kind = Kind_PropertyName; } + JAVASCRIPT_DECLARE_AST_NODE(PropertyName) + + PropertyName() { kind = K; } virtual ~PropertyName() {} }; class IdentifierPropertyName: public PropertyName { public: + JAVASCRIPT_DECLARE_AST_NODE(IdentifierPropertyName) + IdentifierPropertyName(JavaScriptNameIdImpl *n): - id (n) { kind = Kind_IdentifierPropertyName; } + id (n) { kind = K; } virtual ~IdentifierPropertyName() {} @@ -530,8 +574,10 @@ public: class StringLiteralPropertyName: public PropertyName { public: + JAVASCRIPT_DECLARE_AST_NODE(StringLiteralPropertyName) + StringLiteralPropertyName(JavaScriptNameIdImpl *n): - id (n) { kind = Kind_StringLiteralPropertyName; } + id (n) { kind = K; } virtual ~StringLiteralPropertyName() {} virtual void accept0(Visitor *visitor); @@ -543,8 +589,10 @@ public: class NumericLiteralPropertyName: public PropertyName { public: + JAVASCRIPT_DECLARE_AST_NODE(NumericLiteralPropertyName) + NumericLiteralPropertyName(double n): - id (n) { kind = Kind_NumericLiteralPropertyName; } + id (n) { kind = K; } virtual ~NumericLiteralPropertyName() {} virtual void accept0(Visitor *visitor); @@ -556,9 +604,11 @@ public: class ArrayMemberExpression: public ExpressionNode { public: + JAVASCRIPT_DECLARE_AST_NODE(ArrayMemberExpression) + ArrayMemberExpression(ExpressionNode *b, ExpressionNode *e): base (b), expression (e) - { kind = Kind_ArrayMemberExpression; } + { kind = K; } virtual ~ArrayMemberExpression() {} @@ -572,9 +622,11 @@ public: class FieldMemberExpression: public ExpressionNode { public: + JAVASCRIPT_DECLARE_AST_NODE(FieldMemberExpression) + FieldMemberExpression(ExpressionNode *b, JavaScriptNameIdImpl *n): base (b), name (n) - { kind = Kind_FieldMemberExpression; } + { kind = K; } virtual ~FieldMemberExpression() {} @@ -590,9 +642,11 @@ public: class NewMemberExpression: public ExpressionNode { public: + JAVASCRIPT_DECLARE_AST_NODE(NewMemberExpression) + NewMemberExpression(ExpressionNode *b, ArgumentList *a): base (b), arguments (a) - { kind = Kind_NewMemberExpression; } + { kind = K; } virtual ~NewMemberExpression() {} @@ -609,8 +663,10 @@ public: class NewExpression: public ExpressionNode { public: + JAVASCRIPT_DECLARE_AST_NODE(NewExpression) + NewExpression(ExpressionNode *e): - expression (e) { kind = Kind_NewExpression; } + expression (e) { kind = K; } virtual ~NewExpression() {} @@ -624,9 +680,11 @@ public: class CallExpression: public ExpressionNode { public: + JAVASCRIPT_DECLARE_AST_NODE(CallExpression) + CallExpression(ExpressionNode *b, ArgumentList *a): base (b), arguments (a) - { kind = Kind_CallExpression; } + { kind = K; } virtual ~CallExpression() {} @@ -642,14 +700,16 @@ public: class ArgumentList: public Node { public: + JAVASCRIPT_DECLARE_AST_NODE(ArgumentList) + ArgumentList(ExpressionNode *e): expression (e), next (this) - { kind = Kind_ArgumentList; } + { kind = K; } ArgumentList(ArgumentList *previous, ExpressionNode *e): expression (e) { - kind = Kind_ArgumentList; + kind = K; next = previous->next; previous->next = this; } @@ -674,8 +734,10 @@ public: class PostIncrementExpression: public ExpressionNode { public: + JAVASCRIPT_DECLARE_AST_NODE(PostIncrementExpression) + PostIncrementExpression(ExpressionNode *b): - base (b) { kind = Kind_PostIncrementExpression; } + base (b) { kind = K; } virtual ~PostIncrementExpression() {} @@ -688,8 +750,10 @@ public: class PostDecrementExpression: public ExpressionNode { public: + JAVASCRIPT_DECLARE_AST_NODE(PostDecrementExpression) + PostDecrementExpression(ExpressionNode *b): - base (b) { kind = Kind_PostDecrementExpression; } + base (b) { kind = K; } virtual ~PostDecrementExpression() {} @@ -702,8 +766,10 @@ public: class DeleteExpression: public ExpressionNode { public: + JAVASCRIPT_DECLARE_AST_NODE(DeleteExpression) + DeleteExpression(ExpressionNode *e): - expression (e) { kind = Kind_DeleteExpression; } + expression (e) { kind = K; } virtual ~DeleteExpression() {} virtual void accept0(Visitor *visitor); @@ -715,8 +781,10 @@ public: class VoidExpression: public ExpressionNode { public: + JAVASCRIPT_DECLARE_AST_NODE(VoidExpression) + VoidExpression(ExpressionNode *e): - expression (e) { kind = Kind_VoidExpression; } + expression (e) { kind = K; } virtual ~VoidExpression() {} @@ -729,8 +797,10 @@ public: class TypeOfExpression: public ExpressionNode { public: + JAVASCRIPT_DECLARE_AST_NODE(TypeOfExpression) + TypeOfExpression(ExpressionNode *e): - expression (e) { kind = Kind_TypeOfExpression; } + expression (e) { kind = K; } virtual ~TypeOfExpression() {} @@ -743,8 +813,10 @@ public: class PreIncrementExpression: public ExpressionNode { public: + JAVASCRIPT_DECLARE_AST_NODE(PreIncrementExpression) + PreIncrementExpression(ExpressionNode *e): - expression (e) { kind = Kind_PreIncrementExpression; } + expression (e) { kind = K; } virtual ~PreIncrementExpression() {} @@ -757,8 +829,10 @@ public: class PreDecrementExpression: public ExpressionNode { public: + JAVASCRIPT_DECLARE_AST_NODE(PreDecrementExpression) + PreDecrementExpression(ExpressionNode *e): - expression (e) { kind = Kind_PreDecrementExpression; } + expression (e) { kind = K; } virtual ~PreDecrementExpression() {} @@ -771,8 +845,10 @@ public: class UnaryPlusExpression: public ExpressionNode { public: + JAVASCRIPT_DECLARE_AST_NODE(UnaryPlusExpression) + UnaryPlusExpression(ExpressionNode *e): - expression (e) { kind = Kind_UnaryPlusExpression; } + expression (e) { kind = K; } virtual ~UnaryPlusExpression() {} @@ -785,8 +861,10 @@ public: class UnaryMinusExpression: public ExpressionNode { public: + JAVASCRIPT_DECLARE_AST_NODE(UnaryMinusExpression) + UnaryMinusExpression(ExpressionNode *e): - expression (e) { kind = Kind_UnaryMinusExpression; } + expression (e) { kind = K; } virtual ~UnaryMinusExpression() {} @@ -799,8 +877,10 @@ public: class TildeExpression: public ExpressionNode { public: + JAVASCRIPT_DECLARE_AST_NODE(TildeExpression) + TildeExpression(ExpressionNode *e): - expression (e) { kind = Kind_TildeExpression; } + expression (e) { kind = K; } virtual ~TildeExpression() {} @@ -813,8 +893,10 @@ public: class NotExpression: public ExpressionNode { public: + JAVASCRIPT_DECLARE_AST_NODE(NotExpression) + NotExpression(ExpressionNode *e): - expression (e) { kind = Kind_NotExpression; } + expression (e) { kind = K; } virtual ~NotExpression() {} @@ -827,9 +909,11 @@ public: class BinaryExpression: public ExpressionNode { public: + JAVASCRIPT_DECLARE_AST_NODE(BinaryExpression) + BinaryExpression(ExpressionNode *l, int o, ExpressionNode *r): left (l), op (o), right (r) - { kind = Kind_BinaryExpression; } + { kind = K; } virtual ~BinaryExpression() {} @@ -846,9 +930,11 @@ public: class ConditionalExpression: public ExpressionNode { public: + JAVASCRIPT_DECLARE_AST_NODE(ConditionalExpression) + ConditionalExpression(ExpressionNode *e, ExpressionNode *t, ExpressionNode *f): expression (e), ok (t), ko (f) - { kind = Kind_ConditionalExpression; } + { kind = K; } virtual ~ConditionalExpression() {} @@ -863,8 +949,10 @@ public: class Expression: public ExpressionNode // ### rename { public: + JAVASCRIPT_DECLARE_AST_NODE(Expression) + Expression(ExpressionNode *l, ExpressionNode *r): - left (l), right (r) { kind = Kind_Expression; } + left (l), right (r) { kind = K; } virtual ~Expression() {} @@ -878,8 +966,10 @@ public: class Block: public Statement { public: + JAVASCRIPT_DECLARE_AST_NODE(Block) + Block(StatementList *slist): - statements (slist) { kind = Kind_Block; } + statements (slist) { kind = K; } virtual ~Block() {} @@ -892,14 +982,16 @@ public: class StatementList: public Node { public: + JAVASCRIPT_DECLARE_AST_NODE(StatementList) + StatementList(Statement *stmt): statement (stmt), next (this) - { kind = Kind_StatementList; } + { kind = K; } StatementList(StatementList *previous, Statement *stmt): statement (stmt) { - kind = Kind_StatementList; + kind = K; next = previous->next; previous->next = this; } @@ -923,9 +1015,11 @@ public: class VariableStatement: public Statement { public: + JAVASCRIPT_DECLARE_AST_NODE(VariableStatement) + VariableStatement(VariableDeclarationList *vlist): declarations (vlist) - { kind = Kind_VariableStatement; } + { kind = K; } virtual ~VariableStatement() {} @@ -940,9 +1034,11 @@ public: class VariableDeclaration: public Node { public: + JAVASCRIPT_DECLARE_AST_NODE(VariableDeclaration) + VariableDeclaration(JavaScriptNameIdImpl *n, ExpressionNode *e): name (n), expression (e), readOnly(false) - { kind = Kind_VariableDeclaration; } + { kind = K; } virtual ~VariableDeclaration() {} @@ -958,14 +1054,16 @@ public: class VariableDeclarationList: public Node { public: + JAVASCRIPT_DECLARE_AST_NODE(VariableDeclarationList) + VariableDeclarationList(VariableDeclaration *decl): declaration (decl), next (this) - { kind = Kind_VariableDeclarationList; } + { kind = K; } VariableDeclarationList(VariableDeclarationList *previous, VariableDeclaration *decl): declaration (decl) { - kind = Kind_VariableDeclarationList; + kind = K; next = previous->next; previous->next = this; } @@ -994,7 +1092,9 @@ public: class EmptyStatement: public Statement { public: - EmptyStatement() { kind = Kind_EmptyStatement; } + JAVASCRIPT_DECLARE_AST_NODE(EmptyStatement) + + EmptyStatement() { kind = K; } virtual ~EmptyStatement() {} virtual void accept0(Visitor *visitor); @@ -1003,8 +1103,10 @@ public: class ExpressionStatement: public Statement { public: + JAVASCRIPT_DECLARE_AST_NODE(ExpressionStatement) + ExpressionStatement(ExpressionNode *e): - expression (e) { kind = Kind_ExpressionStatement; } + expression (e) { kind = K; } virtual ~ExpressionStatement() {} @@ -1018,9 +1120,11 @@ public: class IfStatement: public Statement { public: + JAVASCRIPT_DECLARE_AST_NODE(IfStatement) + IfStatement(ExpressionNode *e, Statement *t, Statement *f = 0): expression (e), ok (t), ko (f) - { kind = Kind_IfStatement; } + { kind = K; } virtual ~IfStatement() {} @@ -1035,9 +1139,11 @@ public: class DoWhileStatement: public Statement { public: + JAVASCRIPT_DECLARE_AST_NODE(DoWhileStatement) + DoWhileStatement(Statement *stmt, ExpressionNode *e): statement (stmt), expression (e) - { kind = Kind_DoWhileStatement; } + { kind = K; } virtual ~DoWhileStatement() {} @@ -1051,9 +1157,11 @@ public: class WhileStatement: public Statement { public: + JAVASCRIPT_DECLARE_AST_NODE(WhileStatement) + WhileStatement(ExpressionNode *e, Statement *stmt): expression (e), statement (stmt) - { kind = Kind_WhileStatement; } + { kind = K; } virtual ~WhileStatement() {} @@ -1067,9 +1175,11 @@ public: class ForStatement: public Statement { public: + JAVASCRIPT_DECLARE_AST_NODE(ForStatement) + ForStatement(ExpressionNode *i, ExpressionNode *c, ExpressionNode *e, Statement *stmt): initialiser (i), condition (c), expression (e), statement (stmt) - { kind = Kind_ForStatement; } + { kind = K; } virtual ~ForStatement() {} @@ -1085,9 +1195,11 @@ public: class LocalForStatement: public Statement { public: + JAVASCRIPT_DECLARE_AST_NODE(LocalForStatement) + LocalForStatement(VariableDeclarationList *vlist, ExpressionNode *c, ExpressionNode *e, Statement *stmt): declarations (vlist), condition (c), expression (e), statement (stmt) - { kind = Kind_LocalForStatement; } + { kind = K; } virtual ~LocalForStatement() {} @@ -1103,9 +1215,11 @@ public: class ForEachStatement: public Statement { public: + JAVASCRIPT_DECLARE_AST_NODE(ForEachStatement) + ForEachStatement(ExpressionNode *i, ExpressionNode *e, Statement *stmt): initialiser (i), expression (e), statement (stmt) - { kind = Kind_ForEachStatement; } + { kind = K; } virtual ~ForEachStatement() {} @@ -1120,9 +1234,11 @@ public: class LocalForEachStatement: public Statement { public: + JAVASCRIPT_DECLARE_AST_NODE(LocalForEachStatement) + LocalForEachStatement(VariableDeclaration *v, ExpressionNode *e, Statement *stmt): declaration (v), expression (e), statement (stmt) - { kind = Kind_LocalForEachStatement; } + { kind = K; } virtual ~LocalForEachStatement() {} @@ -1137,8 +1253,10 @@ public: class ContinueStatement: public Statement { public: + JAVASCRIPT_DECLARE_AST_NODE(ContinueStatement) + ContinueStatement(JavaScriptNameIdImpl *l = 0): - label (l) { kind = Kind_ContinueStatement; } + label (l) { kind = K; } virtual ~ContinueStatement() {} @@ -1151,8 +1269,10 @@ public: class BreakStatement: public Statement { public: + JAVASCRIPT_DECLARE_AST_NODE(BreakStatement) + BreakStatement(JavaScriptNameIdImpl *l = 0): - label (l) { kind = Kind_BreakStatement; } + label (l) { kind = K; } virtual ~BreakStatement() {} @@ -1165,8 +1285,10 @@ public: class ReturnStatement: public Statement { public: + JAVASCRIPT_DECLARE_AST_NODE(ReturnStatement) + ReturnStatement(ExpressionNode *e): - expression (e) { kind = Kind_ReturnStatement; } + expression (e) { kind = K; } virtual ~ReturnStatement() {} @@ -1179,9 +1301,11 @@ public: class WithStatement: public Statement { public: + JAVASCRIPT_DECLARE_AST_NODE(WithStatement) + WithStatement(ExpressionNode *e, Statement *stmt): expression (e), statement (stmt) - { kind = Kind_WithStatement; } + { kind = K; } virtual ~WithStatement() {} @@ -1195,9 +1319,11 @@ public: class SwitchStatement: public Statement { public: + JAVASCRIPT_DECLARE_AST_NODE(SwitchStatement) + SwitchStatement(ExpressionNode *e, CaseBlock *b): expression (e), block (b) - { kind = Kind_SwitchStatement; } + { kind = K; } virtual ~SwitchStatement() {} @@ -1211,9 +1337,11 @@ public: class CaseBlock: public Node { public: + JAVASCRIPT_DECLARE_AST_NODE(CaseBlock) + CaseBlock(CaseClauses *c, DefaultClause *d = 0, CaseClauses *r = 0): clauses (c), defaultClause (d), moreClauses (r) - { kind = Kind_CaseBlock; } + { kind = K; } virtual ~CaseBlock() {} @@ -1228,14 +1356,16 @@ public: class CaseClauses: public Node { public: + JAVASCRIPT_DECLARE_AST_NODE(CaseClauses) + CaseClauses(CaseClause *c): clause (c), next (this) - { kind = Kind_CaseClauses; } + { kind = K; } CaseClauses(CaseClauses *previous, CaseClause *c): clause (c) { - kind = Kind_CaseClauses; + kind = K; next = previous->next; previous->next = this; } @@ -1259,9 +1389,11 @@ public: class CaseClause: public Node { public: + JAVASCRIPT_DECLARE_AST_NODE(CaseClause) + CaseClause(ExpressionNode *e, StatementList *slist): expression (e), statements (slist) - { kind = Kind_CaseClause; } + { kind = K; } virtual ~CaseClause() {} @@ -1275,9 +1407,11 @@ public: class DefaultClause: public Node { public: + JAVASCRIPT_DECLARE_AST_NODE(DefaultClause) + DefaultClause(StatementList *slist): statements (slist) - { kind = Kind_DefaultClause; } + { kind = K; } virtual ~DefaultClause() {} @@ -1290,9 +1424,11 @@ public: class LabelledStatement: public Statement { public: + JAVASCRIPT_DECLARE_AST_NODE(LabelledStatement) + LabelledStatement(JavaScriptNameIdImpl *l, Statement *stmt): label (l), statement (stmt) - { kind = Kind_LabelledStatement; } + { kind = K; } virtual ~LabelledStatement() {} @@ -1306,8 +1442,10 @@ public: class ThrowStatement: public Statement { public: + JAVASCRIPT_DECLARE_AST_NODE(ThrowStatement) + ThrowStatement(ExpressionNode *e): - expression (e) { kind = Kind_ThrowStatement; } + expression (e) { kind = K; } virtual ~ThrowStatement() {} @@ -1320,17 +1458,19 @@ public: class TryStatement: public Statement { public: + JAVASCRIPT_DECLARE_AST_NODE(TryStatement) + TryStatement(Statement *stmt, Catch *c, Finally *f): statement (stmt), catchExpression (c), finallyExpression (f) - { kind = Kind_TryStatement; } + { kind = K; } TryStatement(Statement *stmt, Finally *f): statement (stmt), catchExpression (0), finallyExpression (f) - { kind = Kind_TryStatement; } + { kind = K; } TryStatement(Statement *stmt, Catch *c): statement (stmt), catchExpression (c), finallyExpression (0) - { kind = Kind_TryStatement; } + { kind = K; } virtual ~TryStatement() {} @@ -1345,9 +1485,11 @@ public: class Catch: public Node { public: + JAVASCRIPT_DECLARE_AST_NODE(Catch) + Catch(JavaScriptNameIdImpl *n, Statement *stmt): name (n), statement (stmt) - { kind = Kind_Catch; } + { kind = K; } virtual ~Catch() {} @@ -1361,9 +1503,11 @@ public: class Finally: public Node { public: + JAVASCRIPT_DECLARE_AST_NODE(Finally) + Finally(Statement *stmt): statement (stmt) - { kind = Kind_Finally; } + { kind = K; } virtual ~Finally() {} @@ -1376,9 +1520,11 @@ public: class FunctionExpression: public ExpressionNode { public: + JAVASCRIPT_DECLARE_AST_NODE(FunctionExpression) + FunctionExpression(JavaScriptNameIdImpl *n, FormalParameterList *f, FunctionBody *b): name (n), formals (f), body (b) - { kind = Kind_FunctionExpression; } + { kind = K; } virtual ~FunctionExpression() {} @@ -1399,9 +1545,11 @@ public: class FunctionDeclaration: public FunctionExpression { public: + JAVASCRIPT_DECLARE_AST_NODE(FunctionDeclaration) + FunctionDeclaration(JavaScriptNameIdImpl *n, FormalParameterList *f, FunctionBody *b): FunctionExpression(n, f, b) - { kind = Kind_FunctionDeclaration; } + { kind = K; } virtual ~FunctionDeclaration() {} @@ -1411,14 +1559,16 @@ public: class FormalParameterList: public Node { public: + JAVASCRIPT_DECLARE_AST_NODE(FormalParameterList) + FormalParameterList(JavaScriptNameIdImpl *n): name (n), next (this) - { kind = Kind_FormalParameterList; } + { kind = K; } FormalParameterList(FormalParameterList *previous, JavaScriptNameIdImpl *n): name (n) { - kind = Kind_FormalParameterList; + kind = K; next = previous->next; previous->next = this; } @@ -1444,9 +1594,11 @@ public: class FunctionBody: public Node { public: + JAVASCRIPT_DECLARE_AST_NODE(FunctionBody) + FunctionBody(SourceElements *elts): elements (elts) - { kind = Kind_FunctionBody; } + { kind = K; } virtual ~FunctionBody() {} @@ -1459,9 +1611,11 @@ public: class Program: public Node { public: + JAVASCRIPT_DECLARE_AST_NODE(Program) + Program(SourceElements *elts): elements (elts) - { kind = Kind_Program; } + { kind = K; } virtual ~Program() {} @@ -1474,14 +1628,16 @@ public: class SourceElements: public Node { public: + JAVASCRIPT_DECLARE_AST_NODE(SourceElements) + SourceElements(SourceElement *elt): element (elt), next (this) - { kind = Kind_SourceElements; } + { kind = K; } SourceElements(SourceElements *previous, SourceElement *elt): element (elt) { - kind = Kind_SourceElements; + kind = K; next = previous->next; previous->next = this; } @@ -1505,8 +1661,10 @@ public: class SourceElement: public Node { public: + JAVASCRIPT_DECLARE_AST_NODE(SourceElement) + inline SourceElement() - { kind = Kind_SourceElement; } + { kind = K; } virtual ~SourceElement() {} }; @@ -1514,9 +1672,11 @@ public: class FunctionSourceElement: public SourceElement { public: + JAVASCRIPT_DECLARE_AST_NODE(FunctionSourceElement) + FunctionSourceElement(FunctionDeclaration *f): declaration (f) - { kind = Kind_FunctionSourceElement; } + { kind = K; } virtual ~FunctionSourceElement() {} @@ -1529,9 +1689,11 @@ public: class StatementSourceElement: public SourceElement { public: + JAVASCRIPT_DECLARE_AST_NODE(StatementSourceElement) + StatementSourceElement(Statement *stmt): statement (stmt) - { kind = Kind_StatementSourceElement; } + { kind = K; } virtual ~StatementSourceElement() {} @@ -1544,8 +1706,10 @@ public: class DebuggerStatement: public Statement { public: + JAVASCRIPT_DECLARE_AST_NODE(DebuggerStatement) + DebuggerStatement() - { kind = Kind_DebuggerStatement; } + { kind = K; } virtual ~DebuggerStatement() {} @@ -1555,9 +1719,11 @@ public: class UiProgram: public Node { public: + JAVASCRIPT_DECLARE_AST_NODE(UiProgram) + UiProgram(UiImportList *imports, UiObjectMemberList *members) : imports(imports), members(members) - { kind = Kind_UiProgram; } + { kind = K; } virtual void accept0(Visitor *visitor); @@ -1569,6 +1735,8 @@ public: class UiImport: public Node { public: + JAVASCRIPT_DECLARE_AST_NODE(UiImport) + UiImport(JavaScriptNameIdImpl *fileName) : fileName(fileName) { @@ -1586,10 +1754,12 @@ public: class UiImportList: public Node { public: + JAVASCRIPT_DECLARE_AST_NODE(UiImportList) + UiImportList(UiImport *import) : import(import), next(0) - { } + { kind = K; } UiImportList(UiImportList *previous, UiImport *import) : import(import) @@ -1619,10 +1789,12 @@ class UiObjectMember: public Node class UiPublicMember: public UiObjectMember { public: + JAVASCRIPT_DECLARE_AST_NODE(UiPublicMember) + UiPublicMember(JavaScriptNameIdImpl *type, JavaScriptNameIdImpl *name) : type(type), name(name), expression(0), initializer(0) - { kind = Kind_UiPublicMember; } + { kind = K; } UiPublicMember(JavaScriptNameIdImpl *type, JavaScriptNameIdImpl *name, @@ -1630,7 +1802,7 @@ public: UiObjectInitializer *initializer) : type(type), name(name), expression(expression), initializer(initializer) - { kind = Kind_UiPublicMember; } + { kind = K; } virtual void accept0(Visitor *visitor); @@ -1648,10 +1820,12 @@ public: class UiObjectDefinition: public UiObjectMember { public: + JAVASCRIPT_DECLARE_AST_NODE(UiObjectDefinition) + UiObjectDefinition(JavaScriptNameIdImpl *name, UiObjectInitializer *initializer) : name(name), initializer(initializer) - { kind = Kind_UiObjectDefinition; } + { kind = K; } virtual void accept0(Visitor *visitor); @@ -1664,9 +1838,11 @@ public: class UiObjectInitializer: public Node { public: + JAVASCRIPT_DECLARE_AST_NODE(UiObjectInitializer) + UiObjectInitializer(UiObjectMemberList *members) : members(members) - { kind = Kind_UiObjectInitializer; } + { kind = K; } virtual void accept0(Visitor *visitor); @@ -1679,9 +1855,11 @@ public: class UiSourceElement: public UiObjectMember { public: + JAVASCRIPT_DECLARE_AST_NODE(UiSourceElement) + UiSourceElement(Statement *sourceElement) : sourceElement(sourceElement) - { kind = Kind_UiSourceElement; } + { kind = K; } virtual void accept0(Visitor *visitor); @@ -1692,13 +1870,15 @@ public: class UiObjectBinding: public UiObjectMember { public: + JAVASCRIPT_DECLARE_AST_NODE(UiObjectBinding) + UiObjectBinding(UiQualifiedId *qualifiedId, JavaScriptNameIdImpl *name, UiObjectInitializer *initializer) : qualifiedId(qualifiedId), name(name), initializer(initializer) - { kind = Kind_UiObjectBinding; } + { kind = K; } virtual void accept0(Visitor *visitor); @@ -1713,11 +1893,13 @@ public: class UiScriptBinding: public UiObjectMember { public: + JAVASCRIPT_DECLARE_AST_NODE(UiScriptBinding) + UiScriptBinding(UiQualifiedId *qualifiedId, Statement *statement) : qualifiedId(qualifiedId), statement(statement) - { kind = Kind_UiScriptBinding; } + { kind = K; } virtual void accept0(Visitor *visitor); @@ -1730,11 +1912,13 @@ public: class UiArrayBinding: public UiObjectMember { public: + JAVASCRIPT_DECLARE_AST_NODE(UiArrayBinding) + UiArrayBinding(UiQualifiedId *qualifiedId, UiObjectMemberList *members) : qualifiedId(qualifiedId), members(members) - { kind = Kind_UiArrayBinding; } + { kind = K; } virtual void accept0(Visitor *visitor); @@ -1749,14 +1933,16 @@ public: class UiObjectMemberList: public Node { public: + JAVASCRIPT_DECLARE_AST_NODE(UiObjectMemberList) + UiObjectMemberList(UiObjectMember *member) : next(this), member(member) - { kind = Kind_UiObjectMemberList; } + { kind = K; } UiObjectMemberList(UiObjectMemberList *previous, UiObjectMember *member) : member(member) { - kind = Kind_UiObjectMemberList; + kind = K; next = previous->next; previous->next = this; } @@ -1778,14 +1964,16 @@ public: class UiQualifiedId: public Node { public: + JAVASCRIPT_DECLARE_AST_NODE(UiQualifiedId) + UiQualifiedId(JavaScriptNameIdImpl *name) : next(this), name(name) - { kind = Kind_UiQualifiedId; } + { kind = K; } UiQualifiedId(UiQualifiedId *previous, JavaScriptNameIdImpl *name) : name(name) { - kind = Kind_UiQualifiedId; + kind = K; next = previous->next; previous->next = this; } diff --git a/src/declarative/qml/qmlscriptparser.cpp b/src/declarative/qml/qmlscriptparser.cpp index 1ba1444..950b357 100644 --- a/src/declarative/qml/qmlscriptparser.cpp +++ b/src/declarative/qml/qmlscriptparser.cpp @@ -289,9 +289,9 @@ bool ProcessAST::visit(AST::UiObjectDefinition *node) QString script; for (; it; it = it->next) { - if (it->member->kind != AST::Node::Kind_UiScriptBinding) - continue; // ### TODO generate error - AST::UiScriptBinding *scriptBinding = static_cast(it->member); + AST::UiScriptBinding *scriptBinding = AST::cast(it->member); + if (! scriptBinding) + continue; QString s; QTextStream out(&s); @@ -300,8 +300,7 @@ bool ProcessAST::visit(AST::UiObjectDefinition *node) QString propertyName = asString(scriptBinding->qualifiedId); if (propertyName == QLatin1String("signal")) { // ## TODO verify that this is a function call statement and nothing else. - if (scriptBinding->statement->kind == AST::Node::Kind_ExpressionStatement) { - AST::ExpressionStatement *stmt = static_cast(scriptBinding->statement); + if (AST::ExpressionStatement *stmt = AST::cast(scriptBinding->statement)) { pp(stmt->expression); int dot = s.lastIndexOf(QLatin1Char('.')); if (dot >= 0) { @@ -315,8 +314,7 @@ bool ProcessAST::visit(AST::UiObjectDefinition *node) } } else if (propertyName == QLatin1String("onSignal")) { - if (scriptBinding->statement->kind == AST::Node::Kind_ExpressionStatement) { - AST::ExpressionStatement *stmt = static_cast(scriptBinding->statement); + if (AST::ExpressionStatement *stmt = AST::cast(scriptBinding->statement)) { script = getPrimitive("onSignal", stmt->expression); } else { pp(scriptBinding->statement); @@ -357,9 +355,9 @@ bool ProcessAST::visit(AST::UiObjectBinding *node) AST::UiObjectMemberList *it = node->initializer->members; for (; it; it = it->next) { - if (it->member->kind != AST::Node::Kind_UiScriptBinding) + AST::UiScriptBinding *scriptBinding = AST::cast(it->member); + if (!scriptBinding) continue; // ### TODO generate error - AST::UiScriptBinding *scriptBinding = static_cast(it->member); QString target; @@ -379,8 +377,7 @@ bool ProcessAST::visit(AST::UiObjectBinding *node) ++propertyCount; } - if (scriptBinding->statement->kind == AST::Node::Kind_ExpressionStatement) { - AST::ExpressionStatement *stmt = static_cast(scriptBinding->statement); + if (AST::ExpressionStatement *stmt = AST::cast(scriptBinding->statement)) { value = getPrimitive(property.toLatin1(), stmt->expression); } else { // #### TODO generate error @@ -430,11 +427,11 @@ QString ProcessAST::getPrimitive(const QByteArray &propertyName, AST::Expression //end of hack } else if (propertyName == "id" && expr && expr->kind == AST::Node::Kind_IdentifierExpression) { - primitive = static_cast(expr)->name->asString(); + primitive = AST::cast(expr)->name->asString(); } else if (expr->kind == AST::Node::Kind_StringLiteral) { // hack: emulate weird XML feature that string literals are not quoted. //This needs to be fixed in the qmlcompiler once xml goes away. - primitive = static_cast(expr)->value->asString(); + primitive = AST::cast(expr)->value->asString(); } else if (expr->kind == AST::Node::Kind_TrueLiteral || expr->kind == AST::Node::Kind_FalseLiteral || expr->kind == AST::Node::Kind_NumericLiteral @@ -466,8 +463,7 @@ bool ProcessAST::visit(AST::UiScriptBinding *node) QTextStream out(&primitive); PrettyPretty pp(out); - if (node->statement->kind == AST::Node::Kind_ExpressionStatement) { - AST::ExpressionStatement *stmt = static_cast(node->statement); + if (AST::ExpressionStatement *stmt = AST::cast(node->statement)) { primitive = getPrimitive(prop->name, stmt->expression); } else { -- cgit v0.12 From a44ae02e0e5b7949ad4643caf52fd04f56166b13 Mon Sep 17 00:00:00 2001 From: mae Date: Tue, 21 Apr 2009 11:58:26 +0200 Subject: error output for scripts --- src/declarative/qml/qmlengine.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/declarative/qml/qmlengine.cpp b/src/declarative/qml/qmlengine.cpp index 5cbd02b..943d812 100644 --- a/src/declarative/qml/qmlengine.cpp +++ b/src/declarative/qml/qmlengine.cpp @@ -832,6 +832,20 @@ QVariant QmlExpression::value() scriptEngine->currentContext()->pushScope(context()->d_func()->scopeChain.at(i)); } QScriptValue svalue = scriptEngine->evaluate(expression()); + if (scriptEngine->hasUncaughtException()) { + if (scriptEngine->uncaughtException().isError()){ + QScriptValue exception = scriptEngine->uncaughtException(); + if(!exception.property(QLatin1String("fileName")).toString().isEmpty()){ + qWarning() << exception.property(QLatin1String("fileName")).toString() + << scriptEngine->uncaughtExceptionLineNumber() + << exception.toString(); + + } else { + qWarning() << exception.toString(); + } + } + } + context()->d_func()->defaultObjects.removeAt(context()->d_func()->highPriorityCount); if(svalue.isArray()) { int length = svalue.property(QLatin1String("length")).toInt32(); -- cgit v0.12 From 2fa9049ddf75a3c057fc5c881f9d9faad5ce6c29 Mon Sep 17 00:00:00 2001 From: mae Date: Tue, 21 Apr 2009 13:16:59 +0200 Subject: load foo.js for a foo.dui if it exists. This lets us use the import keyword for real modules. Fix qmlconv, also get rid of the function() for signal properties. --- src/declarative/qml/qmlscriptparser.cpp | 10 ++++++++++ src/declarative/qml/qmlscriptparser_p.h | 4 ++++ tools/qmlconv/qmlconv.cpp | 4 +++- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/declarative/qml/qmlscriptparser.cpp b/src/declarative/qml/qmlscriptparser.cpp index 950b357..6d49d3f 100644 --- a/src/declarative/qml/qmlscriptparser.cpp +++ b/src/declarative/qml/qmlscriptparser.cpp @@ -193,6 +193,16 @@ Object *ProcessAST::defineObjectBinding(int line, if (! _parser->tree()) { _parser->setTree(obj); + + if (!_parser->scriptFile().isEmpty()) { + _stateStack.pushObject(obj); + Object *scriptObject= defineObjectBinding(line, 0, QLatin1String("Script")); + _stateStack.pushObject(scriptObject); + defineProperty(QLatin1String("src"), line, _parser->scriptFile()); + _stateStack.pop(); // scriptObject + _stateStack.pop(); // object + } + } else { const State state = _stateStack.top(); Value *v = new Value; diff --git a/src/declarative/qml/qmlscriptparser_p.h b/src/declarative/qml/qmlscriptparser_p.h index b24662e..6c7c0f1 100644 --- a/src/declarative/qml/qmlscriptparser_p.h +++ b/src/declarative/qml/qmlscriptparser_p.h @@ -31,12 +31,16 @@ public: int findOrCreateTypeId(const QString &name); void setTree(QmlParser::Object *tree); + void setScriptFile(const QString &filename) {_scriptFile = filename; } + QString scriptFile() const { return _scriptFile; } + private: QMap _nameSpacePaths; QmlParser::Object *root; QStringList _typeNames; QString _error; int _errorLine; + QString _scriptFile; }; QT_END_NAMESPACE diff --git a/tools/qmlconv/qmlconv.cpp b/tools/qmlconv/qmlconv.cpp index a3a3f79..e0f9628 100644 --- a/tools/qmlconv/qmlconv.cpp +++ b/tools/qmlconv/qmlconv.cpp @@ -314,7 +314,7 @@ public: out << depthString() << "Connection {" << endl; ++depth; out << depthString() << "signal: " << sender + "." + xml.attributes().value("signal").toString() << endl; - out << depthString() << "onSignal: function(){ " << xml.attributes().value("script").toString() << " }" << endl; + out << depthString() << "onSignal: { " << xml.attributes().value("script").toString() << " }" << endl; --depth; out << depthString() << "}" << endl; emptyLoop(); @@ -322,6 +322,7 @@ public: void startScript() { if (xml.attributes().hasAttribute(QLatin1String("src"))) { + /* QString import; QTextStream ts(&import); ts << "import \""; @@ -329,6 +330,7 @@ public: ts << "\"" << endl; ts.flush(); outString.prepend(import); + */ } QString text = xml.readElementText(); if (!text.trimmed().isEmpty()) { -- cgit v0.12 From aa95c56c618b94cec26315417256bd3a7b327dd9 Mon Sep 17 00:00:00 2001 From: Roberto Raggi Date: Tue, 21 Apr 2009 14:08:09 +0200 Subject: qmlconv does not need to be a bundle app. --- tools/qmlconv/qmlconv.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/qmlconv/qmlconv.pro b/tools/qmlconv/qmlconv.pro index 839d0ff..331f4ee 100644 --- a/tools/qmlconv/qmlconv.pro +++ b/tools/qmlconv/qmlconv.pro @@ -7,4 +7,4 @@ target.path=$$[QT_INSTALL_BINS] INSTALLS += target CONFIG += console - +macx:CONFIG -= app_bundle -- cgit v0.12 From c4f351602bb9bc6ea86007115a38b3f2c9ebd6c9 Mon Sep 17 00:00:00 2001 From: Roberto Raggi Date: Tue, 21 Apr 2009 14:19:02 +0200 Subject: Process the `import' statement. --- src/declarative/qml/qmlscriptparser.cpp | 14 ++++++++++++++ src/declarative/qml/qmlscriptparser_p.h | 2 ++ 2 files changed, 16 insertions(+) diff --git a/src/declarative/qml/qmlscriptparser.cpp b/src/declarative/qml/qmlscriptparser.cpp index 6d49d3f..ffdfdf4 100644 --- a/src/declarative/qml/qmlscriptparser.cpp +++ b/src/declarative/qml/qmlscriptparser.cpp @@ -72,6 +72,7 @@ protected: using AST::Visitor::endVisit; virtual bool visit(AST::UiProgram *node); + virtual bool visit(AST::UiImport *node); virtual bool visit(AST::UiObjectDefinition *node); virtual bool visit(AST::UiPublicMember *node); virtual bool visit(AST::UiObjectBinding *node); @@ -240,6 +241,14 @@ bool ProcessAST::visit(AST::UiProgram *node) return false; } +// UiImport: T_IMPORT T_STRING_LITERAL ; +bool ProcessAST::visit(AST::UiImport *node) +{ + QString fileName = node->fileName->asString(); + _parser->addNamespacePath(fileName); + return false; +} + // UiObjectMember: T_PUBLIC T_IDENTIFIER T_IDENTIFIER T_COLON Expression UiObjectInitializer ; bool ProcessAST::visit(AST::UiPublicMember *node) { @@ -616,5 +625,10 @@ void QmlScriptParser::setTree(Object *tree) root = tree; } +void QmlScriptParser::addNamespacePath(const QString &path) +{ + _nameSpacePaths.insertMulti(QString(), path); +} + QT_END_NAMESPACE diff --git a/src/declarative/qml/qmlscriptparser_p.h b/src/declarative/qml/qmlscriptparser_p.h index 6c7c0f1..49128d7 100644 --- a/src/declarative/qml/qmlscriptparser_p.h +++ b/src/declarative/qml/qmlscriptparser_p.h @@ -34,6 +34,8 @@ public: void setScriptFile(const QString &filename) {_scriptFile = filename; } QString scriptFile() const { return _scriptFile; } + void addNamespacePath(const QString &path); + private: QMap _nameSpacePaths; QmlParser::Object *root; -- cgit v0.12 From bb3a5cd3e1e6011d5ef856e898e01e95997fb8bf Mon Sep 17 00:00:00 2001 From: Roberto Raggi Date: Tue, 21 Apr 2009 15:01:46 +0200 Subject: Visit the import nodes. --- src/declarative/qml/parser/javascriptast.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/declarative/qml/parser/javascriptast.cpp b/src/declarative/qml/parser/javascriptast.cpp index 4ceb9ad..35563ac 100644 --- a/src/declarative/qml/parser/javascriptast.cpp +++ b/src/declarative/qml/parser/javascriptast.cpp @@ -882,6 +882,7 @@ void UiImport::accept0(Visitor *visitor) void UiImportList::accept0(Visitor *visitor) { if (visitor->visit(this)) { + acceptChild(import, visitor); acceptChild(next, visitor); } -- cgit v0.12 From 86aaad45d7efd14abc935269142b179956d506ce Mon Sep 17 00:00:00 2001 From: mae Date: Tue, 21 Apr 2009 16:13:24 +0200 Subject: finalize support for namespacepath --- src/declarative/qml/parser/javascriptast_p.h | 2 +- src/declarative/qml/qmlscriptparser.cpp | 15 ++++++++++----- tools/qmlconv/qmlconv.cpp | 12 ++++++++++-- 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/src/declarative/qml/parser/javascriptast_p.h b/src/declarative/qml/parser/javascriptast_p.h index fd0e463..9e5e3e4 100644 --- a/src/declarative/qml/parser/javascriptast_p.h +++ b/src/declarative/qml/parser/javascriptast_p.h @@ -1758,7 +1758,7 @@ public: UiImportList(UiImport *import) : import(import), - next(0) + next(this) { kind = K; } UiImportList(UiImportList *previous, UiImport *import) diff --git a/src/declarative/qml/qmlscriptparser.cpp b/src/declarative/qml/qmlscriptparser.cpp index ffdfdf4..ba127ef 100644 --- a/src/declarative/qml/qmlscriptparser.cpp +++ b/src/declarative/qml/qmlscriptparser.cpp @@ -95,6 +95,12 @@ private: QmlScriptParser *_parser; StateStack _stateStack; QStringList _scope; + + inline bool isSignalProperty(const QByteArray &propertyName) const { + return (propertyName.length() >= 3 && propertyName.startsWith("on") && + ('A' <= propertyName.at(2) && 'Z' >= propertyName.at(2))); + } + }; ProcessAST::ProcessAST(QmlScriptParser *parser) @@ -431,8 +437,7 @@ QString ProcessAST::getPrimitive(const QByteArray &propertyName, AST::Expression QTextStream out(&primitive); PrettyPretty pp(out); - if(propertyName.length() >= 3 && propertyName.startsWith("on") && - ('A' <= propertyName.at(2) && 'Z' >= propertyName.at(2))) { + if(isSignalProperty(propertyName)) { pp(expr); // here comes a cruel hack until we support functions properly with arguments for signal properties @@ -484,8 +489,9 @@ bool ProcessAST::visit(AST::UiScriptBinding *node) if (AST::ExpressionStatement *stmt = AST::cast(node->statement)) { primitive = getPrimitive(prop->name, stmt->expression); - - } else { + } else if (isSignalProperty(prop->name)) { + pp(node->statement); + } else { // do binding out << '{'; pp(node->statement); out << '}'; @@ -592,7 +598,6 @@ int QmlScriptParser::errorLine() const QMap QmlScriptParser::nameSpacePaths() const { - qWarning() << Q_FUNC_INFO << "not implemented"; return _nameSpacePaths; } diff --git a/tools/qmlconv/qmlconv.cpp b/tools/qmlconv/qmlconv.cpp index e0f9628..139a1b0 100644 --- a/tools/qmlconv/qmlconv.cpp +++ b/tools/qmlconv/qmlconv.cpp @@ -64,6 +64,14 @@ public: return; else if (xml.tokenType() == QXmlStreamReader::StartElement) startElement(); + else if (xml.tokenType() == QXmlStreamReader::ProcessingInstruction) { + if (xml.processingInstructionTarget() == QLatin1String("qtfx")) { + QString data = xml.processingInstructionData().toString().trimmed(); + if (data.startsWith(QLatin1String("namespacepath:="))) { + outString.prepend( QLatin1String("import \"") + data.mid(data.indexOf(QLatin1Char('='))+1) + QLatin1String("\"\n")); + } + } + } comment(); } } @@ -144,7 +152,7 @@ public: } else if (isSignalHandler(property)) { // if not a function name, create an anonymous function if (!isIdentifier(v)) { - v.prepend("function(){ "); + v.prepend("{ "); v.append(" }"); } } else @@ -304,7 +312,7 @@ public: void startParentChange() { QString target = xml.attributes().value("target").toString(); possiblyRemoveBraces(&target); - propertyChangeSet += StringPair(target + ".parent", xml.attributes().value("parent").toString()); + propertyChangeSet += StringPair(target + ".moveToParent", xml.attributes().value("parent").toString()); emptyLoop(); } -- cgit v0.12 From 28a9ac5147581d288aa98db0312f6ca455c909ae Mon Sep 17 00:00:00 2001 From: Roberto Raggi Date: Tue, 21 Apr 2009 16:16:28 +0200 Subject: Fixed AST::cast<> for UiImport and UiImportList nodes. --- src/declarative/qml/parser/javascriptast_p.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/declarative/qml/parser/javascriptast_p.h b/src/declarative/qml/parser/javascriptast_p.h index 9e5e3e4..87105c3 100644 --- a/src/declarative/qml/parser/javascriptast_p.h +++ b/src/declarative/qml/parser/javascriptast_p.h @@ -455,7 +455,7 @@ public: ElementList(Elision *e, ExpressionNode *expr): elision (e), expression (expr), next (this) - { kind = K; } + { kind = K; } ElementList(ElementList *previous, Elision *e, ExpressionNode *expr): elision (e), expression (expr) @@ -1739,8 +1739,7 @@ public: UiImport(JavaScriptNameIdImpl *fileName) : fileName(fileName) - { - } + { kind = K; } virtual void accept0(Visitor *visitor); @@ -1764,6 +1763,7 @@ public: UiImportList(UiImportList *previous, UiImport *import) : import(import) { + kind = K; next = previous->next; previous->next = this; } -- cgit v0.12 From 4d01ac2c6fc8e6484cfcb489e6037b846e491ee2 Mon Sep 17 00:00:00 2001 From: Roberto Raggi Date: Tue, 21 Apr 2009 16:54:24 +0200 Subject: Annotate the expression nodes with the source locations. --- src/declarative/qml/parser/javascript.g | 324 +++++++++++++++++++----- src/declarative/qml/parser/javascriptast_p.h | 27 ++ src/declarative/qml/parser/javascriptparser.cpp | 324 +++++++++++++++++++----- 3 files changed, 539 insertions(+), 136 deletions(-) diff --git a/src/declarative/qml/parser/javascript.g b/src/declarative/qml/parser/javascript.g index 5ae7a16..9d0baae 100644 --- a/src/declarative/qml/parser/javascript.g +++ b/src/declarative/qml/parser/javascript.g @@ -793,21 +793,31 @@ case $rule_number: { PrimaryExpression: T_LBRACKET ElisionOpt T_RBRACKET ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Elision); + AST::ArrayLiteral *node = makeAstNode (driver->nodePool(), sym(2).Elision); + node->lbracketToken = loc(1); + node->rbracketToken = loc(3); + sym(1).Node = node; } break; ./ PrimaryExpression: T_LBRACKET ElementList T_RBRACKET ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(2).ElementList->finish ()); + AST::ArrayLiteral *node = makeAstNode (driver->nodePool(), sym(2).ElementList->finish ()); + node->lbracketToken = loc(1); + node->rbracketToken = loc(3); + sym(1).Node = node; } break; ./ PrimaryExpression: T_LBRACKET ElementList T_COMMA ElisionOpt T_RBRACKET ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(2).ElementList->finish (), sym(4).Elision); + AST::ArrayLiteral *node = makeAstNode (driver->nodePool(), sym(2).ElementList->finish (), sym(4).Elision); + node->lbracketToken = loc(1); + node->commaToken = loc(3); + node->rbracketToken = loc(5); + sym(1).Node = node; } break; ./ @@ -852,21 +862,27 @@ case $rule_number: { ElementList: ElementList T_COMMA ElisionOpt AssignmentExpression ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).ElementList, sym(3).Elision, sym(4).Expression); + AST::ElementList *node = makeAstNode (driver->nodePool(), sym(1).ElementList, sym(3).Elision, sym(4).Expression); + node->commaToken = loc(2); + sym(1).Node = node; } break; ./ Elision: T_COMMA ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool()); + AST::Elision *node = makeAstNode (driver->nodePool()); + node->commaToken = loc(1); + sym(1).Node = node; } break; ./ Elision: Elision T_COMMA ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Elision); + AST::Elision *node = makeAstNode (driver->nodePool(), sym(1).Elision); + node->commaToken = loc(2); + sym(1).Node = node; } break; ./ @@ -887,42 +903,57 @@ case $rule_number: { PropertyNameAndValueList: PropertyName T_COLON AssignmentExpression ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).PropertyName, sym(3).Expression); + AST::PropertyNameAndValueList *node = makeAstNode (driver->nodePool(), + sym(1).PropertyName, sym(3).Expression); + node->colonToken = loc(2); + sym(1).Node = node; } break; ./ PropertyNameAndValueList: PropertyNameAndValueList T_COMMA PropertyName T_COLON AssignmentExpression ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).PropertyNameAndValueList, sym(3).PropertyName, sym(5).Expression); + AST::PropertyNameAndValueList *node = makeAstNode (driver->nodePool(), + sym(1).PropertyNameAndValueList, sym(3).PropertyName, sym(5).Expression); + node->commaToken = loc(2); + node->colonToken = loc(4); + sym(1).Node = node; } break; ./ PropertyName: T_IDENTIFIER %prec REDUCE_HERE ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).sval); + AST::IdentifierPropertyName *node = makeAstNode (driver->nodePool(), sym(1).sval); + node->propertyNameToken = loc(1); + sym(1).Node = node; } break; ./ PropertyName: T_STRING_LITERAL ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).sval); + AST::StringLiteralPropertyName *node = makeAstNode (driver->nodePool(), sym(1).sval); + node->propertyNameToken = loc(1); + sym(1).Node = node; } break; ./ PropertyName: T_NUMERIC_LITERAL ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).dval); + AST::NumericLiteralPropertyName *node = makeAstNode (driver->nodePool(), sym(1).dval); + node->propertyNameToken = loc(1); + sym(1).Node = node; } break; ./ PropertyName: ReservedIdentifier ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).sval); + AST::IdentifierPropertyName *node = makeAstNode (driver->nodePool(), sym(1).sval); + node->propertyNameToken = loc(1); + sym(1).Node = node; } break; ./ @@ -1063,7 +1094,10 @@ MemberExpression: FunctionExpression ; MemberExpression: MemberExpression T_LBRACKET Expression T_RBRACKET ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression); + AST::ArrayMemberExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression); + node->lbracketToken = loc(2); + node->rbracketToken = loc(4); + sym(1).Node = node; } break; ./ @@ -1122,7 +1156,10 @@ case $rule_number: { CallExpression: CallExpression T_LBRACKET Expression T_RBRACKET ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression); + AST::ArrayMemberExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression); + node->lbracketToken = loc(2); + node->rbracketToken = loc(4); + sym(1).Node = node; } break; ./ @@ -1173,14 +1210,18 @@ PostfixExpression: LeftHandSideExpression ; PostfixExpression: LeftHandSideExpression T_PLUS_PLUS ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression); + AST::PostIncrementExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression); + node->incrementToken = loc(2); + sym(1).Node = node; } break; ./ PostfixExpression: LeftHandSideExpression T_MINUS_MINUS ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression); + AST::PostDecrementExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression); + node->decrementToken = loc(2); + sym(1).Node = node; } break; ./ @@ -1189,63 +1230,81 @@ UnaryExpression: PostfixExpression ; UnaryExpression: T_DELETE UnaryExpression ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); + AST::DeleteExpression *node = makeAstNode (driver->nodePool(), sym(2).Expression); + node->deleteToken = loc(1); + sym(1).Node = node; } break; ./ UnaryExpression: T_VOID UnaryExpression ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); + AST::VoidExpression *node = makeAstNode (driver->nodePool(), sym(2).Expression); + node->voidToken = loc(1); + sym(1).Node = node; } break; ./ UnaryExpression: T_TYPEOF UnaryExpression ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); + AST::TypeOfExpression *node = makeAstNode (driver->nodePool(), sym(2).Expression); + node->typeofToken = loc(1); + sym(1).Node = node; } break; ./ UnaryExpression: T_PLUS_PLUS UnaryExpression ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); + AST::PreIncrementExpression *node = makeAstNode (driver->nodePool(), sym(2).Expression); + node->incrementToken = loc(1); + sym(1).Node = node; } break; ./ UnaryExpression: T_MINUS_MINUS UnaryExpression ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); + AST::PreDecrementExpression *node = makeAstNode (driver->nodePool(), sym(2).Expression); + node->decrementToken = loc(1); + sym(1).Node = node; } break; ./ UnaryExpression: T_PLUS UnaryExpression ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); + AST::UnaryPlusExpression *node = makeAstNode (driver->nodePool(), sym(2).Expression); + node->plusToken = loc(1); + sym(1).Node = node; } break; ./ UnaryExpression: T_MINUS UnaryExpression ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); + AST::UnaryMinusExpression *node = makeAstNode (driver->nodePool(), sym(2).Expression); + node->minusToken = loc(1); + sym(1).Node = node; } break; ./ UnaryExpression: T_TILDE UnaryExpression ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); + AST::TildeExpression *node = makeAstNode (driver->nodePool(), sym(2).Expression); + node->tildeToken = loc(1); + sym(1).Node = node; } break; ./ UnaryExpression: T_NOT UnaryExpression ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); + AST::NotExpression *node = makeAstNode (driver->nodePool(), sym(2).Expression); + node->notToken = loc(1); + sym(1).Node = node; } break; ./ @@ -1254,21 +1313,30 @@ MultiplicativeExpression: UnaryExpression ; MultiplicativeExpression: MultiplicativeExpression T_STAR UnaryExpression ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Mul, sym(3).Expression); + AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, + QSOperator::Mul, sym(3).Expression); + node->operatorToken = loc(2); + sym(1).Node = node; } break; ./ MultiplicativeExpression: MultiplicativeExpression T_DIVIDE_ UnaryExpression ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Div, sym(3).Expression); + AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, + QSOperator::Div, sym(3).Expression); + node->operatorToken = loc(2); + sym(1).Node = node; } break; ./ MultiplicativeExpression: MultiplicativeExpression T_REMAINDER UnaryExpression ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Mod, sym(3).Expression); + AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, + QSOperator::Mod, sym(3).Expression); + node->operatorToken = loc(2); + sym(1).Node = node; } break; ./ @@ -1277,14 +1345,20 @@ AdditiveExpression: MultiplicativeExpression ; AdditiveExpression: AdditiveExpression T_PLUS MultiplicativeExpression ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Add, sym(3).Expression); + AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, + QSOperator::Add, sym(3).Expression); + node->operatorToken = loc(2); + sym(1).Node = node; } break; ./ AdditiveExpression: AdditiveExpression T_MINUS MultiplicativeExpression ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Sub, sym(3).Expression); + AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, + QSOperator::Sub, sym(3).Expression); + node->operatorToken = loc(2); + sym(1).Node = node; } break; ./ @@ -1293,21 +1367,30 @@ ShiftExpression: AdditiveExpression ; ShiftExpression: ShiftExpression T_LT_LT AdditiveExpression ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::LShift, sym(3).Expression); + AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, + QSOperator::LShift, sym(3).Expression); + node->operatorToken = loc(2); + sym(1).Node = node; } break; ./ ShiftExpression: ShiftExpression T_GT_GT AdditiveExpression ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::RShift, sym(3).Expression); + AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, + QSOperator::RShift, sym(3).Expression); + node->operatorToken = loc(2); + sym(1).Node = node; } break; ./ ShiftExpression: ShiftExpression T_GT_GT_GT AdditiveExpression ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::URShift, sym(3).Expression); + AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, + QSOperator::URShift, sym(3).Expression); + node->operatorToken = loc(2); + sym(1).Node = node; } break; ./ @@ -1316,42 +1399,60 @@ RelationalExpression: ShiftExpression ; RelationalExpression: RelationalExpression T_LT ShiftExpression ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Lt, sym(3).Expression); + AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, + QSOperator::Lt, sym(3).Expression); + node->operatorToken = loc(2); + sym(1).Node = node; } break; ./ RelationalExpression: RelationalExpression T_GT ShiftExpression ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Gt, sym(3).Expression); + AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, + QSOperator::Gt, sym(3).Expression); + node->operatorToken = loc(2); + sym(1).Node = node; } break; ./ RelationalExpression: RelationalExpression T_LE ShiftExpression ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Le, sym(3).Expression); + AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, + QSOperator::Le, sym(3).Expression); + node->operatorToken = loc(2); + sym(1).Node = node; } break; ./ RelationalExpression: RelationalExpression T_GE ShiftExpression ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Ge, sym(3).Expression); + AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, + QSOperator::Ge, sym(3).Expression); + node->operatorToken = loc(2); + sym(1).Node = node; } break; ./ RelationalExpression: RelationalExpression T_INSTANCEOF ShiftExpression ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::InstanceOf, sym(3).Expression); + AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, + QSOperator::InstanceOf, sym(3).Expression); + node->operatorToken = loc(2); + sym(1).Node = node; } break; ./ RelationalExpression: RelationalExpression T_IN ShiftExpression ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::In, sym(3).Expression); + AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, + QSOperator::In, sym(3).Expression); + node->operatorToken = loc(2); + sym(1).Node = node; } break; ./ @@ -1360,35 +1461,50 @@ RelationalExpressionNotIn: ShiftExpression ; RelationalExpressionNotIn: RelationalExpressionNotIn T_LT ShiftExpression ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Lt, sym(3).Expression); + AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, + QSOperator::Lt, sym(3).Expression); + node->operatorToken = loc(2); + sym(1).Node = node; } break; ./ RelationalExpressionNotIn: RelationalExpressionNotIn T_GT ShiftExpression ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Gt, sym(3).Expression); + AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, + QSOperator::Gt, sym(3).Expression); + node->operatorToken = loc(2); + sym(1).Node = node; } break; ./ RelationalExpressionNotIn: RelationalExpressionNotIn T_LE ShiftExpression ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Le, sym(3).Expression); + AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, + QSOperator::Le, sym(3).Expression); + node->operatorToken = loc(2); + sym(1).Node = node; } break; ./ RelationalExpressionNotIn: RelationalExpressionNotIn T_GE ShiftExpression ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Ge, sym(3).Expression); + AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, + QSOperator::Ge, sym(3).Expression); + node->operatorToken = loc(2); + sym(1).Node = node; } break; ./ RelationalExpressionNotIn: RelationalExpressionNotIn T_INSTANCEOF ShiftExpression ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::InstanceOf, sym(3).Expression); + AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, + QSOperator::InstanceOf, sym(3).Expression); + node->operatorToken = loc(2); + sym(1).Node = node; } break; ./ @@ -1397,28 +1513,40 @@ EqualityExpression: RelationalExpression ; EqualityExpression: EqualityExpression T_EQ_EQ RelationalExpression ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Equal, sym(3).Expression); + AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, + QSOperator::Equal, sym(3).Expression); + node->operatorToken = loc(2); + sym(1).Node = node; } break; ./ EqualityExpression: EqualityExpression T_NOT_EQ RelationalExpression ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::NotEqual, sym(3).Expression); + AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, + QSOperator::NotEqual, sym(3).Expression); + node->operatorToken = loc(2); + sym(1).Node = node; } break; ./ EqualityExpression: EqualityExpression T_EQ_EQ_EQ RelationalExpression ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::StrictEqual, sym(3).Expression); + AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, + QSOperator::StrictEqual, sym(3).Expression); + node->operatorToken = loc(2); + sym(1).Node = node; } break; ./ EqualityExpression: EqualityExpression T_NOT_EQ_EQ RelationalExpression ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::StrictNotEqual, sym(3).Expression); + AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, + QSOperator::StrictNotEqual, sym(3).Expression); + node->operatorToken = loc(2); + sym(1).Node = node; } break; ./ @@ -1427,28 +1555,40 @@ EqualityExpressionNotIn: RelationalExpressionNotIn ; EqualityExpressionNotIn: EqualityExpressionNotIn T_EQ_EQ RelationalExpressionNotIn ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Equal, sym(3).Expression); + AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, + QSOperator::Equal, sym(3).Expression); + node->operatorToken = loc(2); + sym(1).Node = node; } break; ./ EqualityExpressionNotIn: EqualityExpressionNotIn T_NOT_EQ RelationalExpressionNotIn; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::NotEqual, sym(3).Expression); + AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, + QSOperator::NotEqual, sym(3).Expression); + node->operatorToken = loc(2); + sym(1).Node = node; } break; ./ EqualityExpressionNotIn: EqualityExpressionNotIn T_EQ_EQ_EQ RelationalExpressionNotIn ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::StrictEqual, sym(3).Expression); + AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, + QSOperator::StrictEqual, sym(3).Expression); + node->operatorToken = loc(2); + sym(1).Node = node; } break; ./ EqualityExpressionNotIn: EqualityExpressionNotIn T_NOT_EQ_EQ RelationalExpressionNotIn ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::StrictNotEqual, sym(3).Expression); + AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, + QSOperator::StrictNotEqual, sym(3).Expression); + node->operatorToken = loc(2); + sym(1).Node = node; } break; ./ @@ -1457,7 +1597,10 @@ BitwiseANDExpression: EqualityExpression ; BitwiseANDExpression: BitwiseANDExpression T_AND EqualityExpression ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::BitAnd, sym(3).Expression); + AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, + QSOperator::BitAnd, sym(3).Expression); + node->operatorToken = loc(2); + sym(1).Node = node; } break; ./ @@ -1466,7 +1609,10 @@ BitwiseANDExpressionNotIn: EqualityExpressionNotIn ; BitwiseANDExpressionNotIn: BitwiseANDExpressionNotIn T_AND EqualityExpressionNotIn ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::BitAnd, sym(3).Expression); + AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, + QSOperator::BitAnd, sym(3).Expression); + node->operatorToken = loc(2); + sym(1).Node = node; } break; ./ @@ -1475,7 +1621,10 @@ BitwiseXORExpression: BitwiseANDExpression ; BitwiseXORExpression: BitwiseXORExpression T_XOR BitwiseANDExpression ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::BitXor, sym(3).Expression); + AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, + QSOperator::BitXor, sym(3).Expression); + node->operatorToken = loc(2); + sym(1).Node = node; } break; ./ @@ -1484,7 +1633,10 @@ BitwiseXORExpressionNotIn: BitwiseANDExpressionNotIn ; BitwiseXORExpressionNotIn: BitwiseXORExpressionNotIn T_XOR BitwiseANDExpressionNotIn ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::BitXor, sym(3).Expression); + AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, + QSOperator::BitXor, sym(3).Expression); + node->operatorToken = loc(2); + sym(1).Node = node; } break; ./ @@ -1493,7 +1645,10 @@ BitwiseORExpression: BitwiseXORExpression ; BitwiseORExpression: BitwiseORExpression T_OR BitwiseXORExpression ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::BitOr, sym(3).Expression); + AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, + QSOperator::BitOr, sym(3).Expression); + node->operatorToken = loc(2); + sym(1).Node = node; } break; ./ @@ -1502,7 +1657,10 @@ BitwiseORExpressionNotIn: BitwiseXORExpressionNotIn ; BitwiseORExpressionNotIn: BitwiseORExpressionNotIn T_OR BitwiseXORExpressionNotIn ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::BitOr, sym(3).Expression); + AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, + QSOperator::BitOr, sym(3).Expression); + node->operatorToken = loc(2); + sym(1).Node = node; } break; ./ @@ -1511,7 +1669,10 @@ LogicalANDExpression: BitwiseORExpression ; LogicalANDExpression: LogicalANDExpression T_AND_AND BitwiseORExpression ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::And, sym(3).Expression); + AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, + QSOperator::And, sym(3).Expression); + node->operatorToken = loc(2); + sym(1).Node = node; } break; ./ @@ -1520,7 +1681,10 @@ LogicalANDExpressionNotIn: BitwiseORExpressionNotIn ; LogicalANDExpressionNotIn: LogicalANDExpressionNotIn T_AND_AND BitwiseORExpressionNotIn ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::And, sym(3).Expression); + AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, + QSOperator::And, sym(3).Expression); + node->operatorToken = loc(2); + sym(1).Node = node; } break; ./ @@ -1529,7 +1693,10 @@ LogicalORExpression: LogicalANDExpression ; LogicalORExpression: LogicalORExpression T_OR_OR LogicalANDExpression ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Or, sym(3).Expression); + AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, + QSOperator::Or, sym(3).Expression); + node->operatorToken = loc(2); + sym(1).Node = node; } break; ./ @@ -1538,7 +1705,10 @@ LogicalORExpressionNotIn: LogicalANDExpressionNotIn ; LogicalORExpressionNotIn: LogicalORExpressionNotIn T_OR_OR LogicalANDExpressionNotIn ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Or, sym(3).Expression); + AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, + QSOperator::Or, sym(3).Expression); + node->operatorToken = loc(2); + sym(1).Node = node; } break; ./ @@ -1547,7 +1717,11 @@ ConditionalExpression: LogicalORExpression ; ConditionalExpression: LogicalORExpression T_QUESTION AssignmentExpression T_COLON AssignmentExpression ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression, sym(5).Expression); + AST::ConditionalExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, + sym(3).Expression, sym(5).Expression); + node->questionToken = loc(2); + node->colonToken = loc(4); + sym(1).Node = node; } break; ./ @@ -1556,7 +1730,11 @@ ConditionalExpressionNotIn: LogicalORExpressionNotIn ; ConditionalExpressionNotIn: LogicalORExpressionNotIn T_QUESTION AssignmentExpressionNotIn T_COLON AssignmentExpressionNotIn ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression, sym(5).Expression); + AST::ConditionalExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, + sym(3).Expression, sym(5).Expression); + node->questionToken = loc(2); + node->colonToken = loc(4); + sym(1).Node = node; } break; ./ @@ -1565,7 +1743,10 @@ AssignmentExpression: ConditionalExpression ; AssignmentExpression: LeftHandSideExpression AssignmentOperator AssignmentExpression ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(2).ival, sym(3).Expression); + AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, + sym(2).ival, sym(3).Expression); + node->operatorToken = loc(2); + sym(1).Node = node; } break; ./ @@ -1574,7 +1755,10 @@ AssignmentExpressionNotIn: ConditionalExpressionNotIn ; AssignmentExpressionNotIn: LeftHandSideExpression AssignmentOperator AssignmentExpressionNotIn ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(2).ival, sym(3).Expression); + AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, + sym(2).ival, sym(3).Expression); + node->operatorToken = loc(2); + sym(1).Node = node; } break; ./ @@ -1667,7 +1851,9 @@ Expression: AssignmentExpression ; Expression: Expression T_COMMA AssignmentExpression ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression); + AST::Expression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression); + node->commaToken = loc(2); + sym(1).Node = node; } break; ./ @@ -1685,7 +1871,9 @@ ExpressionNotIn: AssignmentExpressionNotIn ; ExpressionNotIn: ExpressionNotIn T_COMMA AssignmentExpressionNotIn ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression); + AST::Expression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression); + node->commaToken = loc(2); + sym(1).Node = node; } break; ./ diff --git a/src/declarative/qml/parser/javascriptast_p.h b/src/declarative/qml/parser/javascriptast_p.h index 87105c3..93f700f 100644 --- a/src/declarative/qml/parser/javascriptast_p.h +++ b/src/declarative/qml/parser/javascriptast_p.h @@ -427,6 +427,9 @@ public: // attributes ElementList *elements; Elision *elision; + SourceLocation lbracketToken; + SourceLocation commaToken; + SourceLocation rbracketToken; }; class ObjectLiteral: public ExpressionNode @@ -480,6 +483,7 @@ public: Elision *elision; ExpressionNode *expression; ElementList *next; + SourceLocation commaToken; }; class Elision: public Node @@ -510,6 +514,7 @@ public: // attributes Elision *next; + SourceLocation commaToken; }; class PropertyNameAndValueList: public Node @@ -544,6 +549,8 @@ public: PropertyName *name; ExpressionNode *value; PropertyNameAndValueList *next; + SourceLocation colonToken; + SourceLocation commaToken; }; class PropertyName: public Node @@ -553,6 +560,9 @@ public: PropertyName() { kind = K; } virtual ~PropertyName() {} + +// attributes + SourceLocation propertyNameToken; }; class IdentifierPropertyName: public PropertyName @@ -617,6 +627,8 @@ public: // attributes ExpressionNode *base; ExpressionNode *expression; + SourceLocation lbracketToken; + SourceLocation rbracketToken; }; class FieldMemberExpression: public ExpressionNode @@ -745,6 +757,7 @@ public: // attributes ExpressionNode *base; + SourceLocation incrementToken; }; class PostDecrementExpression: public ExpressionNode @@ -761,6 +774,7 @@ public: // attributes ExpressionNode *base; + SourceLocation decrementToken; }; class DeleteExpression: public ExpressionNode @@ -776,6 +790,7 @@ public: // attributes ExpressionNode *expression; + SourceLocation deleteToken; }; class VoidExpression: public ExpressionNode @@ -792,6 +807,7 @@ public: // attributes ExpressionNode *expression; + SourceLocation voidToken; }; class TypeOfExpression: public ExpressionNode @@ -808,6 +824,7 @@ public: // attributes ExpressionNode *expression; + SourceLocation typeofToken; }; class PreIncrementExpression: public ExpressionNode @@ -824,6 +841,7 @@ public: // attributes ExpressionNode *expression; + SourceLocation incrementToken; }; class PreDecrementExpression: public ExpressionNode @@ -840,6 +858,7 @@ public: // attributes ExpressionNode *expression; + SourceLocation decrementToken; }; class UnaryPlusExpression: public ExpressionNode @@ -856,6 +875,7 @@ public: // attributes ExpressionNode *expression; + SourceLocation plusToken; }; class UnaryMinusExpression: public ExpressionNode @@ -872,6 +892,7 @@ public: // attributes ExpressionNode *expression; + SourceLocation minusToken; }; class TildeExpression: public ExpressionNode @@ -888,6 +909,7 @@ public: // attributes ExpressionNode *expression; + SourceLocation tildeToken; }; class NotExpression: public ExpressionNode @@ -904,6 +926,7 @@ public: // attributes ExpressionNode *expression; + SourceLocation notToken; }; class BinaryExpression: public ExpressionNode @@ -925,6 +948,7 @@ public: ExpressionNode *left; int op; ExpressionNode *right; + SourceLocation operatorToken; }; class ConditionalExpression: public ExpressionNode @@ -944,6 +968,8 @@ public: ExpressionNode *expression; ExpressionNode *ok; ExpressionNode *ko; + SourceLocation questionToken; + SourceLocation colonToken; }; class Expression: public ExpressionNode // ### rename @@ -961,6 +987,7 @@ public: // attributes ExpressionNode *left; ExpressionNode *right; + SourceLocation commaToken; }; class Block: public Statement diff --git a/src/declarative/qml/parser/javascriptparser.cpp b/src/declarative/qml/parser/javascriptparser.cpp index 3746a88..b46edfc 100644 --- a/src/declarative/qml/parser/javascriptparser.cpp +++ b/src/declarative/qml/parser/javascriptparser.cpp @@ -372,15 +372,25 @@ case 37: { } break; case 38: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Elision); + AST::ArrayLiteral *node = makeAstNode (driver->nodePool(), sym(2).Elision); + node->lbracketToken = loc(1); + node->rbracketToken = loc(3); + sym(1).Node = node; } break; case 39: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(2).ElementList->finish ()); + AST::ArrayLiteral *node = makeAstNode (driver->nodePool(), sym(2).ElementList->finish ()); + node->lbracketToken = loc(1); + node->rbracketToken = loc(3); + sym(1).Node = node; } break; case 40: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(2).ElementList->finish (), sym(4).Elision); + AST::ArrayLiteral *node = makeAstNode (driver->nodePool(), sym(2).ElementList->finish (), sym(4).Elision); + node->lbracketToken = loc(1); + node->commaToken = loc(3); + node->rbracketToken = loc(5); + sym(1).Node = node; } break; case 41: { @@ -403,15 +413,21 @@ case 44: { } break; case 45: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).ElementList, sym(3).Elision, sym(4).Expression); + AST::ElementList *node = makeAstNode (driver->nodePool(), sym(1).ElementList, sym(3).Elision, sym(4).Expression); + node->commaToken = loc(2); + sym(1).Node = node; } break; case 46: { - sym(1).Node = makeAstNode (driver->nodePool()); + AST::Elision *node = makeAstNode (driver->nodePool()); + node->commaToken = loc(1); + sym(1).Node = node; } break; case 47: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Elision); + AST::Elision *node = makeAstNode (driver->nodePool(), sym(1).Elision); + node->commaToken = loc(2); + sym(1).Node = node; } break; case 48: { @@ -423,27 +439,42 @@ case 49: { } break; case 50: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).PropertyName, sym(3).Expression); + AST::PropertyNameAndValueList *node = makeAstNode (driver->nodePool(), + sym(1).PropertyName, sym(3).Expression); + node->colonToken = loc(2); + sym(1).Node = node; } break; case 51: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).PropertyNameAndValueList, sym(3).PropertyName, sym(5).Expression); + AST::PropertyNameAndValueList *node = makeAstNode (driver->nodePool(), + sym(1).PropertyNameAndValueList, sym(3).PropertyName, sym(5).Expression); + node->commaToken = loc(2); + node->colonToken = loc(4); + sym(1).Node = node; } break; case 52: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).sval); + AST::IdentifierPropertyName *node = makeAstNode (driver->nodePool(), sym(1).sval); + node->propertyNameToken = loc(1); + sym(1).Node = node; } break; case 53: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).sval); + AST::StringLiteralPropertyName *node = makeAstNode (driver->nodePool(), sym(1).sval); + node->propertyNameToken = loc(1); + sym(1).Node = node; } break; case 54: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).dval); + AST::NumericLiteralPropertyName *node = makeAstNode (driver->nodePool(), sym(1).dval); + node->propertyNameToken = loc(1); + sym(1).Node = node; } break; case 55: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).sval); + AST::IdentifierPropertyName *node = makeAstNode (driver->nodePool(), sym(1).sval); + node->propertyNameToken = loc(1); + sym(1).Node = node; } break; case 56: @@ -512,7 +543,10 @@ case 86: } break; case 91: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression); + AST::ArrayMemberExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression); + node->lbracketToken = loc(2); + node->rbracketToken = loc(4); + sym(1).Node = node; } break; case 92: { @@ -551,7 +585,10 @@ case 97: { } break; case 98: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression); + AST::ArrayMemberExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression); + node->lbracketToken = loc(2); + node->rbracketToken = loc(4); + sym(1).Node = node; } break; case 99: { @@ -580,211 +617,358 @@ case 103: { } break; case 107: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression); + AST::PostIncrementExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression); + node->incrementToken = loc(2); + sym(1).Node = node; } break; case 108: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression); + AST::PostDecrementExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression); + node->decrementToken = loc(2); + sym(1).Node = node; } break; case 110: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); + AST::DeleteExpression *node = makeAstNode (driver->nodePool(), sym(2).Expression); + node->deleteToken = loc(1); + sym(1).Node = node; } break; case 111: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); + AST::VoidExpression *node = makeAstNode (driver->nodePool(), sym(2).Expression); + node->voidToken = loc(1); + sym(1).Node = node; } break; case 112: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); + AST::TypeOfExpression *node = makeAstNode (driver->nodePool(), sym(2).Expression); + node->typeofToken = loc(1); + sym(1).Node = node; } break; case 113: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); + AST::PreIncrementExpression *node = makeAstNode (driver->nodePool(), sym(2).Expression); + node->incrementToken = loc(1); + sym(1).Node = node; } break; case 114: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); + AST::PreDecrementExpression *node = makeAstNode (driver->nodePool(), sym(2).Expression); + node->decrementToken = loc(1); + sym(1).Node = node; } break; case 115: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); + AST::UnaryPlusExpression *node = makeAstNode (driver->nodePool(), sym(2).Expression); + node->plusToken = loc(1); + sym(1).Node = node; } break; case 116: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); + AST::UnaryMinusExpression *node = makeAstNode (driver->nodePool(), sym(2).Expression); + node->minusToken = loc(1); + sym(1).Node = node; } break; case 117: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); + AST::TildeExpression *node = makeAstNode (driver->nodePool(), sym(2).Expression); + node->tildeToken = loc(1); + sym(1).Node = node; } break; case 118: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); + AST::NotExpression *node = makeAstNode (driver->nodePool(), sym(2).Expression); + node->notToken = loc(1); + sym(1).Node = node; } break; case 120: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Mul, sym(3).Expression); + AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, + QSOperator::Mul, sym(3).Expression); + node->operatorToken = loc(2); + sym(1).Node = node; } break; case 121: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Div, sym(3).Expression); + AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, + QSOperator::Div, sym(3).Expression); + node->operatorToken = loc(2); + sym(1).Node = node; } break; case 122: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Mod, sym(3).Expression); + AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, + QSOperator::Mod, sym(3).Expression); + node->operatorToken = loc(2); + sym(1).Node = node; } break; case 124: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Add, sym(3).Expression); + AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, + QSOperator::Add, sym(3).Expression); + node->operatorToken = loc(2); + sym(1).Node = node; } break; case 125: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Sub, sym(3).Expression); + AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, + QSOperator::Sub, sym(3).Expression); + node->operatorToken = loc(2); + sym(1).Node = node; } break; case 127: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::LShift, sym(3).Expression); + AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, + QSOperator::LShift, sym(3).Expression); + node->operatorToken = loc(2); + sym(1).Node = node; } break; case 128: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::RShift, sym(3).Expression); + AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, + QSOperator::RShift, sym(3).Expression); + node->operatorToken = loc(2); + sym(1).Node = node; } break; case 129: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::URShift, sym(3).Expression); + AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, + QSOperator::URShift, sym(3).Expression); + node->operatorToken = loc(2); + sym(1).Node = node; } break; case 131: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Lt, sym(3).Expression); + AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, + QSOperator::Lt, sym(3).Expression); + node->operatorToken = loc(2); + sym(1).Node = node; } break; case 132: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Gt, sym(3).Expression); + AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, + QSOperator::Gt, sym(3).Expression); + node->operatorToken = loc(2); + sym(1).Node = node; } break; case 133: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Le, sym(3).Expression); + AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, + QSOperator::Le, sym(3).Expression); + node->operatorToken = loc(2); + sym(1).Node = node; } break; case 134: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Ge, sym(3).Expression); + AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, + QSOperator::Ge, sym(3).Expression); + node->operatorToken = loc(2); + sym(1).Node = node; } break; case 135: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::InstanceOf, sym(3).Expression); + AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, + QSOperator::InstanceOf, sym(3).Expression); + node->operatorToken = loc(2); + sym(1).Node = node; } break; case 136: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::In, sym(3).Expression); + AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, + QSOperator::In, sym(3).Expression); + node->operatorToken = loc(2); + sym(1).Node = node; } break; case 138: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Lt, sym(3).Expression); + AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, + QSOperator::Lt, sym(3).Expression); + node->operatorToken = loc(2); + sym(1).Node = node; } break; case 139: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Gt, sym(3).Expression); + AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, + QSOperator::Gt, sym(3).Expression); + node->operatorToken = loc(2); + sym(1).Node = node; } break; case 140: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Le, sym(3).Expression); + AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, + QSOperator::Le, sym(3).Expression); + node->operatorToken = loc(2); + sym(1).Node = node; } break; case 141: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Ge, sym(3).Expression); + AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, + QSOperator::Ge, sym(3).Expression); + node->operatorToken = loc(2); + sym(1).Node = node; } break; case 142: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::InstanceOf, sym(3).Expression); + AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, + QSOperator::InstanceOf, sym(3).Expression); + node->operatorToken = loc(2); + sym(1).Node = node; } break; case 144: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Equal, sym(3).Expression); + AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, + QSOperator::Equal, sym(3).Expression); + node->operatorToken = loc(2); + sym(1).Node = node; } break; case 145: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::NotEqual, sym(3).Expression); + AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, + QSOperator::NotEqual, sym(3).Expression); + node->operatorToken = loc(2); + sym(1).Node = node; } break; case 146: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::StrictEqual, sym(3).Expression); + AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, + QSOperator::StrictEqual, sym(3).Expression); + node->operatorToken = loc(2); + sym(1).Node = node; } break; case 147: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::StrictNotEqual, sym(3).Expression); + AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, + QSOperator::StrictNotEqual, sym(3).Expression); + node->operatorToken = loc(2); + sym(1).Node = node; } break; case 149: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Equal, sym(3).Expression); + AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, + QSOperator::Equal, sym(3).Expression); + node->operatorToken = loc(2); + sym(1).Node = node; } break; case 150: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::NotEqual, sym(3).Expression); + AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, + QSOperator::NotEqual, sym(3).Expression); + node->operatorToken = loc(2); + sym(1).Node = node; } break; case 151: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::StrictEqual, sym(3).Expression); + AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, + QSOperator::StrictEqual, sym(3).Expression); + node->operatorToken = loc(2); + sym(1).Node = node; } break; case 152: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::StrictNotEqual, sym(3).Expression); + AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, + QSOperator::StrictNotEqual, sym(3).Expression); + node->operatorToken = loc(2); + sym(1).Node = node; } break; case 154: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::BitAnd, sym(3).Expression); + AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, + QSOperator::BitAnd, sym(3).Expression); + node->operatorToken = loc(2); + sym(1).Node = node; } break; case 156: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::BitAnd, sym(3).Expression); + AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, + QSOperator::BitAnd, sym(3).Expression); + node->operatorToken = loc(2); + sym(1).Node = node; } break; case 158: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::BitXor, sym(3).Expression); + AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, + QSOperator::BitXor, sym(3).Expression); + node->operatorToken = loc(2); + sym(1).Node = node; } break; case 160: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::BitXor, sym(3).Expression); + AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, + QSOperator::BitXor, sym(3).Expression); + node->operatorToken = loc(2); + sym(1).Node = node; } break; case 162: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::BitOr, sym(3).Expression); + AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, + QSOperator::BitOr, sym(3).Expression); + node->operatorToken = loc(2); + sym(1).Node = node; } break; case 164: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::BitOr, sym(3).Expression); + AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, + QSOperator::BitOr, sym(3).Expression); + node->operatorToken = loc(2); + sym(1).Node = node; } break; case 166: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::And, sym(3).Expression); + AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, + QSOperator::And, sym(3).Expression); + node->operatorToken = loc(2); + sym(1).Node = node; } break; case 168: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::And, sym(3).Expression); + AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, + QSOperator::And, sym(3).Expression); + node->operatorToken = loc(2); + sym(1).Node = node; } break; case 170: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Or, sym(3).Expression); + AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, + QSOperator::Or, sym(3).Expression); + node->operatorToken = loc(2); + sym(1).Node = node; } break; case 172: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Or, sym(3).Expression); + AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, + QSOperator::Or, sym(3).Expression); + node->operatorToken = loc(2); + sym(1).Node = node; } break; case 174: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression, sym(5).Expression); + AST::ConditionalExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, + sym(3).Expression, sym(5).Expression); + node->questionToken = loc(2); + node->colonToken = loc(4); + sym(1).Node = node; } break; case 176: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression, sym(5).Expression); + AST::ConditionalExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, + sym(3).Expression, sym(5).Expression); + node->questionToken = loc(2); + node->colonToken = loc(4); + sym(1).Node = node; } break; case 178: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(2).ival, sym(3).Expression); + AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, + sym(2).ival, sym(3).Expression); + node->operatorToken = loc(2); + sym(1).Node = node; } break; case 180: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(2).ival, sym(3).Expression); + AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, + sym(2).ival, sym(3).Expression); + node->operatorToken = loc(2); + sym(1).Node = node; } break; case 181: { @@ -836,7 +1020,9 @@ case 192: { } break; case 194: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression); + AST::Expression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression); + node->commaToken = loc(2); + sym(1).Node = node; } break; case 195: { @@ -844,7 +1030,9 @@ case 195: { } break; case 198: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression); + AST::Expression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression); + node->commaToken = loc(2); + sym(1).Node = node; } break; case 199: { -- cgit v0.12 From eccf8f33890682a4827134805fa27bb354235e7a Mon Sep 17 00:00:00 2001 From: Roberto Raggi Date: Tue, 21 Apr 2009 17:53:28 +0200 Subject: Source locations for the statement nodes --- src/declarative/qml/parser/javascript.g | 180 ++++++++++++++++++++---- src/declarative/qml/parser/javascriptast_p.h | 73 ++++++++++ src/declarative/qml/parser/javascriptparser.cpp | 180 ++++++++++++++++++++---- 3 files changed, 371 insertions(+), 62 deletions(-) diff --git a/src/declarative/qml/parser/javascript.g b/src/declarative/qml/parser/javascript.g index 9d0baae..219610e 100644 --- a/src/declarative/qml/parser/javascript.g +++ b/src/declarative/qml/parser/javascript.g @@ -1906,7 +1906,10 @@ Statement: DebuggerStatement ; Block: T_LBRACE StatementListOpt T_RBRACE ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(2).StatementList); + AST::Block *node = makeAstNode (driver->nodePool(), sym(2).StatementList); + node->lbraceToken = loc(1); + node->rbraceToken = loc(3); + sym(1).Node = node; } break; ./ @@ -1942,7 +1945,8 @@ VariableStatement: VariableDeclarationKind VariableDeclarationList T_AUTOMATIC_S VariableStatement: VariableDeclarationKind VariableDeclarationList T_SEMICOLON ; /. case $rule_number: { - AST::VariableStatement *node = makeAstNode (driver->nodePool(), sym(2).VariableDeclarationList->finish (/*readOnly=*/sym(1).ival == T_CONST)); + AST::VariableStatement *node = makeAstNode (driver->nodePool(), + sym(2).VariableDeclarationList->finish (/*readOnly=*/sym(1).ival == T_CONST)); node->declarationKindToken = loc(1); node->semicolonToken = loc(3); sym(1).Node = node; @@ -1973,7 +1977,10 @@ case $rule_number: { VariableDeclarationList: VariableDeclarationList T_COMMA VariableDeclaration ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).VariableDeclarationList, sym(3).VariableDeclaration); + AST::VariableDeclarationList *node = makeAstNode (driver->nodePool(), + sym(1).VariableDeclarationList, sym(3).VariableDeclaration); + node->commaToken = loc(2); + sym(1).Node = node; } break; ./ @@ -2012,6 +2019,7 @@ case $rule_number: { Initialiser: T_EQ AssignmentExpression ; /. case $rule_number: { + // ### TODO: AST for initializer sym(1) = sym(2); } break; ./ @@ -2028,6 +2036,7 @@ InitialiserOpt: Initialiser ; InitialiserNotIn: T_EQ AssignmentExpressionNotIn ; /. case $rule_number: { + // ### TODO: AST for initializer sym(1) = sym(2); } break; ./ @@ -2044,7 +2053,9 @@ InitialiserNotInOpt: InitialiserNotIn ; EmptyStatement: T_SEMICOLON ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool()); + AST::EmptyStatement *node = makeAstNode (driver->nodePool()); + node->semicolonToken = loc(1); + sym(1).Node = node; } break; ./ @@ -2061,14 +2072,23 @@ case $rule_number: { IfStatement: T_IF T_LPAREN Expression T_RPAREN Statement T_ELSE Statement ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Statement, sym(7).Statement); + AST::IfStatement *node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Statement, sym(7).Statement); + node->ifToken = loc(1); + node->lparenToken = loc(2); + node->rparenToken = loc(4); + node->elseToken = loc(5); + sym(1).Node = node; } break; ./ IfStatement: T_IF T_LPAREN Expression T_RPAREN Statement ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Statement); + AST::IfStatement *node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Statement); + node->ifToken = loc(1); + node->lparenToken = loc(2); + node->rparenToken = loc(4); + sym(1).Node = node; } break; ./ @@ -2077,42 +2097,81 @@ IterationStatement: T_DO Statement T_WHILE T_LPAREN Expression T_RPAREN T_AUTOMA IterationStatement: T_DO Statement T_WHILE T_LPAREN Expression T_RPAREN T_SEMICOLON ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Statement, sym(5).Expression); + AST::DoWhileStatement *node = makeAstNode (driver->nodePool(), sym(2).Statement, sym(5).Expression); + node->doToken = loc(1); + node->whileToken = loc(3); + node->lparenToken = loc(4); + node->rparenToken = loc(6); + node->semicolonToken = loc(7); + sym(1).Node = node; } break; ./ IterationStatement: T_WHILE T_LPAREN Expression T_RPAREN Statement ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Statement); + AST::WhileStatement *node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Statement); + node->whileToken = loc(1); + node->lparenToken = loc(2); + node->rparenToken = loc(4); + sym(1).Node = node; } break; ./ IterationStatement: T_FOR T_LPAREN ExpressionNotInOpt T_SEMICOLON ExpressionOpt T_SEMICOLON ExpressionOpt T_RPAREN Statement ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Expression, sym(7).Expression, sym(9).Statement); + AST::ForStatement *node = makeAstNode (driver->nodePool(), sym(3).Expression, + sym(5).Expression, sym(7).Expression, sym(9).Statement); + node->forToken = loc(1); + node->lparenToken = loc(2); + node->firstSemicolonToken = loc(4); + node->secondSemicolonToken = loc(6); + node->rparenToken = loc(8); + sym(1).Node = node; } break; ./ IterationStatement: T_FOR T_LPAREN T_VAR VariableDeclarationListNotIn T_SEMICOLON ExpressionOpt T_SEMICOLON ExpressionOpt T_RPAREN Statement ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(4).VariableDeclarationList->finish (/*readOnly=*/false), sym(6).Expression, sym(8).Expression, sym(10).Statement); + AST::LocalForStatement *node = makeAstNode (driver->nodePool(), + sym(4).VariableDeclarationList->finish (/*readOnly=*/false), sym(6).Expression, + sym(8).Expression, sym(10).Statement); + node->forToken = loc(1); + node->lparenToken = loc(2); + node->varToken = loc(3); + node->firstSemicolonToken = loc(5); + node->secondSemicolonToken = loc(7); + node->rparenToken = loc(9); + sym(1).Node = node; } break; ./ IterationStatement: T_FOR T_LPAREN LeftHandSideExpression T_IN Expression T_RPAREN Statement ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Expression, sym(7).Statement); + AST:: ForEachStatement *node = makeAstNode (driver->nodePool(), sym(3).Expression, + sym(5).Expression, sym(7).Statement); + node->forToken = loc(1); + node->lparenToken = loc(2); + node->inToken = loc(4); + node->rparenToken = loc(6); + sym(1).Node = node; } break; ./ IterationStatement: T_FOR T_LPAREN T_VAR VariableDeclarationNotIn T_IN Expression T_RPAREN Statement ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(4).VariableDeclaration, sym(6).Expression, sym(8).Statement); + AST::LocalForEachStatement *node = makeAstNode (driver->nodePool(), + sym(4).VariableDeclaration, sym(6).Expression, sym(8).Statement); + node->forToken = loc(1); + node->lparenToken = loc(2); + node->varToken = loc(3); + node->inToken = loc(5); + node->rparenToken = loc(7); + sym(1).Node = node; } break; ./ @@ -2120,7 +2179,10 @@ ContinueStatement: T_CONTINUE T_AUTOMATIC_SEMICOLON ; -- automatic semicolon ContinueStatement: T_CONTINUE T_SEMICOLON ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool()); + AST::ContinueStatement *node = makeAstNode (driver->nodePool()); + node->continueToken = loc(1); + node->semicolonToken = loc(2); + sym(1).Node = node; } break; ./ @@ -2128,7 +2190,11 @@ ContinueStatement: T_CONTINUE T_IDENTIFIER T_AUTOMATIC_SEMICOLON ; -- automatic ContinueStatement: T_CONTINUE T_IDENTIFIER T_SEMICOLON ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(2).sval); + AST::ContinueStatement *node = makeAstNode (driver->nodePool(), sym(2).sval); + node->continueToken = loc(1); + node->identifierToken = loc(2); + node->semicolonToken = loc(3); + sym(1).Node = node; } break; ./ @@ -2136,7 +2202,10 @@ BreakStatement: T_BREAK T_AUTOMATIC_SEMICOLON ; -- automatic semicolon BreakStatement: T_BREAK T_SEMICOLON ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool()); + AST::BreakStatement *node = makeAstNode (driver->nodePool()); + node->breakToken = loc(1); + node->semicolonToken = loc(2); + sym(1).Node = node; } break; ./ @@ -2144,7 +2213,11 @@ BreakStatement: T_BREAK T_IDENTIFIER T_AUTOMATIC_SEMICOLON ; -- automatic semic BreakStatement: T_BREAK T_IDENTIFIER T_SEMICOLON ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(2).sval); + AST::BreakStatement *node = makeAstNode (driver->nodePool(), sym(2).sval); + node->breakToken = loc(1); + node->identifierToken = loc(2); + node->semicolonToken = loc(3); + sym(1).Node = node; } break; ./ @@ -2152,35 +2225,52 @@ ReturnStatement: T_RETURN ExpressionOpt T_AUTOMATIC_SEMICOLON ; -- automatic se ReturnStatement: T_RETURN ExpressionOpt T_SEMICOLON ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); + AST::ReturnStatement *node = makeAstNode (driver->nodePool(), sym(2).Expression); + node->returnToken = loc(1); + node->semicolonToken = loc(3); + sym(1).Node = node; } break; ./ WithStatement: T_WITH T_LPAREN Expression T_RPAREN Statement ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Statement); + AST::WithStatement *node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Statement); + node->withToken = loc(1); + node->lparenToken = loc(2); + node->rparenToken = loc(4); + sym(1).Node = node; } break; ./ SwitchStatement: T_SWITCH T_LPAREN Expression T_RPAREN CaseBlock ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).CaseBlock); + AST::SwitchStatement *node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).CaseBlock); + node->switchToken = loc(1); + node->lparenToken = loc(2); + node->rparenToken = loc(4); + sym(1).Node = node; } break; ./ CaseBlock: T_LBRACE CaseClausesOpt T_RBRACE ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(2).CaseClauses); + AST::CaseBlock *node = makeAstNode (driver->nodePool(), sym(2).CaseClauses); + node->lbraceToken = loc(1); + node->rbraceToken = loc(3); + sym(1).Node = node; } break; ./ CaseBlock: T_LBRACE CaseClausesOpt DefaultClause CaseClausesOpt T_RBRACE ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(2).CaseClauses, sym(3).DefaultClause, sym(4).CaseClauses); + AST::CaseBlock *node = makeAstNode (driver->nodePool(), sym(2).CaseClauses, sym(3).DefaultClause, sym(4).CaseClauses); + node->lbraceToken = loc(1); + node->rbraceToken = loc(5); + sym(1).Node = node; } break; ./ @@ -2215,21 +2305,30 @@ case $rule_number: { CaseClause: T_CASE Expression T_COLON StatementListOpt ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression, sym(4).StatementList); + AST::CaseClause *node = makeAstNode (driver->nodePool(), sym(2).Expression, sym(4).StatementList); + node->caseToken = loc(1); + node->colonToken = loc(3); + sym(1).Node = node; } break; ./ DefaultClause: T_DEFAULT T_COLON StatementListOpt ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(3).StatementList); + AST::DefaultClause *node = makeAstNode (driver->nodePool(), sym(3).StatementList); + node->defaultToken = loc(1); + node->colonToken = loc(2); + sym(1).Node = node; } break; ./ LabelledStatement: T_IDENTIFIER T_COLON Statement ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).sval, sym(3).Statement); + AST::LabelledStatement *node = makeAstNode (driver->nodePool(), sym(1).sval, sym(3).Statement); + node->identifierToken = loc(1); + node->colonToken = loc(2); + sym(1).Node = node; } break; ./ @@ -2237,42 +2336,58 @@ ThrowStatement: T_THROW Expression T_AUTOMATIC_SEMICOLON ; -- automatic semicol ThrowStatement: T_THROW Expression T_SEMICOLON ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); + AST::ThrowStatement *node = makeAstNode (driver->nodePool(), sym(2).Expression); + node->throwToken = loc(1); + node->semicolonToken = loc(3); + sym(1).Node = node; } break; ./ TryStatement: T_TRY Block Catch ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Statement, sym(3).Catch); + AST::TryStatement *node = makeAstNode (driver->nodePool(), sym(2).Statement, sym(3).Catch); + node->tryToken = loc(1); + sym(1).Node = node; } break; ./ TryStatement: T_TRY Block Finally ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Statement, sym(3).Finally); + AST::TryStatement *node = makeAstNode (driver->nodePool(), sym(2).Statement, sym(3).Finally); + node->tryToken = loc(1); + sym(1).Node = node; } break; ./ TryStatement: T_TRY Block Catch Finally ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Statement, sym(3).Catch, sym(4).Finally); + AST::TryStatement *node = makeAstNode (driver->nodePool(), sym(2).Statement, sym(3).Catch, sym(4).Finally); + node->tryToken = loc(1); + sym(1).Node = node; } break; ./ Catch: T_CATCH T_LPAREN T_IDENTIFIER T_RPAREN Block ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(3).sval, sym(5).Statement); + AST::Catch *node = makeAstNode (driver->nodePool(), sym(3).sval, sym(5).Statement); + node->catchToken = loc(1); + node->lparenToken = loc(2); + node->identifierToken = loc(3); + node->rparenToken = loc(4); + sym(1).Node = node; } break; ./ Finally: T_FINALLY Block ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Statement); + AST::Finally *node = makeAstNode (driver->nodePool(), sym(2).Statement); + node->finallyToken = loc(1); + sym(1).Node = node; } break; ./ @@ -2280,7 +2395,10 @@ DebuggerStatement: T_DEBUGGER T_AUTOMATIC_SEMICOLON ; -- automatic semicolon DebuggerStatement: T_DEBUGGER T_SEMICOLON ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool()); + AST::DebuggerStatement *node = makeAstNode (driver->nodePool()); + node->debuggerToken = loc(1); + node->semicolonToken = loc(2); + sym(1).Node = node; } break; ./ diff --git a/src/declarative/qml/parser/javascriptast_p.h b/src/declarative/qml/parser/javascriptast_p.h index 93f700f..56b2ec6 100644 --- a/src/declarative/qml/parser/javascriptast_p.h +++ b/src/declarative/qml/parser/javascriptast_p.h @@ -1004,6 +1004,8 @@ public: // attributes StatementList *statements; + SourceLocation lbraceToken; + SourceLocation rbraceToken; }; class StatementList: public Node @@ -1114,6 +1116,7 @@ public: // attributes VariableDeclaration *declaration; VariableDeclarationList *next; + SourceLocation commaToken; }; class EmptyStatement: public Statement @@ -1125,6 +1128,9 @@ public: virtual ~EmptyStatement() {} virtual void accept0(Visitor *visitor); + +// attributes + SourceLocation semicolonToken; }; class ExpressionStatement: public Statement @@ -1161,6 +1167,10 @@ public: ExpressionNode *expression; Statement *ok; Statement *ko; + SourceLocation ifToken; + SourceLocation lparenToken; + SourceLocation rparenToken; + SourceLocation elseToken; }; class DoWhileStatement: public Statement @@ -1179,6 +1189,11 @@ public: // attributes Statement *statement; ExpressionNode *expression; + SourceLocation doToken; + SourceLocation whileToken; + SourceLocation lparenToken; + SourceLocation rparenToken; + SourceLocation semicolonToken; }; class WhileStatement: public Statement @@ -1197,6 +1212,9 @@ public: // attributes ExpressionNode *expression; Statement *statement; + SourceLocation whileToken; + SourceLocation lparenToken; + SourceLocation rparenToken; }; class ForStatement: public Statement @@ -1217,6 +1235,11 @@ public: ExpressionNode *condition; ExpressionNode *expression; Statement *statement; + SourceLocation forToken; + SourceLocation lparenToken; + SourceLocation firstSemicolonToken; + SourceLocation secondSemicolonToken; + SourceLocation rparenToken; }; class LocalForStatement: public Statement @@ -1237,6 +1260,12 @@ public: ExpressionNode *condition; ExpressionNode *expression; Statement *statement; + SourceLocation forToken; + SourceLocation lparenToken; + SourceLocation varToken; + SourceLocation firstSemicolonToken; + SourceLocation secondSemicolonToken; + SourceLocation rparenToken; }; class ForEachStatement: public Statement @@ -1256,6 +1285,10 @@ public: ExpressionNode *initialiser; ExpressionNode *expression; Statement *statement; + SourceLocation forToken; + SourceLocation lparenToken; + SourceLocation inToken; + SourceLocation rparenToken; }; class LocalForEachStatement: public Statement @@ -1275,6 +1308,11 @@ public: VariableDeclaration *declaration; ExpressionNode *expression; Statement *statement; + SourceLocation forToken; + SourceLocation lparenToken; + SourceLocation varToken; + SourceLocation inToken; + SourceLocation rparenToken; }; class ContinueStatement: public Statement @@ -1291,6 +1329,9 @@ public: // attributes JavaScriptNameIdImpl *label; + SourceLocation continueToken; + SourceLocation identifierToken; + SourceLocation semicolonToken; }; class BreakStatement: public Statement @@ -1307,6 +1348,9 @@ public: // attributes JavaScriptNameIdImpl *label; + SourceLocation breakToken; + SourceLocation identifierToken; + SourceLocation semicolonToken; }; class ReturnStatement: public Statement @@ -1323,6 +1367,8 @@ public: // attributes ExpressionNode *expression; + SourceLocation returnToken; + SourceLocation semicolonToken; }; class WithStatement: public Statement @@ -1341,6 +1387,9 @@ public: // attributes ExpressionNode *expression; Statement *statement; + SourceLocation withToken; + SourceLocation lparenToken; + SourceLocation rparenToken; }; class SwitchStatement: public Statement @@ -1359,6 +1408,9 @@ public: // attributes ExpressionNode *expression; CaseBlock *block; + SourceLocation switchToken; + SourceLocation lparenToken; + SourceLocation rparenToken; }; class CaseBlock: public Node @@ -1378,6 +1430,8 @@ public: CaseClauses *clauses; DefaultClause *defaultClause; CaseClauses *moreClauses; + SourceLocation lbraceToken; + SourceLocation rbraceToken; }; class CaseClauses: public Node @@ -1429,6 +1483,8 @@ public: // attributes ExpressionNode *expression; StatementList *statements; + SourceLocation caseToken; + SourceLocation colonToken; }; class DefaultClause: public Node @@ -1446,6 +1502,8 @@ public: // attributes StatementList *statements; + SourceLocation defaultToken; + SourceLocation colonToken; }; class LabelledStatement: public Statement @@ -1464,6 +1522,9 @@ public: // attributes JavaScriptNameIdImpl *label; Statement *statement; + SourceLocation identifierToken; + SourceLocation colonToken; + SourceLocation semicolonToken; }; class ThrowStatement: public Statement @@ -1480,6 +1541,8 @@ public: // attributes ExpressionNode *expression; + SourceLocation throwToken; + SourceLocation semicolonToken; }; class TryStatement: public Statement @@ -1507,6 +1570,7 @@ public: Statement *statement; Catch *catchExpression; Finally *finallyExpression; + SourceLocation tryToken; }; class Catch: public Node @@ -1525,6 +1589,10 @@ public: // attributes JavaScriptNameIdImpl *name; Statement *statement; + SourceLocation catchToken; + SourceLocation lparenToken; + SourceLocation identifierToken; + SourceLocation rparenToken; }; class Finally: public Node @@ -1542,6 +1610,7 @@ public: // attributes Statement *statement; + SourceLocation finallyToken; }; class FunctionExpression: public ExpressionNode @@ -1741,6 +1810,10 @@ public: virtual ~DebuggerStatement() {} virtual void accept0(Visitor *visitor); + +// attributes + SourceLocation debuggerToken; + SourceLocation semicolonToken; }; class UiProgram: public Node diff --git a/src/declarative/qml/parser/javascriptparser.cpp b/src/declarative/qml/parser/javascriptparser.cpp index b46edfc..8708516 100644 --- a/src/declarative/qml/parser/javascriptparser.cpp +++ b/src/declarative/qml/parser/javascriptparser.cpp @@ -1040,7 +1040,10 @@ case 199: { } break; case 216: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(2).StatementList); + AST::Block *node = makeAstNode (driver->nodePool(), sym(2).StatementList); + node->lbraceToken = loc(1); + node->rbraceToken = loc(3); + sym(1).Node = node; } break; case 217: { @@ -1060,7 +1063,8 @@ case 220: { } break; case 222: { - AST::VariableStatement *node = makeAstNode (driver->nodePool(), sym(2).VariableDeclarationList->finish (/*readOnly=*/sym(1).ival == T_CONST)); + AST::VariableStatement *node = makeAstNode (driver->nodePool(), + sym(2).VariableDeclarationList->finish (/*readOnly=*/sym(1).ival == T_CONST)); node->declarationKindToken = loc(1); node->semicolonToken = loc(3); sym(1).Node = node; @@ -1079,7 +1083,10 @@ case 225: { } break; case 226: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).VariableDeclarationList, sym(3).VariableDeclaration); + AST::VariableDeclarationList *node = makeAstNode (driver->nodePool(), + sym(1).VariableDeclarationList, sym(3).VariableDeclaration); + node->commaToken = loc(2); + sym(1).Node = node; } break; case 227: { @@ -1103,6 +1110,7 @@ case 230: { } break; case 231: { + // ### TODO: AST for initializer sym(1) = sym(2); } break; @@ -1111,6 +1119,7 @@ case 232: { } break; case 234: { + // ### TODO: AST for initializer sym(1) = sym(2); } break; @@ -1119,7 +1128,9 @@ case 235: { } break; case 237: { - sym(1).Node = makeAstNode (driver->nodePool()); + AST::EmptyStatement *node = makeAstNode (driver->nodePool()); + node->semicolonToken = loc(1); + sym(1).Node = node; } break; case 239: { @@ -1129,71 +1140,150 @@ case 239: { } break; case 240: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Statement, sym(7).Statement); + AST::IfStatement *node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Statement, sym(7).Statement); + node->ifToken = loc(1); + node->lparenToken = loc(2); + node->rparenToken = loc(4); + node->elseToken = loc(5); + sym(1).Node = node; } break; case 241: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Statement); + AST::IfStatement *node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Statement); + node->ifToken = loc(1); + node->lparenToken = loc(2); + node->rparenToken = loc(4); + sym(1).Node = node; } break; case 243: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Statement, sym(5).Expression); + AST::DoWhileStatement *node = makeAstNode (driver->nodePool(), sym(2).Statement, sym(5).Expression); + node->doToken = loc(1); + node->whileToken = loc(3); + node->lparenToken = loc(4); + node->rparenToken = loc(6); + node->semicolonToken = loc(7); + sym(1).Node = node; } break; case 244: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Statement); + AST::WhileStatement *node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Statement); + node->whileToken = loc(1); + node->lparenToken = loc(2); + node->rparenToken = loc(4); + sym(1).Node = node; } break; case 245: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Expression, sym(7).Expression, sym(9).Statement); + AST::ForStatement *node = makeAstNode (driver->nodePool(), sym(3).Expression, + sym(5).Expression, sym(7).Expression, sym(9).Statement); + node->forToken = loc(1); + node->lparenToken = loc(2); + node->firstSemicolonToken = loc(4); + node->secondSemicolonToken = loc(6); + node->rparenToken = loc(8); + sym(1).Node = node; } break; case 246: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(4).VariableDeclarationList->finish (/*readOnly=*/false), sym(6).Expression, sym(8).Expression, sym(10).Statement); + AST::LocalForStatement *node = makeAstNode (driver->nodePool(), + sym(4).VariableDeclarationList->finish (/*readOnly=*/false), sym(6).Expression, + sym(8).Expression, sym(10).Statement); + node->forToken = loc(1); + node->lparenToken = loc(2); + node->varToken = loc(3); + node->firstSemicolonToken = loc(5); + node->secondSemicolonToken = loc(7); + node->rparenToken = loc(9); + sym(1).Node = node; } break; case 247: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Expression, sym(7).Statement); + AST:: ForEachStatement *node = makeAstNode (driver->nodePool(), sym(3).Expression, + sym(5).Expression, sym(7).Statement); + node->forToken = loc(1); + node->lparenToken = loc(2); + node->inToken = loc(4); + node->rparenToken = loc(6); + sym(1).Node = node; } break; case 248: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(4).VariableDeclaration, sym(6).Expression, sym(8).Statement); + AST::LocalForEachStatement *node = makeAstNode (driver->nodePool(), + sym(4).VariableDeclaration, sym(6).Expression, sym(8).Statement); + node->forToken = loc(1); + node->lparenToken = loc(2); + node->varToken = loc(3); + node->inToken = loc(5); + node->rparenToken = loc(7); + sym(1).Node = node; } break; case 250: { - sym(1).Node = makeAstNode (driver->nodePool()); + AST::ContinueStatement *node = makeAstNode (driver->nodePool()); + node->continueToken = loc(1); + node->semicolonToken = loc(2); + sym(1).Node = node; } break; case 252: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(2).sval); + AST::ContinueStatement *node = makeAstNode (driver->nodePool(), sym(2).sval); + node->continueToken = loc(1); + node->identifierToken = loc(2); + node->semicolonToken = loc(3); + sym(1).Node = node; } break; case 254: { - sym(1).Node = makeAstNode (driver->nodePool()); + AST::BreakStatement *node = makeAstNode (driver->nodePool()); + node->breakToken = loc(1); + node->semicolonToken = loc(2); + sym(1).Node = node; } break; case 256: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(2).sval); + AST::BreakStatement *node = makeAstNode (driver->nodePool(), sym(2).sval); + node->breakToken = loc(1); + node->identifierToken = loc(2); + node->semicolonToken = loc(3); + sym(1).Node = node; } break; case 258: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); + AST::ReturnStatement *node = makeAstNode (driver->nodePool(), sym(2).Expression); + node->returnToken = loc(1); + node->semicolonToken = loc(3); + sym(1).Node = node; } break; case 259: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Statement); + AST::WithStatement *node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Statement); + node->withToken = loc(1); + node->lparenToken = loc(2); + node->rparenToken = loc(4); + sym(1).Node = node; } break; case 260: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).CaseBlock); + AST::SwitchStatement *node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).CaseBlock); + node->switchToken = loc(1); + node->lparenToken = loc(2); + node->rparenToken = loc(4); + sym(1).Node = node; } break; case 261: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(2).CaseClauses); + AST::CaseBlock *node = makeAstNode (driver->nodePool(), sym(2).CaseClauses); + node->lbraceToken = loc(1); + node->rbraceToken = loc(3); + sym(1).Node = node; } break; case 262: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(2).CaseClauses, sym(3).DefaultClause, sym(4).CaseClauses); + AST::CaseBlock *node = makeAstNode (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 263: { @@ -1213,43 +1303,71 @@ case 266: { } break; case 267: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression, sym(4).StatementList); + AST::CaseClause *node = makeAstNode (driver->nodePool(), sym(2).Expression, sym(4).StatementList); + node->caseToken = loc(1); + node->colonToken = loc(3); + sym(1).Node = node; } break; case 268: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(3).StatementList); + AST::DefaultClause *node = makeAstNode (driver->nodePool(), sym(3).StatementList); + node->defaultToken = loc(1); + node->colonToken = loc(2); + sym(1).Node = node; } break; case 269: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(1).sval, sym(3).Statement); + AST::LabelledStatement *node = makeAstNode (driver->nodePool(), sym(1).sval, sym(3).Statement); + node->identifierToken = loc(1); + node->colonToken = loc(2); + sym(1).Node = node; } break; case 271: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Expression); + AST::ThrowStatement *node = makeAstNode (driver->nodePool(), sym(2).Expression); + node->throwToken = loc(1); + node->semicolonToken = loc(3); + sym(1).Node = node; } break; case 272: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Statement, sym(3).Catch); + AST::TryStatement *node = makeAstNode (driver->nodePool(), sym(2).Statement, sym(3).Catch); + node->tryToken = loc(1); + sym(1).Node = node; } break; case 273: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Statement, sym(3).Finally); + AST::TryStatement *node = makeAstNode (driver->nodePool(), sym(2).Statement, sym(3).Finally); + node->tryToken = loc(1); + sym(1).Node = node; } break; case 274: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Statement, sym(3).Catch, sym(4).Finally); + AST::TryStatement *node = makeAstNode (driver->nodePool(), sym(2).Statement, sym(3).Catch, sym(4).Finally); + node->tryToken = loc(1); + sym(1).Node = node; } break; case 275: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(3).sval, sym(5).Statement); + AST::Catch *node = makeAstNode (driver->nodePool(), sym(3).sval, sym(5).Statement); + node->catchToken = loc(1); + node->lparenToken = loc(2); + node->identifierToken = loc(3); + node->rparenToken = loc(4); + sym(1).Node = node; } break; case 276: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(2).Statement); + AST::Finally *node = makeAstNode (driver->nodePool(), sym(2).Statement); + node->finallyToken = loc(1); + sym(1).Node = node; } break; case 278: { - sym(1).Node = makeAstNode (driver->nodePool()); + AST::DebuggerStatement *node = makeAstNode (driver->nodePool()); + node->debuggerToken = loc(1); + node->semicolonToken = loc(2); + sym(1).Node = node; } break; case 279: { -- cgit v0.12 From 772c321abef5d7c0fca38e3d8045d5a0c7c27ec9 Mon Sep 17 00:00:00 2001 From: mae Date: Tue, 21 Apr 2009 18:08:59 +0200 Subject: map the ParentChange qml tag to a ParentChangeSet in dui. It might be a consideration to use the former moveToParent property, maybe it was a bit hacky, but less to type. --- src/declarative/qml/qmlscriptparser.cpp | 277 ++++++++++++++++++++------------ tools/qmlconv/qmlconv.cpp | 44 +++-- 2 files changed, 203 insertions(+), 118 deletions(-) diff --git a/src/declarative/qml/qmlscriptparser.cpp b/src/declarative/qml/qmlscriptparser.cpp index ba127ef..53ed6ab 100644 --- a/src/declarative/qml/qmlscriptparser.cpp +++ b/src/declarative/qml/qmlscriptparser.cpp @@ -65,8 +65,12 @@ protected: AST::UiQualifiedId *propertyName, const QString &objectType, AST::UiObjectInitializer *initializer = 0); - QString getPrimitive(const QByteArray &propertyName, AST::ExpressionNode *expr); - void defineProperty(const QString &propertyName, int line, const QString &primitive); + Object *defineObjectBinding_helper(int line, + AST::UiQualifiedId *propertyName, + const QString &objectType, + AST::UiObjectInitializer *initializer = 0); + QString getPrimitive(const QByteArray &propertyName, AST::ExpressionNode *expr); + void defineProperty(const QString &propertyName, int line, const QString &primitive); using AST::Visitor::visit; using AST::Visitor::endVisit; @@ -159,7 +163,7 @@ QString ProcessAST::asString(AST::UiQualifiedId *node) const return s; } -Object *ProcessAST::defineObjectBinding(int line, +Object *ProcessAST::defineObjectBinding_helper(int line, AST::UiQualifiedId *propertyName, const QString &objectType, AST::UiObjectInitializer *initializer) @@ -229,85 +233,15 @@ Object *ProcessAST::defineObjectBinding(int line, return obj; } -void ProcessAST::defineProperty(const QString &propertyName, int line, const QString &primitive) -{ - _stateStack.pushProperty(propertyName, line); - Value *value = new Value; - value->primitive = primitive; - value->line = line; - currentProperty()->addValue(value); - _stateStack.pop(); -} - -// UiProgram: UiImportListOpt UiObjectMemberList ; -bool ProcessAST::visit(AST::UiProgram *node) -{ - accept(node->imports); - accept(node->members->member); - return false; -} - -// UiImport: T_IMPORT T_STRING_LITERAL ; -bool ProcessAST::visit(AST::UiImport *node) -{ - QString fileName = node->fileName->asString(); - _parser->addNamespacePath(fileName); - return false; -} - -// UiObjectMember: T_PUBLIC T_IDENTIFIER T_IDENTIFIER T_COLON Expression UiObjectInitializer ; -bool ProcessAST::visit(AST::UiPublicMember *node) +Object *ProcessAST::defineObjectBinding(int line, + AST::UiQualifiedId *qualifiedId, + const QString &objectType, + AST::UiObjectInitializer *initializer) { - const QString type = node->type->asString(); - const QString name = node->name->asString(); - - if (type == QLatin1String("property")) { - _stateStack.pushProperty(QLatin1String("properties"), node->publicToken.startLine); - - Object *obj = defineObjectBinding(node->identifierToken.startLine, - 0, - QLatin1String("Property")); - - _stateStack.pushObject(obj); - - defineProperty(QLatin1String("name"), node->identifierToken.startLine, name); - if (node->expression) // default value - defineProperty(QLatin1String("value"), node->identifierToken.startLine, getPrimitive("value", node->expression)); - - _stateStack.pop(); // object - _stateStack.pop(); // properties - - } else if (type == QLatin1String("signal")) { - _stateStack.pushProperty(QLatin1String("signals"), node->publicToken.startLine); - - Object *obj = defineObjectBinding(node->identifierToken.startLine, - 0, - QLatin1String("Signal")); - - _stateStack.pushObject(obj); - defineProperty(QLatin1String("name"), node->identifierToken.startLine, name); + if (objectType == QLatin1String("Connection")) { - _stateStack.pop(); // object - _stateStack.pop(); // signals - } else { - qWarning() << "bad public identifier" << type; // ### FIXME - } - - - // ### TODO drop initializer (unless some example needs differnet properties than name and type and value. - - return false; -} - - -// UiObjectMember: T_IDENTIFIER UiObjectInitializer ; -bool ProcessAST::visit(AST::UiObjectDefinition *node) -{ - if (node->name->asString() == QLatin1String("Connection")) { - - AST::UiObjectMemberList *it = node->initializer->members; - int line = node->identifierToken.startLine; + AST::UiObjectMemberList *it = initializer->members; QString sender; QString signal; @@ -349,9 +283,9 @@ bool ProcessAST::visit(AST::UiObjectDefinition *node) //### TODO generate error } } - Object *obj = defineObjectBinding(line, - 0, - QLatin1String("Connection")); + Object *obj = defineObjectBinding_helper(line, + 0, + QLatin1String("Connection")); _stateStack.pushObject(obj); if (!sender.isEmpty()) @@ -361,24 +295,12 @@ bool ProcessAST::visit(AST::UiObjectDefinition *node) if (!signal.isEmpty()) defineProperty(QLatin1String("signal"), line, signal); _stateStack.pop(); // object - } else { - defineObjectBinding(node->identifierToken.startLine, - 0, - node->name->asString(), - node->initializer); - } - return false; -} + return obj; + } else if (objectType == QLatin1String("PropertyChangeSet")) { -// UiObjectMember: UiQualifiedId T_COLON T_IDENTIFIER UiObjectInitializer ; -bool ProcessAST::visit(AST::UiObjectBinding *node) -{ - if (asString(node->qualifiedId) == QLatin1String("propertyChangeSet") - && node->name->asString() == QLatin1String("PropertyChangeSet")) { - - AST::UiObjectMemberList *it = node->initializer->members; + AST::UiObjectMemberList *it = initializer->members; for (; it; it = it->next) { AST::UiScriptBinding *scriptBinding = AST::cast(it->member); if (!scriptBinding) @@ -408,9 +330,9 @@ bool ProcessAST::visit(AST::UiObjectBinding *node) // #### TODO generate error } - Object *obj = defineObjectBinding(node->identifierToken.startLine, - 0, - QLatin1String("SetProperty")); + Object *obj = defineObjectBinding_helper(line, + 0, + QLatin1String("SetProperty")); _stateStack.pushObject(obj); if (!target.isEmpty()) @@ -420,14 +342,159 @@ bool ProcessAST::visit(AST::UiObjectBinding *node) if (!value.isEmpty()) defineProperty(QLatin1String("value"), scriptBinding->colonToken.startLine, value); _stateStack.pop(); // object + } - } else { - defineObjectBinding(node->identifierToken.startLine, - node->qualifiedId, - node->name->asString(), - node->initializer); + return 0; + } else if (objectType == QLatin1String("ParentChangeSet")) { + + AST::UiObjectMemberList *it = initializer->members; + for (; it; it = it->next) { + AST::UiScriptBinding *scriptBinding = AST::cast(it->member); + if (!scriptBinding) + continue; // ### TODO generate error + + + QString target; + QString property; + QString parent; + + int propertyCount = 0; + AST::UiQualifiedId *propertyName = scriptBinding->qualifiedId; + for (; propertyName; propertyName = propertyName->next){ + if (propertyName->next) { + if (!target.isEmpty()) + target += QLatin1Char('.'); + target += propertyName->name->asString(); + } else { + property = propertyName->name->asString(); + } + ++propertyCount; + } + + if (property != QLatin1String("parent")) { + // ### TODO generate error + } else { + + if (AST::ExpressionStatement *stmt = AST::cast(scriptBinding->statement)) { + parent = getPrimitive(property.toLatin1(), stmt->expression); + } else { + // #### TODO generate error + } + + Object *obj = defineObjectBinding_helper(line, + 0, + QLatin1String("ParentChange")); + + _stateStack.pushObject(obj); + if (!target.isEmpty()) + defineProperty(QLatin1String("target"), scriptBinding->colonToken.startLine, QLatin1Char('{') + target + QLatin1Char('}')); + if (!parent.isEmpty()) + defineProperty(QLatin1String("parent"), scriptBinding->colonToken.startLine, parent); + _stateStack.pop(); // object + } + + } + + return 0; } + + return defineObjectBinding_helper(line, qualifiedId, objectType, initializer); +} + +void ProcessAST::defineProperty(const QString &propertyName, int line, const QString &primitive) +{ + _stateStack.pushProperty(propertyName, line); + Value *value = new Value; + value->primitive = primitive; + value->line = line; + currentProperty()->addValue(value); + _stateStack.pop(); +} + +// UiProgram: UiImportListOpt UiObjectMemberList ; +bool ProcessAST::visit(AST::UiProgram *node) +{ + accept(node->imports); + accept(node->members->member); + return false; +} + +// UiImport: T_IMPORT T_STRING_LITERAL ; +bool ProcessAST::visit(AST::UiImport *node) +{ + QString fileName = node->fileName->asString(); + _parser->addNamespacePath(fileName); + return false; +} + +// UiObjectMember: T_PUBLIC T_IDENTIFIER T_IDENTIFIER T_COLON Expression UiObjectInitializer ; +bool ProcessAST::visit(AST::UiPublicMember *node) +{ + const QString type = node->type->asString(); + const QString name = node->name->asString(); + + if (type == QLatin1String("property")) { + _stateStack.pushProperty(QLatin1String("properties"), node->publicToken.startLine); + + Object *obj = defineObjectBinding(node->identifierToken.startLine, + 0, + QLatin1String("Property")); + + _stateStack.pushObject(obj); + + defineProperty(QLatin1String("name"), node->identifierToken.startLine, name); + if (node->expression) // default value + defineProperty(QLatin1String("value"), node->identifierToken.startLine, getPrimitive("value", node->expression)); + + _stateStack.pop(); // object + _stateStack.pop(); // properties + + } else if (type == QLatin1String("signal")) { + _stateStack.pushProperty(QLatin1String("signals"), node->publicToken.startLine); + + Object *obj = defineObjectBinding(node->identifierToken.startLine, + 0, + QLatin1String("Signal")); + + _stateStack.pushObject(obj); + + defineProperty(QLatin1String("name"), node->identifierToken.startLine, name); + + _stateStack.pop(); // object + _stateStack.pop(); // signals + } else { + qWarning() << "bad public identifier" << type; // ### FIXME + } + + + // ### TODO drop initializer (unless some example needs differnet properties than name and type and value. + + return false; +} + + +// UiObjectMember: T_IDENTIFIER UiObjectInitializer ; +bool ProcessAST::visit(AST::UiObjectDefinition *node) +{ + + defineObjectBinding(node->identifierToken.startLine, + 0, + node->name->asString(), + node->initializer); + + return false; +} + + +// UiObjectMember: UiQualifiedId T_COLON T_IDENTIFIER UiObjectInitializer ; +bool ProcessAST::visit(AST::UiObjectBinding *node) +{ + defineObjectBinding(node->identifierToken.startLine, + node->qualifiedId, + node->name->asString(), + node->initializer); + return false; } diff --git a/tools/qmlconv/qmlconv.cpp b/tools/qmlconv/qmlconv.cpp index 139a1b0..1bfabb1 100644 --- a/tools/qmlconv/qmlconv.cpp +++ b/tools/qmlconv/qmlconv.cpp @@ -77,6 +77,13 @@ public: } void startElement() { + + if (!propertyChangeSet.isEmpty() + && xml.name() != "SetProperties" + && xml.name() != "SetProperty") { + clearPropertyChangeSet(); + } + if (xml.name() == "properties") startDeclareProperties(); else if (xml.name() == "signals") @@ -183,24 +190,14 @@ public: out << depthString() << name << " {" << endl; ++depth; - if (name == "State") - propertyChangeSet.clear(); - foreach (QXmlStreamAttribute attribute, xml.attributes()) { setProperty(attribute.name().toString(), attribute.value().toString()); } loop(); - if (name == "State" && !propertyChangeSet.isEmpty()) { - out << depthString() << "propertyChangeSet: PropertyChangeSet" << " {" << endl; - ++depth; - foreach(StringPair pair, propertyChangeSet) - setProperty(pair.first, pair.second); - --depth; - out << depthString() << "}" << endl; - propertyChangeSet.clear(); - } + if (name == "State") + clearPropertyChangeSet(); --depth; out << depthString() << "}"; @@ -208,6 +205,19 @@ public: out << endl; } + void clearPropertyChangeSet() { + if (propertyChangeSet.isEmpty()) + return; + + out << depthString() << "PropertyChangeSet" << " {" << endl; + ++depth; + foreach(StringPair pair, propertyChangeSet) + setProperty(pair.first, pair.second); + --depth; + out << depthString() << "}" << endl; + propertyChangeSet.clear(); + } + void startObjectProperty() { QString name = xml.name().toString(); @@ -312,7 +322,15 @@ public: void startParentChange() { QString target = xml.attributes().value("target").toString(); possiblyRemoveBraces(&target); - propertyChangeSet += StringPair(target + ".moveToParent", xml.attributes().value("parent").toString()); + + out << depthString() << "ParentChangeSet" << " {" << endl; + ++depth; + setProperty(target + ".parent", xml.attributes().value("parent").toString()); + --depth; + out << depthString() << "}" << endl; + +// propertyChangeSet += StringPair(target + ".moveToParent", xml.attributes().value("parent").toString()); + emptyLoop(); } -- cgit v0.12 From 2c0e87db61c4f5e31585b7b0d4d6f5f7ad25a5f5 Mon Sep 17 00:00:00 2001 From: mae Date: Tue, 21 Apr 2009 18:51:45 +0200 Subject: small cleanups --- src/declarative/qml/qmlscriptparser.cpp | 11 ----------- tools/qmlconv/qmlconv.cpp | 13 +++++++++++-- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/src/declarative/qml/qmlscriptparser.cpp b/src/declarative/qml/qmlscriptparser.cpp index 53ed6ab..22169a5 100644 --- a/src/declarative/qml/qmlscriptparser.cpp +++ b/src/declarative/qml/qmlscriptparser.cpp @@ -506,17 +506,6 @@ QString ProcessAST::getPrimitive(const QByteArray &propertyName, AST::Expression if(isSignalProperty(propertyName)) { pp(expr); - - // here comes a cruel hack until we support functions properly with arguments for signal properties - if (primitive.startsWith(QLatin1String("function("))) { - int brace = 0; - for (;brace < primitive.size(); ++brace) - if (primitive.at(brace) == QLatin1Char('{')) - break; - primitive = primitive.mid(brace + 1, primitive.size() - brace - 2); - } - //end of hack - } else if (propertyName == "id" && expr && expr->kind == AST::Node::Kind_IdentifierExpression) { primitive = AST::cast(expr)->name->asString(); } else if (expr->kind == AST::Node::Kind_StringLiteral) { diff --git a/tools/qmlconv/qmlconv.cpp b/tools/qmlconv/qmlconv.cpp index 1bfabb1..6448414 100644 --- a/tools/qmlconv/qmlconv.cpp +++ b/tools/qmlconv/qmlconv.cpp @@ -88,6 +88,10 @@ public: startDeclareProperties(); else if (xml.name() == "signals") startDeclareSignals(); +// else if (xml.name() == "states") +// loop(); // ignore +// else if (xml.name() == "transitions") +// loop(); // ignore else if (knownListProperties.contains(xml.name().toString())) startList(); else if (xml.name() == "SetProperties") @@ -174,10 +178,15 @@ public: v.prepend('\"'); v.append('\"'); } + +// QByteArray semiColon = ";"; +// if (v.endsWith(QLatin1Char('}')) || v.endsWith(QLatin1Char(';'))) +// semiColon.clear(); + if (!newline) - out << property << ": " << v; + out << property << ": " << v /* << semiColon.constData() */; else - out << depthString() << property << ": " << v << endl; + out << depthString() << property << ": " << v /* << semiColon.constData() */ << endl; } -- cgit v0.12 From 6cff4b9dcc3095cb2dfc1dc9653a7bf958fe91d3 Mon Sep 17 00:00:00 2001 From: mae Date: Tue, 21 Apr 2009 19:10:54 +0200 Subject: experiment with treating State and Transition slightly special: they are automatically added to the states resp. transitions property. This allows us to make the [...,...,...,...] list syntax superfluous. --- src/declarative/qml/qmlscriptparser.cpp | 10 ++++++++++ tools/qmlconv/qmlconv.cpp | 8 ++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/declarative/qml/qmlscriptparser.cpp b/src/declarative/qml/qmlscriptparser.cpp index 22169a5..03e6165 100644 --- a/src/declarative/qml/qmlscriptparser.cpp +++ b/src/declarative/qml/qmlscriptparser.cpp @@ -397,6 +397,16 @@ Object *ProcessAST::defineObjectBinding(int line, } return 0; + } else if(!currentProperty() && objectType == QLatin1String("State")) { + _stateStack.pushProperty(QLatin1String("states"), line); + Object *obj = defineObjectBinding_helper(line, 0, objectType, initializer); + _stateStack.pop(); + return obj; + } else if (!currentProperty() && objectType == QLatin1String("Transition")) { + _stateStack.pushProperty(QLatin1String("transitions"), line); + Object *obj = defineObjectBinding_helper(line, 0, objectType, initializer); + _stateStack.pop(); + return obj; } return defineObjectBinding_helper(line, qualifiedId, objectType, initializer); diff --git a/tools/qmlconv/qmlconv.cpp b/tools/qmlconv/qmlconv.cpp index 6448414..f18ac75 100644 --- a/tools/qmlconv/qmlconv.cpp +++ b/tools/qmlconv/qmlconv.cpp @@ -88,10 +88,10 @@ public: startDeclareProperties(); else if (xml.name() == "signals") startDeclareSignals(); -// else if (xml.name() == "states") -// loop(); // ignore -// else if (xml.name() == "transitions") -// loop(); // ignore + else if (xml.name() == "states") + loop(); // ignore + else if (xml.name() == "transitions") + loop(); // ignore else if (knownListProperties.contains(xml.name().toString())) startList(); else if (xml.name() == "SetProperties") -- cgit v0.12 From c9c559b606664681af5e87c6a2128c8c0b1979d0 Mon Sep 17 00:00:00 2001 From: Roberto Raggi Date: Wed, 22 Apr 2009 16:17:39 +0200 Subject: Removed the UiObjectInitialized from UiPublicMember. --- src/declarative/qml/parser/javascript.g | 15 +- src/declarative/qml/parser/javascriptast.cpp | 1 - src/declarative/qml/parser/javascriptast_p.h | 15 +- src/declarative/qml/parser/javascriptgrammar.cpp | 1052 +++++++++++----------- src/declarative/qml/parser/javascriptgrammar_p.h | 34 +- src/declarative/qml/parser/javascriptparser.cpp | 370 ++++---- src/declarative/qml/parser/javascriptparser_p.h | 4 +- src/declarative/qml/qmlscriptparser.cpp | 13 +- 8 files changed, 755 insertions(+), 749 deletions(-) diff --git a/src/declarative/qml/parser/javascript.g b/src/declarative/qml/parser/javascript.g index 219610e..3686aac 100644 --- a/src/declarative/qml/parser/javascript.g +++ b/src/declarative/qml/parser/javascript.g @@ -618,19 +618,6 @@ case $rule_number: { } break; ./ -UiObjectMember: T_PUBLIC T_IDENTIFIER T_IDENTIFIER T_COLON Expression UiObjectInitializer ; -/. -case $rule_number: { - AST::UiPublicMember *node = makeAstNode (driver->nodePool(), sym(2).sval, sym(3).sval, - sym(5).Expression, sym(6).UiObjectInitializer); - node->publicToken = loc(1); - node->attributeTypeToken = loc(2); - node->identifierToken = loc(3); - node->colonToken = loc(4); - sym(1).Node = node; -} break; -./ - UiObjectMember: T_PUBLIC T_IDENTIFIER T_IDENTIFIER ; /. case $rule_number: { @@ -646,7 +633,7 @@ UiObjectMember: T_PUBLIC T_IDENTIFIER T_IDENTIFIER T_COLON Expression ; /. case $rule_number: { AST::UiPublicMember *node = makeAstNode (driver->nodePool(), sym(2).sval, sym(3).sval, - sym(5).Expression, static_cast(0)); + sym(5).Expression); node->publicToken = loc(1); node->attributeTypeToken = loc(2); node->identifierToken = loc(3); diff --git a/src/declarative/qml/parser/javascriptast.cpp b/src/declarative/qml/parser/javascriptast.cpp index 35563ac..f9ef71d 100644 --- a/src/declarative/qml/parser/javascriptast.cpp +++ b/src/declarative/qml/parser/javascriptast.cpp @@ -797,7 +797,6 @@ void UiPublicMember::accept0(Visitor *visitor) { if (visitor->visit(this)) { acceptChild(expression, visitor); - acceptChild(initializer, visitor); } visitor->endVisit(this); diff --git a/src/declarative/qml/parser/javascriptast_p.h b/src/declarative/qml/parser/javascriptast_p.h index 56b2ec6..5176726 100644 --- a/src/declarative/qml/parser/javascriptast_p.h +++ b/src/declarative/qml/parser/javascriptast_p.h @@ -1891,26 +1891,23 @@ class UiPublicMember: public UiObjectMember public: JAVASCRIPT_DECLARE_AST_NODE(UiPublicMember) - UiPublicMember(JavaScriptNameIdImpl *type, + UiPublicMember(JavaScriptNameIdImpl *memberType, JavaScriptNameIdImpl *name) - : type(type), name(name), expression(0), initializer(0) + : memberType(memberType), name(name), expression(0) { kind = K; } - UiPublicMember(JavaScriptNameIdImpl *type, + UiPublicMember(JavaScriptNameIdImpl *memberType, JavaScriptNameIdImpl *name, - ExpressionNode *expression, - UiObjectInitializer *initializer) - : type(type), name(name), - expression(expression), initializer(initializer) + ExpressionNode *expression) + : memberType(memberType), name(name), expression(expression) { kind = K; } virtual void accept0(Visitor *visitor); // attributes - JavaScriptNameIdImpl *type; + JavaScriptNameIdImpl *memberType; JavaScriptNameIdImpl *name; ExpressionNode *expression; - UiObjectInitializer *initializer; SourceLocation publicToken; SourceLocation attributeTypeToken; SourceLocation identifierToken; diff --git a/src/declarative/qml/parser/javascriptgrammar.cpp b/src/declarative/qml/parser/javascriptgrammar.cpp index 0b25807..dfa0c69 100644 --- a/src/declarative/qml/parser/javascriptgrammar.cpp +++ b/src/declarative/qml/parser/javascriptgrammar.cpp @@ -1,4 +1,17 @@ // This file was generated by qlalr - DO NOT EDIT! +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** +** This file is part of the $MODULE$ of the Qt Toolkit. +** +** $TROLLTECH_DUAL_LICENSE$ +** +** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +** +****************************************************************************/ + #include "javascriptgrammar_p.h" const char *const JavaScriptGrammar::spell [] = { @@ -15,439 +28,434 @@ 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, 94, 98, 98, 103, + 96, 94, 94, 94, 94, 94, 98, 98, 103, 103, 103, 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, + 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, 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, 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, 6, 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, + 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, + 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, 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, 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, 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, 3, 0, 1, 1, 3, 0, 1, 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, 1, 1, 1, 1, 3, 1, 2, 0, 1, + 3, 3, 1, 1, 1, 3, 1, 3, 2, 2, + 2, 0, 1, 2, 0, 1, 1, 2, 2, 7, + 5, 7, 7, 5, 9, 10, 7, 8, 2, 2, + 3, 3, 2, 2, 3, 3, 3, 3, 5, 5, + 3, 5, 1, 2, 0, 1, 4, 3, 3, 3, + 3, 3, 3, 4, 5, 2, 2, 2, 8, 8, + 1, 3, 0, 1, 0, 1, 1, 1, 2, 1, + 1, 0, 1, 0, 1, 2}; const int JavaScriptGrammar::action_default [] = { - 8, 2, 0, 0, 4, 3, 0, 297, 0, 6, - 7, 5, 26, 224, 0, 28, 0, 225, 9, 1, - 0, 0, 27, 0, 284, 285, 0, 282, 0, 283, - 0, 286, 127, 194, 158, 166, 162, 202, 209, 106, - 178, 208, 216, 204, 154, 0, 205, 287, 0, 292, - 91, 206, 207, 212, 107, 170, 174, 95, 124, 105, - 110, 90, 144, 210, 131, 289, 288, 291, 213, 0, - 0, 0, 0, 37, 38, 0, 34, 0, 293, 31, - 0, 295, 49, 0, 0, 0, 0, 0, 32, 35, - 0, 0, 196, 238, 36, 0, 30, 0, 0, 33, - 0, 0, 0, 0, 0, 214, 215, 120, 203, 211, - 0, 0, 107, 126, 293, 31, 295, 109, 108, 0, - 0, 0, 122, 123, 121, 0, 294, 284, 0, 0, - 286, 0, 281, 0, 296, 0, 56, 57, 58, 59, - 84, 60, 85, 61, 62, 63, 64, 65, 66, 67, - 68, 53, 69, 70, 71, 72, 73, 55, 86, 74, - 54, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 87, 0, 51, 0, 0, 43, 0, 52, 42, 125, - 0, 155, 0, 0, 0, 0, 145, 0, 0, 0, - 0, 0, 0, 135, 0, 0, 0, 129, 130, 128, - 133, 137, 136, 134, 132, 147, 146, 148, 0, 163, - 0, 159, 0, 0, 101, 100, 89, 88, 0, 0, - 99, 195, 102, 0, 103, 0, 104, 98, 239, 240, - 280, 0, 191, 184, 182, 189, 190, 188, 187, 193, - 186, 185, 183, 192, 179, 0, 167, 0, 0, 171, - 0, 0, 175, 0, 0, 101, 93, 0, 92, 0, - 97, 290, 254, 0, 255, 256, 257, 250, 0, 251, - 252, 253, 278, 279, 111, 0, 0, 0, 0, 0, - 243, 244, 200, 198, 160, 168, 164, 180, 156, 201, - 0, 107, 172, 176, 149, 138, 0, 0, 157, 0, - 0, 0, 0, 150, 0, 0, 0, 0, 0, 142, - 140, 143, 141, 139, 152, 151, 153, 0, 165, 0, - 161, 0, 199, 107, 0, 181, 196, 197, 0, 196, - 0, 0, 246, 0, 0, 0, 248, 0, 169, 0, - 0, 173, 0, 0, 177, 236, 0, 228, 237, 231, - 0, 235, 0, 196, 229, 0, 196, 0, 0, 247, - 0, 0, 0, 249, 294, 0, 270, 0, 0, 0, - 242, 0, 241, 218, 221, 0, 57, 84, 60, 85, - 62, 63, 34, 67, 68, 31, 69, 72, 32, 35, - 196, 36, 75, 30, 77, 33, 79, 80, 81, 82, - 83, 87, 219, 217, 95, 96, 101, 0, 94, 0, - 258, 259, 0, 0, 0, 261, 266, 264, 267, 0, - 0, 265, 266, 0, 262, 0, 263, 220, 269, 0, - 220, 268, 0, 271, 272, 0, 220, 273, 274, 0, - 0, 275, 0, 0, 0, 276, 277, 113, 112, 0, - 0, 0, 245, 0, 0, 0, 260, 0, 50, 0, - 47, 49, 40, 0, 46, 41, 48, 45, 39, 0, - 44, 117, 115, 119, 116, 114, 118, 0, 18, 13, - 0, 14, 10, 0, 24, 0, 25, 23, 0, 0, - 22, 31, 49, 16, 28, 0, 11, 0, 17, 0, - 20, 12, 0, 21, 31, 49, 15, 0, 19, 29, - 233, 226, 0, 234, 230, 0, 232, 222, 0, 223, - 227}; + 8, 2, 0, 0, 4, 3, 0, 296, 0, 6, + 7, 5, 25, 223, 0, 27, 0, 224, 9, 1, + 0, 0, 26, 0, 283, 284, 0, 281, 0, 282, + 0, 285, 126, 193, 157, 165, 161, 201, 208, 105, + 177, 207, 215, 203, 153, 0, 204, 286, 0, 291, + 90, 205, 206, 211, 106, 169, 173, 94, 123, 104, + 109, 89, 143, 209, 130, 288, 287, 290, 212, 0, + 0, 0, 0, 36, 37, 0, 33, 0, 292, 30, + 0, 294, 48, 0, 0, 0, 0, 0, 31, 34, + 0, 0, 195, 237, 35, 0, 29, 0, 0, 32, + 0, 0, 0, 0, 0, 213, 214, 119, 202, 210, + 0, 0, 106, 125, 292, 30, 294, 108, 107, 0, + 0, 0, 121, 122, 120, 0, 293, 283, 0, 0, + 285, 0, 280, 0, 295, 0, 55, 56, 57, 58, + 83, 59, 84, 60, 61, 62, 63, 64, 65, 66, + 67, 52, 68, 69, 70, 71, 72, 54, 85, 73, + 53, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 86, 0, 50, 0, 0, 42, 0, 51, 41, 124, + 0, 154, 0, 0, 0, 0, 144, 0, 0, 0, + 0, 0, 0, 134, 0, 0, 0, 128, 129, 127, + 132, 136, 135, 133, 131, 146, 145, 147, 0, 162, + 0, 158, 0, 0, 100, 99, 88, 87, 0, 0, + 98, 194, 101, 0, 102, 0, 103, 97, 238, 239, + 279, 0, 190, 183, 181, 188, 189, 187, 186, 192, + 185, 184, 182, 191, 178, 0, 166, 0, 0, 170, + 0, 0, 174, 0, 0, 100, 92, 0, 91, 0, + 96, 289, 253, 0, 254, 255, 256, 249, 0, 250, + 251, 252, 277, 278, 110, 0, 0, 0, 0, 0, + 242, 243, 199, 197, 159, 167, 163, 179, 155, 200, + 0, 106, 171, 175, 148, 137, 0, 0, 156, 0, + 0, 0, 0, 149, 0, 0, 0, 0, 0, 141, + 139, 142, 140, 138, 151, 150, 152, 0, 164, 0, + 160, 0, 198, 106, 0, 180, 195, 196, 0, 195, + 0, 0, 245, 0, 0, 0, 247, 0, 168, 0, + 0, 172, 0, 0, 176, 235, 0, 227, 236, 230, + 0, 234, 0, 195, 228, 0, 195, 0, 0, 246, + 0, 0, 0, 248, 293, 0, 269, 0, 0, 0, + 241, 0, 240, 217, 220, 0, 56, 83, 59, 84, + 61, 62, 33, 66, 67, 30, 68, 71, 31, 34, + 195, 35, 74, 29, 76, 32, 78, 79, 80, 81, + 82, 86, 218, 216, 94, 95, 100, 0, 93, 0, + 257, 258, 0, 0, 0, 260, 265, 263, 266, 0, + 0, 264, 265, 0, 261, 0, 262, 219, 268, 0, + 219, 267, 0, 270, 271, 0, 219, 272, 273, 0, + 0, 274, 0, 0, 0, 275, 276, 112, 111, 0, + 0, 0, 244, 0, 0, 0, 259, 0, 49, 0, + 46, 48, 39, 0, 45, 40, 47, 44, 38, 0, + 43, 116, 114, 118, 115, 113, 117, 0, 18, 13, + 0, 14, 10, 0, 23, 0, 24, 0, 0, 22, + 30, 48, 16, 27, 0, 11, 0, 17, 0, 20, + 12, 0, 21, 30, 48, 15, 0, 19, 28, 232, + 225, 0, 233, 229, 0, 231, 221, 0, 222, 226}; const int JavaScriptGrammar::goto_default [] = { - 2, 6, 19, 1, 5, 4, 18, 495, 496, 478, + 2, 6, 19, 1, 5, 4, 18, 494, 495, 478, 20, 373, 45, 12, 108, 61, 459, 457, 135, 134, 33, 458, 133, 136, 215, 57, 50, 223, 59, 39, 222, 54, 60, 107, 58, 32, 64, 62, 294, 44, 288, 34, 284, 36, 286, 35, 285, 55, 292, 56, 293, 40, 287, 283, 324, 409, 289, 290, 37, 43, 46, 51, 52, 41, 38, 63, 109, 53, 68, 105, - 106, 42, 375, 374, 21, 512, 511, 346, 347, 514, - 349, 513, 348, 415, 419, 422, 418, 417, 437, 438, + 106, 42, 375, 374, 21, 511, 510, 346, 347, 513, + 349, 512, 348, 415, 419, 422, 418, 417, 437, 438, 26, 48, 125, 25, 47, 66, 65, 0}; const int JavaScriptGrammar::action_index [] = { - -19, -88, 70, 4, -88, -6, 252, -88, 75, -88, - -88, -88, -88, -88, 46, 50, 52, -88, -88, 241, - 100, 65, -88, -17, -12, 16, -30, -88, -1, -88, - -7, 1307, 114, -88, 14, -44, -75, -88, -88, 199, - -88, -88, -88, -88, 250, 228, -88, -88, -22, -88, - -88, -88, -88, -88, 498, 140, 96, 172, 195, -88, - -88, -88, 311, -88, 216, -88, 1307, -88, -88, 194, - 198, 99, 575, -88, -88, 1223, -88, 72, 67, 92, - 64, 1559, 90, 575, 575, 575, 374, 575, -88, -88, - 575, 575, 575, -88, -88, 48, -88, 575, 575, -88, - 55, 575, 575, 51, 59, -88, -88, -88, -88, -88, - 575, 575, 77, 168, 60, -88, 1055, -88, -88, 575, - 575, 575, -88, -88, -88, 24, -88, -18, -55, 43, - 1307, -26, -88, 84, 85, 63, -88, -88, -88, -88, + -25, -88, 89, 70, -88, -15, 251, -88, 85, -88, + -88, -88, -88, -88, 56, 48, 46, -88, -88, 262, + 127, 72, -88, -17, -9, 20, -29, -88, -3, -88, + -6, 1289, 112, -88, 13, -44, -76, -88, -88, 212, + -88, -88, -88, -88, 253, 228, -88, -88, -10, -88, + -88, -88, -88, -88, 347, 53, 87, 154, 274, -88, + -88, -88, 287, -88, 191, -88, 1289, -88, -88, 199, + 194, 115, 557, -88, -88, 1205, -88, 66, 71, 77, + 63, 1541, 79, 557, 557, 557, 480, 557, -88, -88, + 557, 557, 557, -88, -88, 60, -88, 557, 557, -88, + 41, 557, 557, 42, 44, -88, -88, -88, -88, -88, + 557, 557, 83, 177, -24, -88, 1037, -88, -88, 557, + 557, 557, -88, -88, -88, 25, -88, -18, -58, -8, + 1289, -26, -88, 58, 64, 67, -88, -88, -88, -88, -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, 575, -88, 1139, 30, -88, 575, -88, -88, 208, - 575, 232, 575, 575, 575, 575, 321, 575, 575, 575, - 575, 575, 575, 219, 575, 575, 575, 127, 134, 122, - 154, 159, 174, 166, 173, 413, 413, 295, 575, -3, - 575, 71, 971, 575, 575, -88, -88, -88, 97, 575, - -88, -88, 69, 62, -88, 575, -88, -88, -88, -88, - -88, 575, -88, -88, -88, -88, -88, -88, -88, -88, - -88, -88, -88, -88, -88, 575, 49, 575, 575, 140, - 58, 575, -88, 971, 575, 575, -88, 126, -88, 11, - -88, -88, -88, 86, -88, -88, -88, -88, 78, -88, - -88, -88, -88, -88, -88, 28, 68, 575, 149, 66, - -88, -88, 887, -88, 54, -28, -58, -88, 254, 8, - -47, 429, 19, 79, 280, 192, -4, 575, 248, 575, - 575, 575, 575, 348, 575, 575, 575, 575, 575, 188, - 283, 191, 207, 215, 348, 348, 274, 575, -74, 575, - 54, 575, -88, 498, 575, -88, 575, -5, -61, 575, - -33, 1223, -88, 575, 220, 1223, -88, 575, -38, 575, - 575, 7, 0, 575, -88, -9, 98, 1, -88, -88, - 575, -88, 21, 575, -88, 3, 575, 2, 1223, -88, - 575, 112, 1223, -88, 27, 1223, -88, 575, 106, 1223, - 41, 1223, -88, -88, 1223, -16, 141, 9, 176, 82, - 575, 1223, 33, 10, 74, 38, 12, 355, 40, 37, - 656, 35, -2, 34, 575, 29, 20, 575, 32, 575, - 31, 42, -88, -88, 160, -88, 575, -8, -88, 94, - -88, -88, 575, 150, 25, -88, 17, -88, 44, 113, - 575, -88, 26, 36, -88, -20, -88, 1223, -88, 105, - 1223, -88, 214, -88, -88, 115, 1223, 39, -88, 18, - 23, -88, 22, -54, -21, -88, -88, -88, -88, 575, - 161, 1223, -88, 575, 130, 1223, -88, 133, 5, 810, - -88, 15, -88, 733, -88, -88, -88, -88, -88, 123, - -88, -88, -88, -88, -88, -88, -88, 285, -88, -88, - 309, -88, -88, 45, 61, 575, 155, -88, 1391, 53, - -88, 119, 103, -88, 47, 93, -88, 102, -88, 56, - -88, -88, 1475, -88, 118, 116, -88, 108, -88, -88, - 73, -88, 187, -88, -88, 575, -88, -88, 57, -88, - -88, + -88, 557, -88, 1121, 55, -88, 557, -88, -88, 175, + 557, 250, 557, 557, 557, 557, 404, 557, 557, 557, + 557, 557, 557, 158, 557, 557, 557, 80, 73, 81, + 197, 238, 220, 159, 167, 277, 404, 317, 557, 14, + 557, 90, 953, 557, 557, -88, -88, -88, 108, 557, + -88, -88, 65, 49, -88, 557, -88, -88, -88, -88, + -88, 557, -88, -88, -88, -88, -88, -88, -88, -88, + -88, -88, -88, -88, -88, 557, 45, 557, 557, 75, + 69, 557, -88, 953, 557, 557, -88, 153, -88, 6, + -88, -88, -88, 105, -88, -88, -88, -88, 111, -88, + -88, -88, -88, -88, -88, 21, 62, 557, 122, 95, + -88, -88, 634, -88, 39, -30, -59, -88, 259, 8, + -46, 417, 19, 125, 339, 188, -7, 557, 248, 557, + 557, 557, 557, 339, 557, 557, 557, 557, 557, 187, + 166, 192, 206, 232, 339, 339, 339, 557, -59, 557, + 39, 557, -88, 380, 557, -88, 557, -5, -60, 557, + -48, 1205, -88, 557, 142, 1205, -88, 557, -38, 557, + 557, 7, 0, 557, -88, 17, 84, 22, -88, -88, + 557, -88, 27, 557, -88, -13, 557, 52, 1205, -88, + 557, 102, 1205, -88, 28, 1205, -88, 557, 100, 1205, + 34, 1205, -88, -88, 1205, -19, 139, 9, 149, 82, + 557, 1205, 23, 1, 119, 36, 10, 480, 40, 120, + 869, 35, 5, 26, 557, 37, -1, 557, 29, 557, + 31, 33, -88, -88, 205, -88, 557, -11, -88, 78, + -88, -88, 557, 98, 38, -88, 47, -88, 54, 198, + 557, -88, 30, 32, -88, -4, -88, 1205, -88, 107, + 1205, -88, 213, -88, -88, 113, 1205, 43, -88, 18, + 24, -88, -21, -54, -20, -88, -88, -88, -88, 557, + 143, 1205, -88, 557, 110, 1205, -88, 118, 16, 788, + -88, 15, -88, 711, -88, -88, -88, -88, -88, 121, + -88, -88, -88, -88, -88, -88, -88, 298, -88, -88, + 284, -88, -88, 59, 76, 557, 74, 1373, 57, -88, + 147, 130, -88, 61, 97, -88, 96, -88, 50, -88, + -88, 1457, -88, 116, 99, -88, 109, -88, -88, 51, + -88, 190, -88, -88, 557, -88, -88, 68, -88, -88, - -98, -98, -98, -98, -98, 31, 17, -98, -98, -98, - -98, -98, -98, -98, -98, -98, -98, -98, -98, 67, + -98, -98, -98, -98, -98, 30, 13, -98, -98, -98, + -98, -98, -98, -98, -98, -98, -98, -98, -98, 87, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, - -98, 63, -98, -98, -98, -98, -98, -98, -98, -98, + -98, 83, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, - -98, -98, -98, -98, -45, -98, -98, -98, -98, -98, - -98, -98, -98, -98, -98, -98, 186, -98, -98, -98, - -98, -98, 113, -98, -98, -11, -98, -98, -98, -98, - -98, -98, -98, 43, 116, 112, 134, 147, -98, -98, - 153, 152, 42, -98, -98, -98, -98, 37, 87, -98, - -15, 90, 84, -98, -98, -98, -98, -98, -98, -98, - 78, 94, -98, -98, -98, -98, -98, -98, -98, 103, - 102, 96, -98, -98, -98, -98, -98, -49, -98, -98, + -98, -98, -98, -98, -43, -98, -98, -98, -98, -98, + -98, -98, -98, -98, -98, -98, 184, -98, -98, -98, + -98, -98, 113, -98, -98, -9, -98, -98, -98, -98, + -98, -98, -98, 42, 116, 112, 127, 146, -98, -98, + 151, 147, 40, -98, -98, -98, -98, 37, 89, -98, + -10, 90, 86, -98, -98, -98, -98, -98, -98, -98, + 77, 94, -98, -98, -98, -98, -98, -98, -98, 106, + 103, 98, -98, -98, -98, -98, -98, -47, -98, -98, 253, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, - -98, 1, -98, -17, -98, -98, -7, -98, -98, -98, - 133, -98, 119, 123, 130, 132, -98, 121, 34, 46, - 33, 61, 59, -98, 68, 48, 40, -98, -98, -98, - -98, -98, -98, -98, -98, -98, -98, -98, 57, -98, - 55, -98, 28, 32, 22, -98, -98, -98, -98, 25, + -98, -7, -98, 0, -98, -98, -3, -98, -98, -98, + 136, -98, 117, 119, 132, 134, -98, 130, 49, 36, + 35, 61, 64, -98, 47, 46, 38, -98, -98, -98, + -98, -98, -98, -98, -98, -98, -98, -98, 59, -98, + 58, -98, 24, 32, 17, -98, -98, -98, -98, 21, -98, -98, -98, -98, -98, 8, -98, -98, -98, -98, - -98, 7, -98, -98, -98, -98, -98, -98, -98, -98, - -98, -98, -98, -98, -98, 60, -98, 54, -18, -98, - -98, -10, -98, 117, -8, 131, -98, -98, -98, -98, + -98, 4, -98, -98, -98, -98, -98, -98, -98, -98, + -98, -98, -98, -98, -98, 60, -98, 57, -19, -98, + -98, -17, -98, 118, 44, 133, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, - -98, -98, -98, -98, -98, -98, -98, 5, -98, -98, - -98, -98, 62, -98, -98, -98, -98, -98, -98, -98, - -98, -98, -98, -98, -98, -98, -98, 188, -98, 198, - 185, 179, 189, -98, 83, 77, 80, 95, 106, -98, - -98, -98, -98, -98, -98, -98, -98, 170, -98, 160, - -98, 158, -98, -98, 177, -98, 98, -98, -98, 120, - -98, 26, -98, 27, -98, 29, -98, 157, -98, 156, - 159, -98, -98, 169, -98, -98, -98, -98, -98, -98, - 195, -98, -52, 126, -98, -98, 127, -98, 18, -98, - 20, -98, 23, -98, -98, 24, -98, 21, -98, 19, - -98, 47, -98, -98, 50, -98, -98, -98, -98, -98, - 91, 52, -98, -98, -98, -98, -98, 79, -98, -98, - 36, -98, -98, -98, 44, -98, -34, 135, -98, 146, - -98, -98, -98, -98, -98, -98, 128, -98, -98, -98, - -98, -98, 75, -98, -98, -98, -98, -98, -80, -98, - 6, -98, -65, -98, -98, -98, -98, -57, -98, -98, - -58, -98, -98, -98, -98, -98, -98, -69, -98, -98, - -42, -98, -98, -98, -46, -98, -98, -98, -98, 10, - -98, 12, -98, -1, -98, -5, -98, -98, -98, -19, - -98, -13, -98, -12, -98, -98, -98, -98, -98, -98, - -98, -98, -98, -98, -98, -98, -98, 92, -98, -98, - 66, -98, -98, -98, -98, 45, 38, -98, 41, -98, - -98, 53, 49, -98, 51, -98, -98, -98, -98, 58, - -98, -98, 35, -98, 16, 166, -98, -98, -98, -98, - -98, -98, -98, -98, -98, 30, -98, -98, -38, -98, - -98}; + -98, -98, -98, -98, -98, -98, -98, 3, -98, -98, + -98, -98, 67, -98, -98, -98, -98, -98, -98, -98, + -98, -98, -98, -98, -98, -98, -98, 186, -98, 196, + 183, 177, 187, -98, 82, 76, 79, 96, 99, -98, + -98, -98, -98, -98, -98, -98, -98, 168, -98, 158, + -98, 156, -98, -98, 175, -98, 102, -98, -98, 104, + -98, 25, -98, 27, -98, 29, -98, 155, -98, 154, + 157, -98, -98, 167, -98, -98, -98, -98, -98, -98, + 193, -98, -48, 126, -98, -98, 128, -98, 15, -98, + 19, -98, 22, -98, -98, 23, -98, 20, -98, 18, + -98, 34, -98, -98, 53, -98, -98, -98, -98, -98, + 93, 52, -98, -98, -98, -98, -98, 81, -98, -98, + 45, -98, -98, -98, 43, -98, -35, 137, -98, 141, + -98, -98, -98, -98, -98, -98, 131, -98, -98, -98, + -98, -98, -8, -98, -98, -98, -98, -98, -77, -98, + 6, -98, -76, -98, -98, -98, -98, -52, -98, -98, + -51, -98, -98, -98, -98, -98, -98, -75, -98, -98, + -46, -98, -98, -98, -49, -98, -98, -98, -98, 7, + -98, 5, -98, -12, -98, 75, -98, -98, -98, -14, + -98, -11, -98, -13, -98, -98, -98, -98, -98, -98, + -98, -98, -98, -98, -98, -98, -98, 73, -98, -98, + 56, -98, -98, -98, -98, 41, -98, 39, -98, -98, + 50, 48, -98, 51, -98, -98, -98, -98, 66, -98, + -98, 31, -98, 16, 166, -98, -98, -98, -98, -98, + -98, -98, -98, -98, 26, -98, -98, -38, -98, -98}; const int JavaScriptGrammar::action_info [] = { - 329, 210, 319, 219, 208, 129, 444, 343, 350, 337, - 317, 27, 436, 466, 326, 180, 321, 27, 319, 24, - 317, 337, 420, 460, 28, 345, 31, 331, 29, 132, - 30, 420, 360, 230, 412, 426, -78, 176, -224, 403, - -65, -76, -54, 427, -55, -53, 282, -73, 367, 420, - 345, 443, 408, 436, 442, 297, 436, 371, 416, 440, - 127, -225, 358, 24, 356, 251, 3, 449, 485, 8, - 7, 260, 180, 210, 484, 23, 130, 225, 453, 3, - 477, 483, 509, 477, 412, 494, 510, 449, 436, 126, - 515, 171, 0, 173, 510, 453, 364, 208, 460, 365, - 367, 499, 276, 126, 277, 219, 352, 488, 282, 502, - -293, 460, 430, 219, 219, 489, 499, 489, 178, 117, - 219, 439, 227, 423, 460, 365, 365, 281, 280, 339, - 118, 219, 494, 340, 219, 440, 10, 9, 219, 271, - 270, 461, 245, 273, 272, 494, 247, 266, 265, 500, - 248, 477, 477, 220, 110, 411, 410, 219, 219, 353, - 273, 272, 110, 219, 508, 111, 369, 110, 424, 219, - 263, 0, 362, 111, 110, 253, 0, 0, 111, 194, - 119, 195, 258, 470, 194, 111, 195, 253, 477, 462, - 455, 194, 196, 195, 254, 518, 406, 196, 194, 194, - 195, 195, 264, 262, 196, 268, 254, 119, 255, 279, - 414, 196, 196, 194, 212, 195, 194, 194, 195, 195, - 119, 451, 219, 263, 0, 120, 196, 268, 219, 196, - 196, 121, 194, 213, 195, 214, 219, 269, 267, 0, - 194, 194, 195, 195, 194, 196, 195, 0, 519, 517, - 182, 183, 120, 196, 196, 264, 262, 196, 121, 269, - 267, 0, 0, 14, 0, 120, 299, 300, 182, 183, - 15, 121, 299, 300, 14, 434, 433, 184, 185, 0, - 335, 15, 0, 0, 0, 0, 0, 0, 0, 229, - 228, 0, 0, 301, 302, 184, 185, 304, 305, 301, - 302, 0, 0, 304, 305, 0, 306, 14, 194, 307, - 195, 308, 306, 17, 15, 307, 0, 308, 187, 188, - 0, 196, 13, 0, 17, 16, 189, 190, 0, 0, - 191, 14, 192, 13, 187, 188, 16, 0, 15, 0, - 479, 0, 189, 190, 187, 188, 191, 0, 192, 0, - 0, 0, 189, 190, 0, 0, 191, 17, 192, 0, - 0, 0, 0, 0, 481, 0, 13, 73, 74, 16, - 0, 304, 305, 0, 0, 0, 0, 114, 0, 0, - 306, 17, 0, 307, 115, 308, 73, 74, 116, 82, - 13, 83, 0, 16, 0, 0, 114, 0, 86, 0, - 0, 0, 89, 115, 0, 0, 0, 116, 82, 0, - 83, 0, 0, 0, 0, 0, 0, 86, 0, 0, - 94, 89, 96, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 232, 88, 99, 76, 187, 188, 0, 94, - 0, 96, 233, 0, 189, 190, 234, 0, 191, 0, - 192, 0, 88, 99, 76, 235, 0, 236, 0, 0, - 333, 0, 0, 0, 0, 0, 0, 0, 237, 0, - 238, 117, 0, 0, 0, 0, 0, 0, 239, 0, - 0, 240, 118, 0, 0, 0, 0, 241, 0, 0, - 0, 0, 0, 242, 0, 0, 0, 0, 0, 0, - 0, 232, 0, 0, 0, 0, 243, 0, 0, 0, - 0, 233, 0, 0, 0, 234, 0, 0, 0, 0, - 0, 0, 0, 0, 235, 0, 236, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 237, 0, 238, - 117, 0, 0, 0, 0, 0, 0, 239, 0, 0, - 240, 118, 0, 0, 0, 0, 241, 0, 0, 0, - 0, 0, 242, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 243, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 72, 73, 74, 0, - 0, 0, 0, 0, 0, 0, 0, 114, 0, 0, - 0, 0, 0, 0, 115, 0, 0, 0, 116, 82, - 0, 83, 0, 0, 0, 84, 0, 85, 86, 87, - 0, 0, 89, 0, 0, 0, 90, 0, 91, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 94, 0, 96, 0, 98, 0, 101, 0, 102, 0, - 0, 0, 0, 88, 99, 76, 0, 0, 0, 0, - 0, 0, 0, -74, 0, 0, 0, 72, 73, 74, - 0, 0, 0, 0, 0, 0, 0, 0, 114, 0, - 0, 0, 0, 0, 0, 115, 0, 0, 0, 116, - 82, 0, 83, 0, 0, 0, 84, 0, 85, 86, - 87, 0, 0, 89, 0, 0, 0, 90, 0, 91, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 94, 0, 96, 0, 98, 0, 101, 0, 102, - 0, 0, 0, 0, 88, 99, 76, 0, 0, 0, - 0, 0, 0, 0, 72, 73, 74, 0, 0, 0, - 0, 0, 0, 0, 0, 114, 0, 0, 0, 0, - 0, 0, 115, 0, 0, 0, 116, 82, 0, 83, - 0, 0, 0, 84, 0, 85, 86, 87, 0, 0, - 89, 0, 0, 0, 90, 0, 91, 0, 0, 465, - 0, 0, 0, 0, 0, 0, 0, 0, 94, 0, - 96, 0, 98, 0, 101, 0, 102, 0, 0, 0, - 0, 88, 99, 76, 0, 0, 0, 0, 0, 0, - 0, 72, 73, 74, 0, 0, 0, 0, 0, 0, + 210, 329, 129, 219, 208, 126, 444, 343, 443, 337, + 317, 27, 331, 436, 180, 326, 321, 319, 317, 24, + 27, 337, 345, 460, 466, 130, 29, 31, 28, 132, + -64, 30, 436, -75, 350, 420, 403, 282, -223, 427, + 297, 412, -53, -52, -77, 230, 367, -72, 356, 408, + 371, 426, 420, 360, 442, 245, 345, 436, -224, 420, + 3, 127, 176, 440, 24, 171, 260, 449, 514, 453, + 3, 416, 173, 225, 436, 483, 251, 245, 449, 493, + 453, 477, 219, 485, 365, 23, 508, 460, 484, 7, + 210, 180, 352, 208, 477, 276, 412, 509, 277, 367, + 364, 509, 282, 501, 0, 498, 219, 460, 219, 227, + 219, 488, 358, 110, 430, 219, 219, 498, 219, 439, + 110, 110, 178, 365, 111, 117, 461, -54, 493, 219, + 219, 111, 111, 440, 487, 8, 118, 247, 460, 411, + 410, 248, 488, 273, 272, 353, 10, 9, 126, 477, + 219, 219, 110, 499, 365, -292, 281, 280, 414, 493, + 369, 219, 362, 111, 220, 507, 266, 265, 263, 253, + 455, 0, 271, 270, 462, 339, 273, 272, 268, 340, + 477, 470, 279, 194, 194, 195, 195, 119, 254, 119, + 255, 194, 194, 195, 195, 0, 196, 196, 517, 0, + 264, 262, 335, 451, 196, 196, 0, 0, 423, 258, + 269, 267, 194, 194, 195, 195, 194, 194, 195, 195, + 253, 219, 194, 268, 195, 196, 196, 212, 263, 196, + 196, 194, 120, 195, 120, 196, 219, 0, 121, 254, + 121, 406, 0, 0, 196, 194, 213, 195, 214, 0, + 0, 518, 516, 424, 0, 269, 267, 194, 196, 195, + 264, 262, 0, 194, 0, 195, 299, 300, 182, 183, + 196, 182, 183, 14, 434, 433, 196, 299, 300, 0, + 15, 0, 0, 0, 14, 0, 119, 0, 0, 229, + 228, 15, 0, 301, 302, 184, 185, 0, 184, 185, + 187, 188, 0, 0, 301, 302, 14, 0, 189, 190, + 187, 188, 191, 15, 192, 0, 0, 0, 189, 190, + 14, 0, 191, 17, 192, 0, 0, 15, 0, 0, + 0, 120, 13, 0, 17, 16, 0, 121, 0, 481, + 187, 188, 0, 13, 0, 0, 16, 0, 189, 190, + 232, 0, 191, 479, 192, 0, 17, 0, 0, 0, + 233, 0, 304, 305, 234, 13, 0, 0, 16, 0, + 17, 306, 0, 235, 307, 236, 308, 0, 0, 13, + 0, 0, 16, 232, 0, 0, 237, 0, 238, 117, + 0, 0, 0, 233, 0, 0, 239, 234, 0, 240, + 118, 0, 0, 0, 0, 241, 235, 0, 236, 0, + 0, 242, 0, 0, 0, 0, 0, 0, 0, 237, + 232, 238, 117, 0, 243, 0, 0, 187, 188, 239, + 233, 0, 240, 118, 234, 189, 190, 0, 241, 191, + 0, 192, 0, 235, 242, 236, 0, 0, 333, 0, + 0, 0, 0, 0, 0, 0, 237, 243, 238, 117, + 0, 0, 0, 0, 0, 0, 239, 0, 0, 240, + 118, 0, 0, 0, 0, 241, 0, 0, 0, 0, + 0, 242, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 73, 74, 243, 0, 0, 0, 0, 0, 0, 0, 114, 0, 0, 0, 0, 0, 0, 115, 0, 0, 0, 116, 82, 0, 83, 0, 0, 0, - 84, 0, 85, 86, 87, 0, 0, 89, 0, 0, - 0, 90, 0, 91, 0, 0, 468, 0, 0, 0, - 0, 0, 0, 0, 0, 94, 0, 96, 0, 98, - 0, 101, 0, 102, 0, 0, 0, 0, 88, 99, + 0, 0, 0, 86, 0, 0, 0, 89, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 94, 0, 96, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 88, 99, 76, 0, 0, 0, 0, 0, 0, 0, 72, 73, 74, 0, 0, 0, 0, 0, 0, 0, 0, 114, 0, 0, 0, 0, 0, 0, 115, 0, 0, 0, 116, 82, 0, 83, 0, 0, 0, 84, 0, 85, 86, 87, 0, 0, 89, 0, 0, 0, 90, 0, 91, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 94, 0, 96, 0, 98, 0, 101, 296, + 0, 0, 94, 0, 96, 0, 98, 0, 101, 0, 102, 0, 0, 0, 0, 88, 99, 76, 0, 0, - 0, 0, 0, 0, 0, 137, 138, 139, 0, 0, + 0, 0, 0, 0, 0, 72, 73, 74, 0, 0, + 0, 0, 0, 0, 0, 0, 114, 0, 0, 0, + 0, 0, 0, 115, 0, 0, 0, 116, 82, 0, + 83, 0, 0, 0, 84, 0, 85, 86, 87, 0, + 0, 89, 0, 0, 0, 90, 0, 91, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 94, + 0, 96, 0, 98, 0, 101, 296, 102, 0, 0, + 0, 0, 88, 99, 76, 0, 0, 0, 0, 0, + 0, 0, 72, 73, 74, 0, 0, 0, 0, 0, + 0, 0, 0, 114, 0, 0, 0, 0, 0, 0, + 115, 0, 0, 0, 116, 82, 0, 83, 0, 0, + 0, 84, 0, 85, 86, 87, 0, 0, 89, 0, + 0, 0, 90, 0, 91, 0, 0, 465, 0, 0, + 0, 0, 0, 0, 0, 0, 94, 0, 96, 0, + 98, 0, 101, 0, 102, 0, 0, 0, 0, 88, + 99, 76, 0, 0, 0, 0, 0, 0, 0, 72, + 73, 74, 0, 0, 0, 0, 0, 0, 0, 0, + 114, 0, 0, 0, 0, 0, 0, 115, 0, 0, + 0, 116, 82, 0, 83, 0, 0, 0, 84, 0, + 85, 86, 87, 0, 0, 89, 0, 0, 0, 90, + 0, 91, 0, 0, 468, 0, 0, 0, 0, 0, + 0, 0, 0, 94, 0, 96, 0, 98, 0, 101, + 0, 102, 0, 0, 0, 0, 88, 99, 76, 0, + 0, 0, 0, 0, 0, 0, -73, 0, 0, 0, + 72, 73, 74, 0, 0, 0, 0, 0, 0, 0, + 0, 114, 0, 0, 0, 0, 0, 0, 115, 0, + 0, 0, 116, 82, 0, 83, 0, 0, 0, 84, + 0, 85, 86, 87, 0, 0, 89, 0, 0, 0, + 90, 0, 91, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 94, 0, 96, 0, 98, 0, + 101, 0, 102, 0, 0, 0, 0, 88, 99, 76, + 0, 0, 0, 0, 0, 0, 0, 137, 138, 139, + 0, 0, 141, 143, 144, 0, 0, 145, 0, 146, + 0, 0, 0, 148, 149, 150, 0, 0, 0, 0, + 0, 0, 217, 152, 153, 154, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 155, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 159, 0, 0, 0, 0, 0, 0, 161, + 162, 163, 0, 165, 166, 167, 168, 169, 170, 0, + 0, 156, 164, 147, 140, 142, 158, 0, 0, 0, + 0, 137, 138, 139, 0, 0, 141, 143, 144, 0, + 0, 145, 0, 146, 0, 0, 0, 148, 149, 150, + 0, 0, 0, 0, 0, 0, 151, 152, 153, 154, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 155, 0, 0, 0, 157, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 159, 0, 0, 0, + 0, 0, 160, 161, 162, 163, 0, 165, 166, 167, + 168, 169, 170, 0, 0, 156, 164, 147, 140, 142, + 158, 0, 0, 0, 0, 137, 138, 139, 0, 0, 141, 143, 144, 0, 0, 145, 0, 146, 0, 0, 0, 148, 149, 150, 0, 0, 0, 0, 0, 0, - 217, 152, 153, 154, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 155, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 159, 0, 0, 0, 0, 0, 0, 161, 162, 163, + 151, 152, 153, 154, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 155, 0, 0, 0, 157, 0, + 0, 0, 0, 0, 0, 0, 175, 0, 0, 0, + 159, 0, 0, 0, 0, 0, 160, 161, 162, 163, 0, 165, 166, 167, 168, 169, 170, 0, 0, 156, - 164, 147, 140, 142, 158, 0, 0, 0, 0, 137, - 138, 139, 0, 0, 141, 143, 144, 0, 0, 145, - 0, 146, 0, 0, 0, 148, 149, 150, 0, 0, - 0, 0, 0, 0, 151, 152, 153, 154, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 155, 0, - 0, 0, 157, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 159, 0, 0, 0, 0, 0, - 160, 161, 162, 163, 0, 165, 166, 167, 168, 169, - 170, 0, 0, 156, 164, 147, 140, 142, 158, 0, - 0, 0, 0, 137, 138, 139, 0, 0, 141, 143, - 144, 0, 0, 145, 0, 146, 0, 0, 0, 148, - 149, 150, 0, 0, 0, 0, 0, 0, 151, 152, - 153, 154, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 155, 0, 0, 0, 157, 0, 0, 0, - 0, 0, 0, 0, 175, 0, 0, 0, 159, 0, - 0, 0, 0, 0, 160, 161, 162, 163, 0, 165, - 166, 167, 168, 169, 170, 0, 0, 156, 164, 147, - 140, 142, 158, 0, 0, 0, 0, 69, 0, 0, + 164, 147, 140, 142, 158, 0, 0, 0, 0, 69, + 0, 0, 0, 0, 70, 0, 72, 73, 74, 75, + 0, 0, 0, 0, 0, 0, 77, 114, 0, 0, + 0, 0, 0, 0, 79, 80, 0, 0, 81, 82, + 0, 83, 0, 0, 0, 84, 0, 85, 86, 87, + 0, 0, 89, 0, 0, 0, 90, 0, 91, 0, + 0, 0, 0, 0, 92, 0, 93, 0, 0, 0, + 94, 95, 96, 97, 98, 100, 101, 17, 102, 103, + 104, 0, 0, 88, 99, 76, 13, 71, 0, 0, + 0, 0, 0, 69, 0, 0, 0, 0, 70, 0, + 72, 73, 74, 75, 0, 0, 0, 0, 0, 0, + 77, 78, 0, 0, 0, 0, 0, 0, 79, 80, + 0, 0, 81, 82, 0, 83, 0, 0, 0, 84, + 0, 85, 86, 87, 0, 0, 89, 0, 0, 0, + 90, 0, 91, 0, 0, 0, 0, 0, 92, 0, + 93, 0, 0, 0, 94, 95, 96, 97, 98, 100, + 101, 17, 102, 103, 104, 0, 0, 88, 99, 76, + 13, 71, 0, 0, 0, 0, 0, 69, 0, 0, 0, 0, 70, 0, 72, 73, 74, 75, 0, 0, 0, 0, 0, 0, 77, 114, 0, 0, 0, 0, - 0, 0, 79, 80, 0, 0, 81, 82, 0, 83, + 0, 0, 490, 80, 0, 0, 81, 491, 0, 83, 0, 0, 0, 84, 0, 85, 86, 87, 0, 0, 89, 0, 0, 0, 90, 0, 91, 0, 0, 0, 0, 0, 92, 0, 93, 0, 0, 0, 94, 95, 96, 97, 98, 100, 101, 17, 102, 103, 104, 0, 0, 88, 99, 76, 13, 71, 0, 0, 0, 0, 0, 69, 0, 0, 0, 0, 70, 0, 72, 73, - 74, 75, 0, 0, 0, 0, 0, 0, 77, 78, - 0, 0, 0, 0, 0, 0, 79, 80, 0, 0, - 81, 82, 0, 83, 0, 0, 0, 84, 0, 85, + 74, 75, 0, 0, 0, 0, 0, 0, 77, 114, + 0, 0, 0, 0, 0, 0, 503, 80, 0, 0, + 81, 504, 0, 83, 0, 0, 0, 84, 0, 85, 86, 87, 0, 0, 89, 0, 0, 0, 90, 0, 91, 0, 0, 0, 0, 0, 92, 0, 93, 0, 0, 0, 94, 95, 96, 97, 98, 100, 101, 17, 102, 103, 104, 0, 0, 88, 99, 76, 13, 71, - 0, 0, 0, 0, 0, 69, 0, 0, 0, 0, - 70, 0, 72, 73, 74, 75, 0, 0, 0, 0, - 0, 0, 77, 114, 0, 0, 0, 0, 0, 0, - 491, 80, 0, 0, 81, 492, 0, 83, 0, 0, - 0, 84, 0, 85, 86, 87, 0, 0, 89, 0, - 0, 0, 90, 0, 91, 0, 0, 0, 0, 0, - 92, 0, 93, 0, 0, 0, 94, 95, 96, 97, - 98, 100, 101, 17, 102, 103, 104, 0, 0, 88, - 99, 76, 13, 71, 0, 0, 0, 0, 0, 69, - 0, 0, 0, 0, 70, 0, 72, 73, 74, 75, - 0, 0, 0, 0, 0, 0, 77, 114, 0, 0, - 0, 0, 0, 0, 504, 80, 0, 0, 81, 505, - 0, 83, 0, 0, 0, 84, 0, 85, 86, 87, - 0, 0, 89, 0, 0, 0, 90, 0, 91, 0, - 0, 0, 0, 0, 92, 0, 93, 0, 0, 0, - 94, 95, 96, 97, 98, 100, 101, 17, 102, 103, - 104, 0, 0, 88, 99, 76, 13, 71, 0, 0, - 0, 0, 0, 376, 138, 139, 0, 0, 378, 143, - 380, 73, 74, 381, 0, 146, 0, 0, 0, 148, - 383, 384, 0, 0, 0, 0, 0, 0, 385, 386, - 153, 154, 81, 82, 0, 83, 0, 0, 0, 84, - 0, 85, 387, 87, 0, 0, 389, 0, 0, 0, - 90, 0, 91, 0, -220, 0, 0, 0, 390, 0, - 93, 0, 0, 0, 391, 392, 393, 394, 98, 396, - 397, 398, 399, 400, 401, 0, 0, 388, 395, 382, - 377, 379, 158, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 376, 138, 139, 0, 0, + 378, 143, 380, 73, 74, 381, 0, 146, 0, 0, + 0, 148, 383, 384, 0, 0, 0, 0, 0, 0, + 385, 386, 153, 154, 81, 82, 0, 83, 0, 0, + 0, 84, 0, 85, 387, 87, 0, 0, 389, 0, + 0, 0, 90, 0, 91, 0, -219, 0, 0, 0, + 390, 0, 93, 0, 0, 0, 391, 392, 393, 394, + 98, 396, 397, 398, 399, 400, 401, 0, 0, 388, + 395, 382, 377, 379, 158, 0, 0, 0, 0, - 275, 467, 250, 463, 257, 174, 456, 421, 464, 231, - 252, 454, 445, 177, 431, 428, 446, 278, 429, 425, - 441, 172, 450, 452, 435, 506, 354, 244, 226, 359, - 370, 22, 361, 368, 363, 366, 11, 332, 520, 334, - 336, 128, 224, 435, 218, 221, 503, 487, 327, 432, - 516, 216, 490, 0, 327, 469, 432, 486, 372, 497, - 498, 402, 493, 275, 112, 112, 501, 0, 497, 202, - 200, 112, 482, 482, 67, 199, 49, 112, 0, 112, - 22, 22, 201, 198, 0, 112, 112, 413, 112, 0, - 112, 112, 112, 291, 480, 204, 211, 203, 295, 112, - 209, 249, 0, 197, 404, 246, 22, 405, 112, 112, - 327, 112, 113, 310, 112, 112, 311, 448, 112, 309, - 476, 112, 112, 447, 274, 112, 112, 112, 179, 124, - 0, 312, 327, 112, 112, 123, 122, 112, 327, 327, - 216, 256, 313, 112, 112, 472, 274, 112, 224, 471, - 112, 224, 112, 328, 112, 407, 186, 193, 259, 404, - 205, 112, 405, 112, 112, 0, 112, 206, 447, 207, - 0, 0, 181, 507, 0, 330, 497, 112, 112, 448, - 473, 355, 357, 112, 112, 475, 474, 112, 112, 323, - 323, 112, 295, 295, 295, 295, 295, 67, 0, 49, - 323, 112, 320, 338, 341, 295, 295, 0, 323, 0, - 112, 322, 342, 295, 318, 295, 112, 315, 0, 112, - 112, 295, 344, 314, 295, 295, 323, 316, 298, 112, - 325, 295, 0, 0, 295, 0, 303, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 351, 0, + 454, 250, 275, 252, 413, 463, 467, 464, 425, 445, + 421, 231, 446, 172, 441, 278, 452, 177, 429, 450, + 428, 431, 174, 435, 244, 505, 359, 22, 226, 370, + 354, 361, 368, 363, 366, 11, 332, 224, 519, 334, + 336, 221, 502, 128, 218, 372, 515, 216, 435, 432, + 489, 0, 327, 486, 469, 432, 257, 327, 496, 492, + 497, 0, 482, 275, 402, 0, 112, 112, 0, 112, + 22, 202, 201, 199, 500, 480, 496, 112, 112, 0, + 112, 198, 197, 0, 0, 200, 456, 22, 112, 112, + 112, 112, 112, 482, 67, 112, 49, 203, 291, 211, + 204, 22, 209, 295, 249, 246, 404, 112, 112, 405, + 112, 113, 310, 112, 327, 311, 327, 112, 309, 448, + 112, 112, 476, 447, 112, 112, 274, 112, 179, 112, + 112, 124, 312, 0, 112, 313, 123, 112, 327, 122, + 327, 216, 256, 112, 112, 472, 274, 112, 112, 471, + 112, 224, 404, 224, 186, 405, 205, 328, 407, 330, + 259, 112, 0, 112, 0, 112, 193, 112, 112, 206, + 447, 207, 112, 506, 448, 181, 496, 112, 112, 473, + 475, 355, 112, 357, 474, 112, 112, 323, 323, 112, + 295, 295, 295, 295, 295, 67, 0, 49, 323, 112, + 320, 338, 341, 295, 295, 0, 323, 0, 112, 322, + 342, 295, 318, 295, 112, 315, 0, 112, 112, 295, + 344, 314, 295, 295, 323, 316, 298, 112, 325, 295, + 0, 0, 295, 0, 303, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 351, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67, 0, 49, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 261, 0, 0, 0, 0, 0, 0, 0, + 261, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -457,129 +465,144 @@ const int JavaScriptGrammar::action_info [] = { 0}; const int JavaScriptGrammar::action_check [] = { - 61, 76, 76, 8, 48, 60, 60, 7, 17, 2, - 48, 29, 33, 8, 61, 1, 8, 29, 76, 36, - 48, 2, 5, 8, 8, 29, 33, 60, 29, 55, - 60, 5, 31, 55, 36, 55, 7, 7, 29, 55, - 7, 7, 7, 7, 7, 7, 36, 7, 36, 5, - 29, 29, 60, 33, 36, 1, 33, 16, 33, 20, - 36, 29, 60, 36, 61, 7, 85, 36, 7, 65, - 0, 60, 1, 76, 29, 29, 33, 8, 36, 85, - 33, 29, 29, 33, 36, 29, 29, 36, 33, 29, - 17, 7, -1, 8, 29, 36, 29, 48, 8, 7, - 36, 8, 74, 29, 36, 8, 8, 7, 36, 7, - 36, 8, 7, 8, 8, 15, 8, 15, 55, 42, - 8, 6, 60, 10, 8, 7, 7, 61, 62, 50, - 53, 8, 29, 54, 8, 20, 61, 62, 8, 61, - 62, 8, 2, 61, 62, 29, 50, 61, 62, 56, - 54, 33, 33, 56, 40, 61, 62, 8, 8, 61, - 61, 62, 40, 8, 56, 51, 60, 40, 55, 8, - 29, -1, 60, 51, 40, 15, -1, -1, 51, 25, - 12, 27, 56, 60, 25, 51, 27, 15, 33, 56, - 60, 25, 38, 27, 34, 8, 36, 38, 25, 25, - 27, 27, 61, 62, 38, 29, 34, 12, 36, 60, - 60, 38, 38, 25, 15, 27, 25, 25, 27, 27, - 12, 60, 8, 29, -1, 57, 38, 29, 8, 38, - 38, 63, 25, 34, 27, 36, 8, 61, 62, -1, - 25, 25, 27, 27, 25, 38, 27, -1, 61, 62, - 18, 19, 57, 38, 38, 61, 62, 38, 63, 61, - 62, -1, -1, 22, -1, 57, 18, 19, 18, 19, - 29, 63, 18, 19, 22, 61, 62, 45, 46, -1, - 60, 29, -1, -1, -1, -1, -1, -1, -1, 61, - 62, -1, -1, 45, 46, 45, 46, 23, 24, 45, - 46, -1, -1, 23, 24, -1, 32, 22, 25, 35, - 27, 37, 32, 72, 29, 35, -1, 37, 23, 24, - -1, 38, 81, -1, 72, 84, 31, 32, -1, -1, - 35, 22, 37, 81, 23, 24, 84, -1, 29, -1, - 55, -1, 31, 32, 23, 24, 35, -1, 37, -1, - -1, -1, 31, 32, -1, -1, 35, 72, 37, -1, - -1, -1, -1, -1, 55, -1, 81, 12, 13, 84, - -1, 23, 24, -1, -1, -1, -1, 22, -1, -1, - 32, 72, -1, 35, 29, 37, 12, 13, 33, 34, - 81, 36, -1, 84, -1, -1, 22, -1, 43, -1, - -1, -1, 47, 29, -1, -1, -1, 33, 34, -1, - 36, -1, -1, -1, -1, -1, -1, 43, -1, -1, - 65, 47, 67, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 3, 78, 79, 80, 23, 24, -1, 65, - -1, 67, 13, -1, 31, 32, 17, -1, 35, -1, - 37, -1, 78, 79, 80, 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, 3, -1, -1, -1, -1, 77, -1, -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, -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, 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, 11, 12, 13, -1, -1, -1, -1, -1, -1, + 76, 61, 60, 8, 48, 29, 60, 7, 29, 2, + 48, 29, 60, 33, 1, 61, 8, 76, 48, 36, + 29, 2, 29, 8, 8, 33, 29, 33, 8, 55, + 7, 60, 33, 7, 17, 5, 55, 36, 29, 7, + 1, 36, 7, 7, 7, 55, 36, 7, 61, 60, + 16, 55, 5, 31, 36, 2, 29, 33, 29, 5, + 85, 36, 7, 20, 36, 7, 60, 36, 17, 36, + 85, 33, 8, 8, 33, 29, 7, 2, 36, 29, + 36, 33, 8, 7, 7, 29, 29, 8, 29, 0, + 76, 1, 8, 48, 33, 74, 36, 29, 36, 36, + 29, 29, 36, 7, -1, 8, 8, 8, 8, 60, + 8, 15, 60, 40, 7, 8, 8, 8, 8, 6, + 40, 40, 55, 7, 51, 42, 8, 7, 29, 8, + 8, 51, 51, 20, 7, 65, 53, 50, 8, 61, + 62, 54, 15, 61, 62, 61, 61, 62, 29, 33, + 8, 8, 40, 56, 7, 36, 61, 62, 60, 29, + 60, 8, 60, 51, 56, 56, 61, 62, 29, 15, + 60, -1, 61, 62, 56, 50, 61, 62, 29, 54, + 33, 60, 60, 25, 25, 27, 27, 12, 34, 12, + 36, 25, 25, 27, 27, -1, 38, 38, 8, -1, + 61, 62, 60, 60, 38, 38, -1, -1, 10, 56, + 61, 62, 25, 25, 27, 27, 25, 25, 27, 27, + 15, 8, 25, 29, 27, 38, 38, 15, 29, 38, + 38, 25, 57, 27, 57, 38, 8, -1, 63, 34, + 63, 36, -1, -1, 38, 25, 34, 27, 36, -1, + -1, 61, 62, 55, -1, 61, 62, 25, 38, 27, + 61, 62, -1, 25, -1, 27, 18, 19, 18, 19, + 38, 18, 19, 22, 61, 62, 38, 18, 19, -1, + 29, -1, -1, -1, 22, -1, 12, -1, -1, 61, + 62, 29, -1, 45, 46, 45, 46, -1, 45, 46, + 23, 24, -1, -1, 45, 46, 22, -1, 31, 32, + 23, 24, 35, 29, 37, -1, -1, -1, 31, 32, + 22, -1, 35, 72, 37, -1, -1, 29, -1, -1, + -1, 57, 81, -1, 72, 84, -1, 63, -1, 55, + 23, 24, -1, 81, -1, -1, 84, -1, 31, 32, + 3, -1, 35, 55, 37, -1, 72, -1, -1, -1, + 13, -1, 23, 24, 17, 81, -1, -1, 84, -1, + 72, 32, -1, 26, 35, 28, 37, -1, -1, 81, + -1, -1, 84, 3, -1, -1, 39, -1, 41, 42, + -1, -1, -1, 13, -1, -1, 49, 17, -1, 52, + 53, -1, -1, -1, -1, 58, 26, -1, 28, -1, + -1, 64, -1, -1, -1, -1, -1, -1, -1, 39, + 3, 41, 42, -1, 77, -1, -1, 23, 24, 49, + 13, -1, 52, 53, 17, 31, 32, -1, 58, 35, + -1, 37, -1, 26, 64, 28, -1, -1, 31, -1, + -1, -1, -1, -1, -1, -1, 39, 77, 41, 42, + -1, -1, -1, -1, -1, -1, 49, -1, -1, 52, + 53, -1, -1, -1, -1, 58, -1, -1, -1, -1, + -1, 64, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 12, 13, 77, -1, -1, -1, -1, -1, -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, + -1, -1, -1, 43, -1, -1, -1, 47, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 65, -1, 67, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 78, 79, 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, + -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, + -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, 56, -1, -1, + -1, -1, -1, -1, -1, -1, 65, -1, 67, -1, + 69, -1, 71, -1, 73, -1, -1, -1, -1, 78, + 79, 80, -1, -1, -1, -1, -1, -1, -1, 11, + 12, 13, -1, -1, -1, -1, -1, -1, -1, -1, + 22, -1, -1, -1, -1, -1, -1, 29, -1, -1, + -1, 33, 34, -1, 36, -1, -1, -1, 40, -1, + 42, 43, 44, -1, -1, 47, -1, -1, -1, 51, + -1, 53, -1, -1, 56, -1, -1, -1, -1, -1, + -1, -1, -1, 65, -1, 67, -1, 69, -1, 71, + -1, 73, -1, -1, -1, -1, 78, 79, 80, -1, + -1, -1, -1, -1, -1, -1, 7, -1, -1, -1, + 11, 12, 13, -1, -1, -1, -1, -1, -1, -1, + -1, 22, -1, -1, -1, -1, -1, -1, 29, -1, + -1, -1, 33, 34, -1, 36, -1, -1, -1, 40, + -1, 42, 43, 44, -1, -1, 47, -1, -1, -1, + 51, -1, 53, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 65, -1, 67, -1, 69, -1, + 71, -1, 73, -1, -1, -1, -1, 78, 79, 80, + -1, -1, -1, -1, -1, -1, -1, 4, 5, 6, + -1, -1, 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, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 59, -1, -1, -1, -1, -1, -1, 66, 67, 68, + -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, - 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, + -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, - 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, + -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, 83, -1, -1, -1, -1, 4, -1, -1, + 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, @@ -596,62 +619,45 @@ const int JavaScriptGrammar::action_check [] = { 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, -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, -1, -1, -1, -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, -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, + 79, 80, 81, 82, 83, -1, -1, -1, -1, - 11, 20, 20, 16, 12, 22, 11, 87, 20, 54, - 20, 12, 58, 20, 72, 72, 58, 12, 12, 84, - 89, 20, 12, 11, 58, 9, 78, 20, 20, 11, - 11, 14, 12, 12, 11, 11, 5, 11, 76, 12, - 11, 90, 20, 58, 12, 20, 11, 9, 12, 12, - 20, 23, 11, -1, 12, 12, 12, 12, 11, 10, - 9, 11, 9, 11, 31, 31, 8, -1, 10, 36, - 36, 31, 6, 6, 11, 35, 13, 31, -1, 31, - 14, 14, 36, 35, -1, 31, 31, 12, 31, -1, - 31, 31, 31, 31, 2, 36, 41, 36, 36, 31, - 43, 47, -1, 35, 25, 45, 14, 28, 31, 31, - 12, 31, 34, 36, 31, 31, 36, 33, 31, 36, - 33, 31, 31, 33, 33, 31, 31, 31, 34, 33, - -1, 36, 12, 31, 31, 33, 33, 31, 12, 12, - 23, 24, 36, 31, 31, 33, 33, 31, 20, 33, - 31, 20, 31, 55, 31, 27, 37, 36, 27, 25, - 37, 31, 28, 31, 31, -1, 31, 37, 33, 37, - -1, -1, 39, 7, -1, 55, 10, 31, 31, 33, - 33, 55, 55, 31, 31, 33, 33, 31, 31, 31, - 31, 31, 36, 36, 36, 36, 36, 11, -1, 13, - 31, 31, 42, 46, 48, 36, 36, -1, 31, -1, - 31, 53, 53, 36, 44, 36, 31, 38, -1, 31, - 31, 36, 53, 38, 36, 36, 31, 38, 40, 31, - 53, 36, -1, -1, 36, -1, 38, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 53, -1, + 12, 20, 11, 20, 12, 16, 20, 20, 84, 58, + 87, 54, 58, 20, 89, 12, 11, 20, 12, 12, + 72, 72, 22, 58, 20, 9, 11, 14, 20, 11, + 78, 12, 12, 11, 11, 5, 11, 20, 76, 12, + 11, 20, 11, 90, 12, 11, 20, 23, 58, 12, + 11, -1, 12, 12, 12, 12, 12, 12, 10, 9, + 9, -1, 6, 11, 11, -1, 31, 31, -1, 31, + 14, 36, 36, 35, 8, 2, 10, 31, 31, -1, + 31, 35, 35, -1, -1, 36, 11, 14, 31, 31, + 31, 31, 31, 6, 11, 31, 13, 36, 31, 41, + 36, 14, 43, 36, 47, 45, 25, 31, 31, 28, + 31, 34, 36, 31, 12, 36, 12, 31, 36, 33, + 31, 31, 33, 33, 31, 31, 33, 31, 34, 31, + 31, 33, 36, -1, 31, 36, 33, 31, 12, 33, + 12, 23, 24, 31, 31, 33, 33, 31, 31, 33, + 31, 20, 25, 20, 37, 28, 37, 55, 27, 55, + 27, 31, -1, 31, -1, 31, 36, 31, 31, 37, + 33, 37, 31, 7, 33, 39, 10, 31, 31, 33, + 33, 55, 31, 55, 33, 31, 31, 31, 31, 31, + 36, 36, 36, 36, 36, 11, -1, 13, 31, 31, + 42, 46, 48, 36, 36, -1, 31, -1, 31, 53, + 53, 36, 44, 36, 31, 38, -1, 31, 31, 36, + 53, 38, 36, 36, 31, 38, 40, 31, 53, 36, + -1, -1, 36, -1, 38, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 53, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 11, -1, 13, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 96, -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, diff --git a/src/declarative/qml/parser/javascriptgrammar_p.h b/src/declarative/qml/parser/javascriptgrammar_p.h index aac4c7e..4792cec 100644 --- a/src/declarative/qml/parser/javascriptgrammar_p.h +++ b/src/declarative/qml/parser/javascriptgrammar_p.h @@ -1,4 +1,28 @@ // This file was generated by qlalr - DO NOT EDIT! +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** +** This file is part of the $MODULE$ of the Qt Toolkit. +** +** $TROLLTECH_DUAL_LICENSE$ +** +** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +** +****************************************************************************/ + +// +// 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 @@ -96,14 +120,14 @@ public: T_XOR_EQ = 77, ACCEPT_STATE = 7, - RULE_COUNT = 297, - STATE_COUNT = 521, + RULE_COUNT = 296, + STATE_COUNT = 520, TERMINAL_COUNT = 88, NON_TERMINAL_COUNT = 98, - GOTO_INDEX_OFFSET = 521, - GOTO_INFO_OFFSET = 1647, - GOTO_CHECK_OFFSET = 1647 + GOTO_INDEX_OFFSET = 520, + GOTO_INFO_OFFSET = 1629, + GOTO_CHECK_OFFSET = 1629 }; static const char *const spell []; diff --git a/src/declarative/qml/parser/javascriptparser.cpp b/src/declarative/qml/parser/javascriptparser.cpp index 8708516..ea65267 100644 --- a/src/declarative/qml/parser/javascriptparser.cpp +++ b/src/declarative/qml/parser/javascriptparser.cpp @@ -258,16 +258,6 @@ case 21: { } break; case 22: { - AST::UiPublicMember *node = makeAstNode (driver->nodePool(), sym(2).sval, sym(3).sval, - sym(5).Expression, sym(6).UiObjectInitializer); - node->publicToken = loc(1); - node->attributeTypeToken = loc(2); - node->identifierToken = loc(3); - node->colonToken = loc(4); - sym(1).Node = node; -} break; - -case 23: { AST::UiPublicMember *node = makeAstNode (driver->nodePool(), sym(2).sval, sym(3).sval); node->publicToken = loc(1); node->attributeTypeToken = loc(2); @@ -275,9 +265,9 @@ case 23: { sym(1).Node = node; } break; -case 24: { +case 23: { AST::UiPublicMember *node = makeAstNode (driver->nodePool(), sym(2).sval, sym(3).sval, - sym(5).Expression, static_cast(0)); + sym(5).Expression); node->publicToken = loc(1); node->attributeTypeToken = loc(2); node->identifierToken = loc(3); @@ -285,69 +275,69 @@ case 24: { sym(1).Node = node; } break; -case 25: { +case 24: { sym(1).Node = makeAstNode(driver->nodePool(), sym(1).Statement); } break; -case 26: { +case 25: { sym(1).Node = makeAstNode(driver->nodePool(), sym(1).Statement); } break; -case 27: { +case 26: { AST::UiQualifiedId *node = makeAstNode (driver->nodePool(), sym(1).sval); node->identifierToken = loc(1); sym(1).Node = node; } break; -case 28: { +case 27: { AST::UiQualifiedId *node = makeAstNode (driver->nodePool(), sym(1).UiQualifiedId, sym(3).sval); node->identifierToken = loc(3); sym(1).Node = node; } break; -case 29: { +case 28: { AST::ThisExpression *node = makeAstNode (driver->nodePool()); node->thisToken = loc(1); sym(1).Node = node; } break; -case 30: { +case 29: { AST::IdentifierExpression *node = makeAstNode (driver->nodePool(), sym(1).sval); node->identifierToken = loc(1); sym(1).Node = node; } break; -case 31: { +case 30: { AST::NullExpression *node = makeAstNode (driver->nodePool()); node->nullToken = loc(1); sym(1).Node = node; } break; -case 32: { +case 31: { AST::TrueLiteral *node = makeAstNode (driver->nodePool()); node->trueToken = loc(1); sym(1).Node = node; } break; -case 33: { +case 32: { AST::FalseLiteral *node = makeAstNode (driver->nodePool()); node->falseToken = loc(1); sym(1).Node = node; } break; -case 34: { +case 33: { AST::NumericLiteral *node = makeAstNode (driver->nodePool(), sym(1).dval); node->literalToken = loc(1); sym(1).Node = node; } break; -case 35: { +case 34: { AST::StringLiteral *node = makeAstNode (driver->nodePool(), sym(1).sval); node->literalToken = loc(1); sym(1).Node = node; } break; -case 36: { +case 35: { bool rx = lexer->scanRegExp(Lexer::NoPrefix); if (!rx) { diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, lexer->startLineNo(), @@ -359,7 +349,7 @@ case 36: { sym(1).Node = node; } break; -case 37: { +case 36: { bool rx = lexer->scanRegExp(Lexer::EqualPrefix); if (!rx) { diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, lexer->startLineNo(), @@ -371,21 +361,21 @@ case 37: { sym(1).Node = node; } break; -case 38: { +case 37: { AST::ArrayLiteral *node = makeAstNode (driver->nodePool(), sym(2).Elision); node->lbracketToken = loc(1); node->rbracketToken = loc(3); sym(1).Node = node; } break; -case 39: { +case 38: { AST::ArrayLiteral *node = makeAstNode (driver->nodePool(), sym(2).ElementList->finish ()); node->lbracketToken = loc(1); node->rbracketToken = loc(3); sym(1).Node = node; } break; -case 40: { +case 39: { AST::ArrayLiteral *node = makeAstNode (driver->nodePool(), sym(2).ElementList->finish (), sym(4).Elision); node->lbracketToken = loc(1); node->commaToken = loc(3); @@ -393,59 +383,59 @@ case 40: { sym(1).Node = node; } break; -case 41: { +case 40: { if (sym(2).Node) sym(1).Node = makeAstNode (driver->nodePool(), sym(2).PropertyNameAndValueList->finish ()); else sym(1).Node = makeAstNode (driver->nodePool()); } break; -case 42: { +case 41: { sym(1).Node = makeAstNode (driver->nodePool(), sym(2).PropertyNameAndValueList->finish ()); } break; -case 43: { +case 42: { sym(1) = sym(2); } break; -case 44: { +case 43: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Elision, sym(2).Expression); } break; -case 45: { +case 44: { AST::ElementList *node = makeAstNode (driver->nodePool(), sym(1).ElementList, sym(3).Elision, sym(4).Expression); node->commaToken = loc(2); sym(1).Node = node; } break; -case 46: { +case 45: { AST::Elision *node = makeAstNode (driver->nodePool()); node->commaToken = loc(1); sym(1).Node = node; } break; -case 47: { +case 46: { AST::Elision *node = makeAstNode (driver->nodePool(), sym(1).Elision); node->commaToken = loc(2); sym(1).Node = node; } break; -case 48: { +case 47: { sym(1).Node = 0; } break; -case 49: { +case 48: { sym(1).Elision = sym(1).Elision->finish (); } break; -case 50: { +case 49: { AST::PropertyNameAndValueList *node = makeAstNode (driver->nodePool(), sym(1).PropertyName, sym(3).Expression); node->colonToken = loc(2); sym(1).Node = node; } break; -case 51: { +case 50: { AST::PropertyNameAndValueList *node = makeAstNode (driver->nodePool(), sym(1).PropertyNameAndValueList, sym(3).PropertyName, sym(5).Expression); node->commaToken = loc(2); @@ -453,30 +443,32 @@ case 51: { sym(1).Node = node; } break; -case 52: { +case 51: { AST::IdentifierPropertyName *node = makeAstNode (driver->nodePool(), sym(1).sval); node->propertyNameToken = loc(1); sym(1).Node = node; } break; -case 53: { +case 52: { AST::StringLiteralPropertyName *node = makeAstNode (driver->nodePool(), sym(1).sval); node->propertyNameToken = loc(1); sym(1).Node = node; } break; -case 54: { +case 53: { AST::NumericLiteralPropertyName *node = makeAstNode (driver->nodePool(), sym(1).dval); node->propertyNameToken = loc(1); sym(1).Node = node; } break; -case 55: { +case 54: { AST::IdentifierPropertyName *node = makeAstNode (driver->nodePool(), sym(1).sval); node->propertyNameToken = loc(1); sym(1).Node = node; } break; +case 55: + case 56: case 57: @@ -536,27 +528,25 @@ case 83: case 84: case 85: - -case 86: { sym(1).sval = driver->intern(lexer->characterBuffer(), lexer->characterCount()); } break; -case 91: { +case 90: { AST::ArrayMemberExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression); node->lbracketToken = loc(2); node->rbracketToken = loc(4); sym(1).Node = node; } break; -case 92: { +case 91: { AST::FieldMemberExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).sval); node->dotToken = loc(2); node->identifierToken = loc(3); sym(1).Node = node; } break; -case 93: { +case 92: { AST::NewMemberExpression *node = makeAstNode (driver->nodePool(), sym(2).Expression, sym(4).ArgumentList); node->newToken = loc(1); node->lparenToken = loc(3); @@ -564,384 +554,384 @@ case 93: { sym(1).Node = node; } break; -case 95: { +case 94: { AST::NewExpression *node = makeAstNode (driver->nodePool(), sym(2).Expression); node->newToken = loc(1); sym(1).Node = node; } break; -case 96: { +case 95: { AST::CallExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).ArgumentList); node->lparenToken = loc(2); node->rparenToken = loc(4); sym(1).Node = node; } break; -case 97: { +case 96: { AST::CallExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).ArgumentList); node->lparenToken = loc(2); node->rparenToken = loc(4); sym(1).Node = node; } break; -case 98: { +case 97: { AST::ArrayMemberExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression); node->lbracketToken = loc(2); node->rbracketToken = loc(4); sym(1).Node = node; } break; -case 99: { +case 98: { AST::FieldMemberExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).sval); node->dotToken = loc(2); node->identifierToken = loc(3); sym(1).Node = node; } break; -case 100: { +case 99: { sym(1).Node = 0; } break; -case 101: { +case 100: { sym(1).Node = sym(1).ArgumentList->finish(); } break; -case 102: { +case 101: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression); } break; -case 103: { +case 102: { AST::ArgumentList *node = makeAstNode (driver->nodePool(), sym(1).ArgumentList, sym(3).Expression); node->commaToken = loc(2); sym(1).Node = node; } break; -case 107: { +case 106: { AST::PostIncrementExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression); node->incrementToken = loc(2); sym(1).Node = node; } break; -case 108: { +case 107: { AST::PostDecrementExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression); node->decrementToken = loc(2); sym(1).Node = node; } break; -case 110: { +case 109: { AST::DeleteExpression *node = makeAstNode (driver->nodePool(), sym(2).Expression); node->deleteToken = loc(1); sym(1).Node = node; } break; -case 111: { +case 110: { AST::VoidExpression *node = makeAstNode (driver->nodePool(), sym(2).Expression); node->voidToken = loc(1); sym(1).Node = node; } break; -case 112: { +case 111: { AST::TypeOfExpression *node = makeAstNode (driver->nodePool(), sym(2).Expression); node->typeofToken = loc(1); sym(1).Node = node; } break; -case 113: { +case 112: { AST::PreIncrementExpression *node = makeAstNode (driver->nodePool(), sym(2).Expression); node->incrementToken = loc(1); sym(1).Node = node; } break; -case 114: { +case 113: { AST::PreDecrementExpression *node = makeAstNode (driver->nodePool(), sym(2).Expression); node->decrementToken = loc(1); sym(1).Node = node; } break; -case 115: { +case 114: { AST::UnaryPlusExpression *node = makeAstNode (driver->nodePool(), sym(2).Expression); node->plusToken = loc(1); sym(1).Node = node; } break; -case 116: { +case 115: { AST::UnaryMinusExpression *node = makeAstNode (driver->nodePool(), sym(2).Expression); node->minusToken = loc(1); sym(1).Node = node; } break; -case 117: { +case 116: { AST::TildeExpression *node = makeAstNode (driver->nodePool(), sym(2).Expression); node->tildeToken = loc(1); sym(1).Node = node; } break; -case 118: { +case 117: { AST::NotExpression *node = makeAstNode (driver->nodePool(), sym(2).Expression); node->notToken = loc(1); sym(1).Node = node; } break; -case 120: { +case 119: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Mul, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 121: { +case 120: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Div, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 122: { +case 121: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Mod, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 124: { +case 123: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Add, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 125: { +case 124: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Sub, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 127: { +case 126: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::LShift, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 128: { +case 127: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::RShift, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 129: { +case 128: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::URShift, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 131: { +case 130: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Lt, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 132: { +case 131: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Gt, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 133: { +case 132: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Le, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 134: { +case 133: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Ge, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 135: { +case 134: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::InstanceOf, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 136: { +case 135: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::In, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 138: { +case 137: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Lt, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 139: { +case 138: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Gt, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 140: { +case 139: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Le, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 141: { +case 140: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Ge, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 142: { +case 141: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::InstanceOf, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 144: { +case 143: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Equal, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 145: { +case 144: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::NotEqual, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 146: { +case 145: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::StrictEqual, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 147: { +case 146: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::StrictNotEqual, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 149: { +case 148: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Equal, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 150: { +case 149: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::NotEqual, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 151: { +case 150: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::StrictEqual, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 152: { +case 151: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::StrictNotEqual, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 154: { +case 153: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::BitAnd, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 156: { +case 155: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::BitAnd, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 158: { +case 157: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::BitXor, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 160: { +case 159: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::BitXor, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 162: { +case 161: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::BitOr, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 164: { +case 163: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::BitOr, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 166: { +case 165: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::And, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 168: { +case 167: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::And, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 170: { +case 169: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Or, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 172: { +case 171: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Or, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 174: { +case 173: { AST::ConditionalExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression, sym(5).Expression); node->questionToken = loc(2); @@ -949,7 +939,7 @@ case 174: { sym(1).Node = node; } break; -case 176: { +case 175: { AST::ConditionalExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression, sym(5).Expression); node->questionToken = loc(2); @@ -957,112 +947,112 @@ case 176: { sym(1).Node = node; } break; -case 178: { +case 177: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(2).ival, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 180: { +case 179: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(2).ival, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 181: { +case 180: { sym(1).ival = QSOperator::Assign; } break; -case 182: { +case 181: { sym(1).ival = QSOperator::InplaceMul; } break; -case 183: { +case 182: { sym(1).ival = QSOperator::InplaceDiv; } break; -case 184: { +case 183: { sym(1).ival = QSOperator::InplaceMod; } break; -case 185: { +case 184: { sym(1).ival = QSOperator::InplaceAdd; } break; -case 186: { +case 185: { sym(1).ival = QSOperator::InplaceSub; } break; -case 187: { +case 186: { sym(1).ival = QSOperator::InplaceLeftShift; } break; -case 188: { +case 187: { sym(1).ival = QSOperator::InplaceRightShift; } break; -case 189: { +case 188: { sym(1).ival = QSOperator::InplaceURightShift; } break; -case 190: { +case 189: { sym(1).ival = QSOperator::InplaceAnd; } break; -case 191: { +case 190: { sym(1).ival = QSOperator::InplaceXor; } break; -case 192: { +case 191: { sym(1).ival = QSOperator::InplaceOr; } break; -case 194: { +case 193: { AST::Expression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression); node->commaToken = loc(2); sym(1).Node = node; } break; -case 195: { +case 194: { sym(1).Node = 0; } break; -case 198: { +case 197: { AST::Expression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression); node->commaToken = loc(2); sym(1).Node = node; } break; -case 199: { +case 198: { sym(1).Node = 0; } break; -case 216: { +case 215: { AST::Block *node = makeAstNode (driver->nodePool(), sym(2).StatementList); node->lbraceToken = loc(1); node->rbraceToken = loc(3); sym(1).Node = node; } break; -case 217: { +case 216: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Statement); } break; -case 218: { +case 217: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).StatementList, sym(2).Statement); } break; -case 219: { +case 218: { sym(1).Node = 0; } break; -case 220: { +case 219: { sym(1).Node = sym(1).StatementList->finish (); } break; -case 222: { +case 221: { AST::VariableStatement *node = makeAstNode (driver->nodePool(), sym(2).VariableDeclarationList->finish (/*readOnly=*/sym(1).ival == T_CONST)); node->declarationKindToken = loc(1); @@ -1070,76 +1060,76 @@ case 222: { sym(1).Node = node; } break; -case 223: { +case 222: { sym(1).ival = T_CONST; } break; -case 224: { +case 223: { sym(1).ival = T_VAR; } break; -case 225: { +case 224: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).VariableDeclaration); } break; -case 226: { +case 225: { AST::VariableDeclarationList *node = makeAstNode (driver->nodePool(), sym(1).VariableDeclarationList, sym(3).VariableDeclaration); node->commaToken = loc(2); sym(1).Node = node; } break; -case 227: { +case 226: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).VariableDeclaration); } break; -case 228: { +case 227: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).VariableDeclarationList, sym(3).VariableDeclaration); } break; -case 229: { +case 228: { AST::VariableDeclaration *node = makeAstNode (driver->nodePool(), sym(1).sval, sym(2).Expression); node->identifierToken = loc(1); sym(1).Node = node; } break; -case 230: { +case 229: { AST::VariableDeclaration *node = makeAstNode (driver->nodePool(), sym(1).sval, sym(2).Expression); node->identifierToken = loc(1); sym(1).Node = node; } break; -case 231: { +case 230: { // ### TODO: AST for initializer sym(1) = sym(2); } break; -case 232: { +case 231: { sym(1).Node = 0; } break; -case 234: { +case 233: { // ### TODO: AST for initializer sym(1) = sym(2); } break; -case 235: { +case 234: { sym(1).Node = 0; } break; -case 237: { +case 236: { AST::EmptyStatement *node = makeAstNode (driver->nodePool()); node->semicolonToken = loc(1); sym(1).Node = node; } break; -case 239: { +case 238: { AST::ExpressionStatement *node = makeAstNode (driver->nodePool(), sym(1).Expression); node->semicolonToken = loc(2); sym(1).Node = node; } break; -case 240: { +case 239: { AST::IfStatement *node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Statement, sym(7).Statement); node->ifToken = loc(1); node->lparenToken = loc(2); @@ -1148,7 +1138,7 @@ case 240: { sym(1).Node = node; } break; -case 241: { +case 240: { AST::IfStatement *node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Statement); node->ifToken = loc(1); node->lparenToken = loc(2); @@ -1156,7 +1146,7 @@ case 241: { sym(1).Node = node; } break; -case 243: { +case 242: { AST::DoWhileStatement *node = makeAstNode (driver->nodePool(), sym(2).Statement, sym(5).Expression); node->doToken = loc(1); node->whileToken = loc(3); @@ -1166,7 +1156,7 @@ case 243: { sym(1).Node = node; } break; -case 244: { +case 243: { AST::WhileStatement *node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Statement); node->whileToken = loc(1); node->lparenToken = loc(2); @@ -1174,7 +1164,7 @@ case 244: { sym(1).Node = node; } break; -case 245: { +case 244: { AST::ForStatement *node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Expression, sym(7).Expression, sym(9).Statement); node->forToken = loc(1); @@ -1185,7 +1175,7 @@ case 245: { sym(1).Node = node; } break; -case 246: { +case 245: { AST::LocalForStatement *node = makeAstNode (driver->nodePool(), sym(4).VariableDeclarationList->finish (/*readOnly=*/false), sym(6).Expression, sym(8).Expression, sym(10).Statement); @@ -1198,7 +1188,7 @@ case 246: { sym(1).Node = node; } break; -case 247: { +case 246: { AST:: ForEachStatement *node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Expression, sym(7).Statement); node->forToken = loc(1); @@ -1208,7 +1198,7 @@ case 247: { sym(1).Node = node; } break; -case 248: { +case 247: { AST::LocalForEachStatement *node = makeAstNode (driver->nodePool(), sym(4).VariableDeclaration, sym(6).Expression, sym(8).Statement); node->forToken = loc(1); @@ -1219,14 +1209,14 @@ case 248: { sym(1).Node = node; } break; -case 250: { +case 249: { AST::ContinueStatement *node = makeAstNode (driver->nodePool()); node->continueToken = loc(1); node->semicolonToken = loc(2); sym(1).Node = node; } break; -case 252: { +case 251: { AST::ContinueStatement *node = makeAstNode (driver->nodePool(), sym(2).sval); node->continueToken = loc(1); node->identifierToken = loc(2); @@ -1234,14 +1224,14 @@ case 252: { sym(1).Node = node; } break; -case 254: { +case 253: { AST::BreakStatement *node = makeAstNode (driver->nodePool()); node->breakToken = loc(1); node->semicolonToken = loc(2); sym(1).Node = node; } break; -case 256: { +case 255: { AST::BreakStatement *node = makeAstNode (driver->nodePool(), sym(2).sval); node->breakToken = loc(1); node->identifierToken = loc(2); @@ -1249,14 +1239,14 @@ case 256: { sym(1).Node = node; } break; -case 258: { +case 257: { AST::ReturnStatement *node = makeAstNode (driver->nodePool(), sym(2).Expression); node->returnToken = loc(1); node->semicolonToken = loc(3); sym(1).Node = node; } break; -case 259: { +case 258: { AST::WithStatement *node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Statement); node->withToken = loc(1); node->lparenToken = loc(2); @@ -1264,7 +1254,7 @@ case 259: { sym(1).Node = node; } break; -case 260: { +case 259: { AST::SwitchStatement *node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).CaseBlock); node->switchToken = loc(1); node->lparenToken = loc(2); @@ -1272,83 +1262,83 @@ case 260: { sym(1).Node = node; } break; -case 261: { +case 260: { AST::CaseBlock *node = makeAstNode (driver->nodePool(), sym(2).CaseClauses); node->lbraceToken = loc(1); node->rbraceToken = loc(3); sym(1).Node = node; } break; -case 262: { +case 261: { AST::CaseBlock *node = makeAstNode (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 263: { +case 262: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).CaseClause); } break; -case 264: { +case 263: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).CaseClauses, sym(2).CaseClause); } break; -case 265: { +case 264: { sym(1).Node = 0; } break; -case 266: { +case 265: { sym(1).Node = sym(1).CaseClauses->finish (); } break; -case 267: { +case 266: { AST::CaseClause *node = makeAstNode (driver->nodePool(), sym(2).Expression, sym(4).StatementList); node->caseToken = loc(1); node->colonToken = loc(3); sym(1).Node = node; } break; -case 268: { +case 267: { AST::DefaultClause *node = makeAstNode (driver->nodePool(), sym(3).StatementList); node->defaultToken = loc(1); node->colonToken = loc(2); sym(1).Node = node; } break; -case 269: { +case 268: { AST::LabelledStatement *node = makeAstNode (driver->nodePool(), sym(1).sval, sym(3).Statement); node->identifierToken = loc(1); node->colonToken = loc(2); sym(1).Node = node; } break; -case 271: { +case 270: { AST::ThrowStatement *node = makeAstNode (driver->nodePool(), sym(2).Expression); node->throwToken = loc(1); node->semicolonToken = loc(3); sym(1).Node = node; } break; -case 272: { +case 271: { AST::TryStatement *node = makeAstNode (driver->nodePool(), sym(2).Statement, sym(3).Catch); node->tryToken = loc(1); sym(1).Node = node; } break; -case 273: { +case 272: { AST::TryStatement *node = makeAstNode (driver->nodePool(), sym(2).Statement, sym(3).Finally); node->tryToken = loc(1); sym(1).Node = node; } break; -case 274: { +case 273: { AST::TryStatement *node = makeAstNode (driver->nodePool(), sym(2).Statement, sym(3).Catch, sym(4).Finally); node->tryToken = loc(1); sym(1).Node = node; } break; -case 275: { +case 274: { AST::Catch *node = makeAstNode (driver->nodePool(), sym(3).sval, sym(5).Statement); node->catchToken = loc(1); node->lparenToken = loc(2); @@ -1357,20 +1347,20 @@ case 275: { sym(1).Node = node; } break; -case 276: { +case 275: { AST::Finally *node = makeAstNode (driver->nodePool(), sym(2).Statement); node->finallyToken = loc(1); sym(1).Node = node; } break; -case 278: { +case 277: { AST::DebuggerStatement *node = makeAstNode (driver->nodePool()); node->debuggerToken = loc(1); node->semicolonToken = loc(2); sym(1).Node = node; } break; -case 279: { +case 278: { AST::FunctionDeclaration *node = makeAstNode (driver->nodePool(), sym(2).sval, sym(4).FormalParameterList, sym(7).FunctionBody); node->functionToken = loc(1); node->identifierToken = loc(2); @@ -1381,7 +1371,7 @@ case 279: { sym(1).Node = node; } break; -case 280: { +case 279: { AST::FunctionExpression *node = makeAstNode (driver->nodePool(), sym(2).sval, sym(4).FormalParameterList, sym(7).FunctionBody); node->functionToken = loc(1); if (sym(2).sval) @@ -1393,56 +1383,56 @@ case 280: { sym(1).Node = node; } break; -case 281: { +case 280: { AST::FormalParameterList *node = makeAstNode (driver->nodePool(), sym(1).sval); node->identifierToken = loc(1); sym(1).Node = node; } break; -case 282: { +case 281: { AST::FormalParameterList *node = makeAstNode (driver->nodePool(), sym(1).FormalParameterList, sym(3).sval); node->commaToken = loc(2); node->identifierToken = loc(3); sym(1).Node = node; } break; -case 283: { +case 282: { sym(1).Node = 0; } break; -case 284: { +case 283: { sym(1).Node = sym(1).FormalParameterList->finish (); } break; -case 285: { +case 284: { sym(1).Node = 0; } break; -case 287: { +case 286: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).SourceElements->finish ()); } break; -case 288: { +case 287: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).SourceElement); } break; -case 289: { +case 288: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).SourceElements, sym(2).SourceElement); } break; -case 290: { +case 289: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Statement); } break; -case 291: { +case 290: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).FunctionDeclaration); } break; -case 292: { +case 291: { sym(1).sval = 0; } break; -case 294: { +case 293: { sym(1).Node = 0; } break; diff --git a/src/declarative/qml/parser/javascriptparser_p.h b/src/declarative/qml/parser/javascriptparser_p.h index ee9adf6..d31597b 100644 --- a/src/declarative/qml/parser/javascriptparser_p.h +++ b/src/declarative/qml/parser/javascriptparser_p.h @@ -203,9 +203,9 @@ protected: }; -#define J_SCRIPT_REGEXPLITERAL_RULE1 36 +#define J_SCRIPT_REGEXPLITERAL_RULE1 35 -#define J_SCRIPT_REGEXPLITERAL_RULE2 37 +#define J_SCRIPT_REGEXPLITERAL_RULE2 36 QT_END_NAMESPACE diff --git a/src/declarative/qml/qmlscriptparser.cpp b/src/declarative/qml/qmlscriptparser.cpp index 03e6165..41d2534 100644 --- a/src/declarative/qml/qmlscriptparser.cpp +++ b/src/declarative/qml/qmlscriptparser.cpp @@ -438,13 +438,16 @@ bool ProcessAST::visit(AST::UiImport *node) return false; } -// UiObjectMember: T_PUBLIC T_IDENTIFIER T_IDENTIFIER T_COLON Expression UiObjectInitializer ; +// UiObjectMember: T_PUBLIC UiMemberType T_IDENTIFIER T_COLON Expression +// UiObjectMember: T_PUBLIC UiMemberType T_IDENTIFIER +// +// UiMemberType: "property" | "signal" bool ProcessAST::visit(AST::UiPublicMember *node) { - const QString type = node->type->asString(); + const QString memberType = node->memberType->asString(); const QString name = node->name->asString(); - if (type == QLatin1String("property")) { + if (memberType == QLatin1String("property")) { _stateStack.pushProperty(QLatin1String("properties"), node->publicToken.startLine); Object *obj = defineObjectBinding(node->identifierToken.startLine, @@ -460,7 +463,7 @@ bool ProcessAST::visit(AST::UiPublicMember *node) _stateStack.pop(); // object _stateStack.pop(); // properties - } else if (type == QLatin1String("signal")) { + } else if (memberType == QLatin1String("signal")) { _stateStack.pushProperty(QLatin1String("signals"), node->publicToken.startLine); Object *obj = defineObjectBinding(node->identifierToken.startLine, @@ -474,7 +477,7 @@ bool ProcessAST::visit(AST::UiPublicMember *node) _stateStack.pop(); // object _stateStack.pop(); // signals } else { - qWarning() << "bad public identifier" << type; // ### FIXME + qWarning() << "bad public identifier" << memberType; // ### FIXME } -- cgit v0.12 From 2a74fb788d720e0532f7edde457d3b076dec18f5 Mon Sep 17 00:00:00 2001 From: Roberto Raggi Date: Wed, 22 Apr 2009 18:02:55 +0200 Subject: Updated the QML converter. --- tools/qmlconv/qmlconv.cpp | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/tools/qmlconv/qmlconv.cpp b/tools/qmlconv/qmlconv.cpp index f18ac75..352b3d2 100644 --- a/tools/qmlconv/qmlconv.cpp +++ b/tools/qmlconv/qmlconv.cpp @@ -251,6 +251,10 @@ public: void startDeclareProperty() { out << depthString() << "public property "; + + if (xml.attributes().hasAttribute("type")) + out << "/* " << xml.attributes().value("type").toString() << " */ "; + QString name = xml.attributes().value("name").toString(); if (xml.attributes().hasAttribute("value")) @@ -263,16 +267,7 @@ public: continue; attributes.insert(attribute.name().toString(), attribute.value().toString()); } - if (attributes.isEmpty()) { - out << endl; - } else { - out << " {" << endl; - ++depth; - foreach (QString key, attributes.keys()) - setProperty(key, attributes.value(key)); - --depth; - out << depthString() << "}" << endl; - } + out << endl; emptyLoop(); } -- cgit v0.12 From 06164e4607ddc8eafabd3ed463c309a7075188b6 Mon Sep 17 00:00:00 2001 From: Roberto Raggi Date: Fri, 24 Apr 2009 10:58:34 +0200 Subject: Compile. --- src/declarative/qml/qmldom.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/declarative/qml/qmldom.cpp b/src/declarative/qml/qmldom.cpp index 54cc2e4..bd4d987 100644 --- a/src/declarative/qml/qmldom.cpp +++ b/src/declarative/qml/qmldom.cpp @@ -152,6 +152,12 @@ bool QmlDomDocument::load(QmlEngine *engine, const QByteArray &data) { d->error = QString(); + QmlXmlParser parser; + if(!parser.parse(data)) { + d->error = parser.errorDescription(); + return false; + } + QmlCompiledComponent component; QmlCompiler compiler; // ### @@ -162,15 +168,16 @@ bool QmlDomDocument::load(QmlEngine *engine, const QByteArray &data) return false; } - if(tree) { - component.dump(0, tree); - d->root = tree; + if(parser.tree()) { + component.dump(0, parser.tree()); + d->root = parser.tree(); d->root->addref(); } return true; } + /*! Returns the last load error. The load error will be reset after a successful call to load(). -- cgit v0.12 From 0be10a2ba48a3f3d5201944b6bc049c802d4a164 Mon Sep 17 00:00:00 2001 From: Roberto Raggi Date: Fri, 24 Apr 2009 11:29:13 +0200 Subject: Use the DUI language. --- src/declarative/qml/qmlcompiledcomponent_p.h | 4 +++- src/declarative/qml/qmlcompiler.cpp | 2 +- src/declarative/qml/qmlcompiler_p.h | 2 -- src/declarative/qml/qmlcomponent.cpp | 1 - src/declarative/qml/qmlcompositetypemanager.cpp | 2 +- src/declarative/qml/qmlcompositetypemanager_p.h | 5 ++--- src/declarative/qml/qmldom.cpp | 3 +-- src/declarative/qml/qmlparser.cpp | 1 - src/declarative/qml/qmlparser_p.h | 1 - src/declarative/qml/qmlscriptparser.cpp | 30 +++++++++++++++++++++++++ src/declarative/qml/qmlscriptparser_p.h | 10 +++++++-- src/declarative/qml/qmlxmlparser.cpp | 7 ++++++ src/declarative/qml/qmlxmlparser_p.h | 7 +++--- 13 files changed, 57 insertions(+), 18 deletions(-) diff --git a/src/declarative/qml/qmlcompiledcomponent_p.h b/src/declarative/qml/qmlcompiledcomponent_p.h index fa68eab..883ad64 100644 --- a/src/declarative/qml/qmlcompiledcomponent_p.h +++ b/src/declarative/qml/qmlcompiledcomponent_p.h @@ -46,8 +46,8 @@ #include #include #include -class QmlXmlParser; +QT_BEGIN_HEADER QT_BEGIN_NAMESPACE namespace QmlParser { class Property; @@ -77,4 +77,6 @@ private: QT_END_NAMESPACE +QT_END_HEADER + #endif // QMLCOMPILEDCOMPONENT_P_H diff --git a/src/declarative/qml/qmlcompiler.cpp b/src/declarative/qml/qmlcompiler.cpp index e1a88bb..8cfa148 100644 --- a/src/declarative/qml/qmlcompiler.cpp +++ b/src/declarative/qml/qmlcompiler.cpp @@ -42,7 +42,7 @@ #include "private/qmlcompiler_p.h" #include #include "qmlparser_p.h" -#include "private/qmlxmlparser_p.h" +#include "private/qmlscriptparser_p.h" #include #include #include "private/qmetaobjectbuilder_p.h" diff --git a/src/declarative/qml/qmlcompiler_p.h b/src/declarative/qml/qmlcompiler_p.h index 79d788e..b51eacd 100644 --- a/src/declarative/qml/qmlcompiler_p.h +++ b/src/declarative/qml/qmlcompiler_p.h @@ -50,8 +50,6 @@ class QStringList; QT_BEGIN_NAMESPACE -class QmlXmlParser; -class QmlScriptParser; class QmlEngine; class QmlComponent; class QmlCompiledComponent; diff --git a/src/declarative/qml/qmlcomponent.cpp b/src/declarative/qml/qmlcomponent.cpp index ca849ad..92f6b28 100644 --- a/src/declarative/qml/qmlcomponent.cpp +++ b/src/declarative/qml/qmlcomponent.cpp @@ -51,7 +51,6 @@ #include #include #include -#include "private/qmlxmlparser_p.h" #include "qmlcompiledcomponent_p.h" #include #include diff --git a/src/declarative/qml/qmlcompositetypemanager.cpp b/src/declarative/qml/qmlcompositetypemanager.cpp index b0d121c..b05a6fa 100644 --- a/src/declarative/qml/qmlcompositetypemanager.cpp +++ b/src/declarative/qml/qmlcompositetypemanager.cpp @@ -40,7 +40,7 @@ ****************************************************************************/ #include -#include +#include #include #include #include diff --git a/src/declarative/qml/qmlcompositetypemanager_p.h b/src/declarative/qml/qmlcompositetypemanager_p.h index 814e753..ffa4fda 100644 --- a/src/declarative/qml/qmlcompositetypemanager_p.h +++ b/src/declarative/qml/qmlcompositetypemanager_p.h @@ -43,12 +43,11 @@ #define QMLCOMPOSITETYPEMANAGER_P_H #include -#include +#include #include QT_BEGIN_NAMESPACE -class QmlXmlParser; class QmlEngine; class QmlCompiledComponent; class QmlComponentPrivate; @@ -100,7 +99,7 @@ private: friend class QmlCompositeTypeManager; friend class QmlCompiler; - QmlXmlParser data; + QmlScriptParser data; QList waiters; QmlComponent *component; QmlCompiledComponent *compiledComponent; diff --git a/src/declarative/qml/qmldom.cpp b/src/declarative/qml/qmldom.cpp index bd4d987..cbe5d5d 100644 --- a/src/declarative/qml/qmldom.cpp +++ b/src/declarative/qml/qmldom.cpp @@ -41,7 +41,6 @@ #include "qmldom.h" #include "qmldom_p.h" -#include "private/qmlxmlparser_p.h" #include "private/qmlcompiler_p.h" #include "qmlcompiledcomponent_p.h" #include @@ -152,7 +151,7 @@ bool QmlDomDocument::load(QmlEngine *engine, const QByteArray &data) { d->error = QString(); - QmlXmlParser parser; + QmlScriptParser parser; if(!parser.parse(data)) { d->error = parser.errorDescription(); return false; diff --git a/src/declarative/qml/qmlparser.cpp b/src/declarative/qml/qmlparser.cpp index f019a8b..1dd0d4e 100644 --- a/src/declarative/qml/qmlparser.cpp +++ b/src/declarative/qml/qmlparser.cpp @@ -55,7 +55,6 @@ #include #include "private/qmetaobjectbuilder_p.h" #include -#include "private/qmlxmlparser_p.h" #include #include diff --git a/src/declarative/qml/qmlparser_p.h b/src/declarative/qml/qmlparser_p.h index 9d3f3f6..e29cdbf 100644 --- a/src/declarative/qml/qmlparser_p.h +++ b/src/declarative/qml/qmlparser_p.h @@ -55,7 +55,6 @@ QT_BEGIN_HEADER QT_BEGIN_NAMESPACE QT_MODULE(Declarative) -class QmlXmlParser; /* XXX diff --git a/src/declarative/qml/qmlscriptparser.cpp b/src/declarative/qml/qmlscriptparser.cpp index 41d2534..3d406e7 100644 --- a/src/declarative/qml/qmlscriptparser.cpp +++ b/src/declarative/qml/qmlscriptparser.cpp @@ -1,5 +1,7 @@ #include "qmlscriptparser_p.h" +#include "qmlxmlparser_p.h" +#include "qmlparser_p.h" #include "parser/javascriptengine_p.h" #include "parser/javascriptparser_p.h" @@ -630,6 +632,21 @@ QmlScriptParser::~QmlScriptParser() bool QmlScriptParser::parse(const QByteArray &data, const QUrl &url) { + if (QmlComponentPrivate::isXml(data)) { + // parse using the XML parser. + QmlXmlParser xmlParser; + if (xmlParser.parse(data, url)) { + _nameSpacePaths = xmlParser.nameSpacePaths(); + root = xmlParser.takeTree(); + _typeNames = xmlParser.types(); + return true; + } + + _error = xmlParser.errorDescription(); + _errorLine = 0; // ### FIXME + return false; + } + const QString fileName = url.toString(); const QString code = QString::fromUtf8(data); // ### FIXME @@ -680,6 +697,19 @@ Object *QmlScriptParser::tree() const return root; } +void QmlScriptParser::clear() +{ + if(root) { + root->release(); + root = 0; + } + _nameSpacePaths.clear(); + _typeNames.clear(); + _error.clear(); + _scriptFile.clear(); + _errorLine = 0; +} + int QmlScriptParser::findOrCreateTypeId(const QString &name) { int index = _typeNames.indexOf(name); diff --git a/src/declarative/qml/qmlscriptparser_p.h b/src/declarative/qml/qmlscriptparser_p.h index 49128d7..0d89268 100644 --- a/src/declarative/qml/qmlscriptparser_p.h +++ b/src/declarative/qml/qmlscriptparser_p.h @@ -1,15 +1,19 @@ #ifndef QMLSCRIPTPARSER_P_H #define QMLSCRIPTPARSER_P_H +#include +#include #include -#include -#include QT_BEGIN_HEADER QT_BEGIN_NAMESPACE QT_MODULE(Declarative) +namespace QmlParser { + class Object; +} + class QByteArray; class QmlScriptParser @@ -27,6 +31,8 @@ public: QmlParser::Object *tree() const; + void clear(); + // ### private: int findOrCreateTypeId(const QString &name); void setTree(QmlParser::Object *tree); diff --git a/src/declarative/qml/qmlxmlparser.cpp b/src/declarative/qml/qmlxmlparser.cpp index f001bda..0af9115 100644 --- a/src/declarative/qml/qmlxmlparser.cpp +++ b/src/declarative/qml/qmlxmlparser.cpp @@ -365,6 +365,13 @@ QmlParser::Object *QmlXmlParser::tree() const return root; } +QmlParser::Object *QmlXmlParser::takeTree() +{ + QmlParser::Object *r = root; + root = 0; + return r; +} + QString QmlXmlParser::errorDescription() const { return _error; diff --git a/src/declarative/qml/qmlxmlparser_p.h b/src/declarative/qml/qmlxmlparser_p.h index 3680172..9b45e28 100644 --- a/src/declarative/qml/qmlxmlparser_p.h +++ b/src/declarative/qml/qmlxmlparser_p.h @@ -70,6 +70,7 @@ public: QStringList types() const; QmlParser::Object *tree() const; + QmlParser::Object *takeTree(); void clear(); @@ -80,9 +81,9 @@ private: QString _error; }; -#endif // QMLXMLPARSER_P_H - - QT_END_NAMESPACE QT_END_HEADER + +#endif // QMLXMLPARSER_P_H + -- cgit v0.12 From ee2af7b5de4d8cfc7db31a389b400ce5420f501b Mon Sep 17 00:00:00 2001 From: Roberto Raggi Date: Fri, 24 Apr 2009 11:45:53 +0200 Subject: Don't generate T_PUBLIC tokens. At this stage we don't know if we wil keep the syntax `public property|signal name' to define properties. --- src/declarative/qml/parser/javascriptlexer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/declarative/qml/parser/javascriptlexer.cpp b/src/declarative/qml/parser/javascriptlexer.cpp index e1c2960..1cfb3b5 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_PUBLIC; + return JavaScriptGrammar::T_RESERVED_WORD; 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')) -- cgit v0.12 From 732f54672e886ac535ed3af7b46b68d6cf44461c Mon Sep 17 00:00:00 2001 From: Roberto Raggi Date: Fri, 24 Apr 2009 11:53:32 +0200 Subject: Don't generate T_AUTOMATIC_SEMICOLON when recovering from a syntax error. --- src/declarative/qml/parser/javascript.g | 11 +++++++---- src/declarative/qml/parser/javascriptparser.cpp | 11 +++++++---- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/declarative/qml/parser/javascript.g b/src/declarative/qml/parser/javascript.g index 3686aac..b1bd49f 100644 --- a/src/declarative/qml/parser/javascript.g +++ b/src/declarative/qml/parser/javascript.g @@ -2564,7 +2564,7 @@ PropertyNameAndValueListOpt: PropertyNameAndValueList ; token_buffer[1].loc = yylloc = location(lexer); if (t_action(errorState, yytoken)) { - const QString msg = QString::fromUtf8("Removed token: `%1'").arg(QLatin1String(spell[token_buffer[0].token])); + const QString msg = QString::fromUtf8("Unexpected token `%1'").arg(QLatin1String(spell[token_buffer[0].token])); diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, token_buffer[0].loc.startLine, token_buffer[0].loc.startColumn, msg)); @@ -2594,7 +2594,7 @@ PropertyNameAndValueListOpt: PropertyNameAndValueList ; for (int *tk = tokens; *tk != EOF_SYMBOL; ++tk) { int a = t_action(errorState, *tk); if (a > 0 && t_action(a, yytoken)) { - const QString msg = QString::fromUtf8("Inserted token: `%1'").arg(QLatin1String(spell[*tk])); + const QString msg = QString::fromUtf8("Expected token `%1'").arg(QLatin1String(spell[*tk])); diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, token_buffer[0].loc.startLine, token_buffer[0].loc.startColumn, msg)); @@ -2612,9 +2612,12 @@ PropertyNameAndValueListOpt: PropertyNameAndValueList ; } for (int tk = 1; tk < TERMINAL_COUNT; ++tk) { + if (tk == T_AUTOMATIC_SEMICOLON) + continue; + int a = t_action(errorState, tk); if (a > 0 && t_action(a, yytoken)) { - const QString msg = QString::fromUtf8("Inserted token: `%1'").arg(QLatin1String(spell[tk])); + const QString msg = QString::fromUtf8("Expected token `%1'").arg(QLatin1String(spell[tk])); diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, token_buffer[0].loc.startLine, token_buffer[0].loc.startColumn, msg)); @@ -2627,7 +2630,7 @@ PropertyNameAndValueListOpt: PropertyNameAndValueList ; } } - const QString msg = QString::fromUtf8("Unexpected token"); + const QString msg = QString::fromUtf8("Syntax error"); diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, token_buffer[0].loc.startLine, token_buffer[0].loc.startColumn, msg)); } diff --git a/src/declarative/qml/parser/javascriptparser.cpp b/src/declarative/qml/parser/javascriptparser.cpp index ea65267..9959e58 100644 --- a/src/declarative/qml/parser/javascriptparser.cpp +++ b/src/declarative/qml/parser/javascriptparser.cpp @@ -1478,7 +1478,7 @@ case 293: { token_buffer[1].loc = yylloc = location(lexer); if (t_action(errorState, yytoken)) { - const QString msg = QString::fromUtf8("Removed token: `%1'").arg(QLatin1String(spell[token_buffer[0].token])); + const QString msg = QString::fromUtf8("Unexpected token `%1'").arg(QLatin1String(spell[token_buffer[0].token])); diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, token_buffer[0].loc.startLine, token_buffer[0].loc.startColumn, msg)); @@ -1508,7 +1508,7 @@ case 293: { for (int *tk = tokens; *tk != EOF_SYMBOL; ++tk) { int a = t_action(errorState, *tk); if (a > 0 && t_action(a, yytoken)) { - const QString msg = QString::fromUtf8("Inserted token: `%1'").arg(QLatin1String(spell[*tk])); + const QString msg = QString::fromUtf8("Expected token `%1'").arg(QLatin1String(spell[*tk])); diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, token_buffer[0].loc.startLine, token_buffer[0].loc.startColumn, msg)); @@ -1526,9 +1526,12 @@ case 293: { } for (int tk = 1; tk < TERMINAL_COUNT; ++tk) { + if (tk == T_AUTOMATIC_SEMICOLON) + continue; + int a = t_action(errorState, tk); if (a > 0 && t_action(a, yytoken)) { - const QString msg = QString::fromUtf8("Inserted token: `%1'").arg(QLatin1String(spell[tk])); + const QString msg = QString::fromUtf8("Expected token `%1'").arg(QLatin1String(spell[tk])); diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, token_buffer[0].loc.startLine, token_buffer[0].loc.startColumn, msg)); @@ -1541,7 +1544,7 @@ case 293: { } } - const QString msg = QString::fromUtf8("Unexpected token"); + const QString msg = QString::fromUtf8("Syntax error"); diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, token_buffer[0].loc.startLine, token_buffer[0].loc.startColumn, msg)); } -- cgit v0.12 From 3ee74e1f66eb8c00857aafcbd05b6130af11507a Mon Sep 17 00:00:00 2001 From: mae Date: Fri, 24 Apr 2009 17:50:28 +0200 Subject: removed most features --- tools/qmlconv/qmlconv.cpp | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/tools/qmlconv/qmlconv.cpp b/tools/qmlconv/qmlconv.cpp index 352b3d2..e9358df 100644 --- a/tools/qmlconv/qmlconv.cpp +++ b/tools/qmlconv/qmlconv.cpp @@ -84,25 +84,25 @@ public: clearPropertyChangeSet(); } - if (xml.name() == "properties") + if (false && xml.name() == "properties") startDeclareProperties(); - else if (xml.name() == "signals") + else if (false && xml.name() == "signals") startDeclareSignals(); - else if (xml.name() == "states") + else if (false && xml.name() == "states") loop(); // ignore - else if (xml.name() == "transitions") + else if (false && xml.name() == "transitions") loop(); // ignore else if (knownListProperties.contains(xml.name().toString())) startList(); - else if (xml.name() == "SetProperties") + else if (false && xml.name() == "SetProperties") startSetProperties(); - else if (xml.name() == "SetProperty") + else if (false && xml.name() == "SetProperty") startSetProperty(); - else if (xml.name() == "ParentChange") + else if (false && xml.name() == "ParentChange") startParentChange(); - else if (xml.name() == "Connection") + else if (false && xml.name() == "Connection") startConnection(); - else if (xml.name() == "Script") + else if (false && xml.name() == "Script") startScript(); else if (xml.name().at(0).isLower() && xml.attributes().isEmpty()) startObjectProperty(); @@ -203,7 +203,14 @@ public: setProperty(attribute.name().toString(), attribute.value().toString()); } - loop(); + if (name == "Script") { + QString text = xml.readElementText(); + if (!text.trimmed().isEmpty()) { + out << text << endl; + } + } else { + loop(); + } if (name == "State") clearPropertyChangeSet(); -- cgit v0.12 From 5d8ce4c43c3c2816cd5dca03ddd429f26b96d34d Mon Sep 17 00:00:00 2001 From: Roberto Raggi Date: Fri, 24 Apr 2009 18:17:27 +0200 Subject: No more sugar :-) --- src/declarative/qml/parser/javascript.g | 4 ++-- src/declarative/qml/parser/javascriptast_p.h | 4 ++-- src/declarative/qml/parser/javascriptparser.cpp | 4 ++-- src/declarative/qml/qmlscriptparser.cpp | 20 +++++++++++++++----- 4 files changed, 21 insertions(+), 11 deletions(-) diff --git a/src/declarative/qml/parser/javascript.g b/src/declarative/qml/parser/javascript.g index b1bd49f..0712828 100644 --- a/src/declarative/qml/parser/javascript.g +++ b/src/declarative/qml/parser/javascript.g @@ -645,14 +645,14 @@ case $rule_number: { UiObjectMember: FunctionDeclaration ; /. case $rule_number: { - sym(1).Node = makeAstNode(driver->nodePool(), sym(1).Statement); + sym(1).Node = makeAstNode(driver->nodePool(), sym(1).Node); } break; ./ UiObjectMember: VariableStatement ; /. case $rule_number: { - sym(1).Node = makeAstNode(driver->nodePool(), sym(1).Statement); + sym(1).Node = makeAstNode(driver->nodePool(), sym(1).Node); } break; ./ diff --git a/src/declarative/qml/parser/javascriptast_p.h b/src/declarative/qml/parser/javascriptast_p.h index 5176726..267a697 100644 --- a/src/declarative/qml/parser/javascriptast_p.h +++ b/src/declarative/qml/parser/javascriptast_p.h @@ -1954,14 +1954,14 @@ class UiSourceElement: public UiObjectMember public: JAVASCRIPT_DECLARE_AST_NODE(UiSourceElement) - UiSourceElement(Statement *sourceElement) + UiSourceElement(Node *sourceElement) : sourceElement(sourceElement) { kind = K; } virtual void accept0(Visitor *visitor); // attributes - Statement *sourceElement; + Node *sourceElement; }; class UiObjectBinding: public UiObjectMember diff --git a/src/declarative/qml/parser/javascriptparser.cpp b/src/declarative/qml/parser/javascriptparser.cpp index 9959e58..f9661d5 100644 --- a/src/declarative/qml/parser/javascriptparser.cpp +++ b/src/declarative/qml/parser/javascriptparser.cpp @@ -276,11 +276,11 @@ case 23: { } break; case 24: { - sym(1).Node = makeAstNode(driver->nodePool(), sym(1).Statement); + sym(1).Node = makeAstNode(driver->nodePool(), sym(1).Node); } break; case 25: { - sym(1).Node = makeAstNode(driver->nodePool(), sym(1).Statement); + sym(1).Node = makeAstNode(driver->nodePool(), sym(1).Node); } break; case 26: { diff --git a/src/declarative/qml/qmlscriptparser.cpp b/src/declarative/qml/qmlscriptparser.cpp index 3d406e7..099985e 100644 --- a/src/declarative/qml/qmlscriptparser.cpp +++ b/src/declarative/qml/qmlscriptparser.cpp @@ -240,7 +240,7 @@ Object *ProcessAST::defineObjectBinding(int line, const QString &objectType, AST::UiObjectInitializer *initializer) { - +#if 0 if (objectType == QLatin1String("Connection")) { AST::UiObjectMemberList *it = initializer->members; @@ -410,6 +410,7 @@ Object *ProcessAST::defineObjectBinding(int line, _stateStack.pop(); return obj; } +#endif return defineObjectBinding_helper(line, qualifiedId, objectType, initializer); } @@ -599,19 +600,28 @@ bool ProcessAST::visit(AST::UiArrayBinding *node) bool ProcessAST::visit(AST::UiSourceElement *node) { + QmlParser::Object *obj = currentObject(); + if (! (obj && obj->typeName == "Script")) { + // ### warning + return false; + } + QString source; QTextStream out(&source); PrettyPretty pp(out); pp(node->sourceElement); - Object *obj = defineObjectBinding(-1, // ### line - 0, - QLatin1String("Script")); + int line = 0; + if (AST::FunctionDeclaration *funDecl = AST::cast(node->sourceElement)) + line = funDecl->functionToken.startLine; + else if (AST::VariableStatement *varStmt = AST::cast(node->sourceElement)) + line = varStmt->declarationKindToken.startLine; Value *value = new Value; value->primitive = source; - value->line = -1; // ### fix me + value->line = line; + obj->getDefaultProperty()->addValue(value); return false; -- cgit v0.12 From 40983ad8b9209c41124c93b8a3c1517f93ae17d2 Mon Sep 17 00:00:00 2001 From: Roberto Raggi Date: Mon, 27 Apr 2009 11:57:27 +0200 Subject: Handle Connection objects. --- src/declarative/qml/qmlscriptparser.cpp | 159 ++------------------------------ tools/qmlconv/qmlconv.cpp | 81 +++++++++++++--- 2 files changed, 78 insertions(+), 162 deletions(-) diff --git a/src/declarative/qml/qmlscriptparser.cpp b/src/declarative/qml/qmlscriptparser.cpp index 099985e..dbf71dd 100644 --- a/src/declarative/qml/qmlscriptparser.cpp +++ b/src/declarative/qml/qmlscriptparser.cpp @@ -240,177 +240,38 @@ Object *ProcessAST::defineObjectBinding(int line, const QString &objectType, AST::UiObjectInitializer *initializer) { -#if 0 if (objectType == QLatin1String("Connection")) { - AST::UiObjectMemberList *it = initializer->members; + Object *obj = defineObjectBinding_helper(line, 0, QLatin1String("Connection")); - QString sender; - QString signal; - QString script; + _stateStack.pushObject(obj); + AST::UiObjectMemberList *it = initializer->members; for (; it; it = it->next) { AST::UiScriptBinding *scriptBinding = AST::cast(it->member); if (! scriptBinding) continue; - QString s; - QTextStream out(&s); - PrettyPretty pp(out); - QString propertyName = asString(scriptBinding->qualifiedId); - if (propertyName == QLatin1String("signal")) { - // ## TODO verify that this is a function call statement and nothing else. - if (AST::ExpressionStatement *stmt = AST::cast(scriptBinding->statement)) { - pp(stmt->expression); - int dot = s.lastIndexOf(QLatin1Char('.')); - if (dot >= 0) { - sender = s.left(dot); - signal = s.mid(dot+1); - } else { - // ### TODO generate error - } - } else { - // ### TODO generate error - } - - } else if (propertyName == QLatin1String("onSignal")) { + if (propertyName == QLatin1String("script")) { + QString script; if (AST::ExpressionStatement *stmt = AST::cast(scriptBinding->statement)) { - script = getPrimitive("onSignal", stmt->expression); + script = getPrimitive("script", stmt->expression); } else { + QTextStream out(&script); + PrettyPretty pp(out); pp(scriptBinding->statement); - script = s; } + defineProperty(QLatin1String("script"), line, script); } else { - //### TODO generate error + accept(it->member); } } - Object *obj = defineObjectBinding_helper(line, - 0, - QLatin1String("Connection")); - _stateStack.pushObject(obj); - if (!sender.isEmpty()) - defineProperty(QLatin1String("sender"), line, QLatin1Char('{') + sender + QLatin1Char('}')); - if (!script.isEmpty()) - defineProperty(QLatin1String("script"), line, script); - if (!signal.isEmpty()) - defineProperty(QLatin1String("signal"), line, signal); _stateStack.pop(); // object return obj; - - } else if (objectType == QLatin1String("PropertyChangeSet")) { - - AST::UiObjectMemberList *it = initializer->members; - for (; it; it = it->next) { - AST::UiScriptBinding *scriptBinding = AST::cast(it->member); - if (!scriptBinding) - continue; // ### TODO generate error - - - QString target; - QString property; - QString value; - - int propertyCount = 0; - AST::UiQualifiedId *propertyName = scriptBinding->qualifiedId; - for (; propertyName; propertyName = propertyName->next){ - if (propertyName->next) { - if (!target.isEmpty()) - target += QLatin1Char('.'); - target += propertyName->name->asString(); - } else { - property = propertyName->name->asString(); - } - ++propertyCount; - } - - if (AST::ExpressionStatement *stmt = AST::cast(scriptBinding->statement)) { - value = getPrimitive(property.toLatin1(), stmt->expression); - } else { - // #### TODO generate error - } - - Object *obj = defineObjectBinding_helper(line, - 0, - QLatin1String("SetProperty")); - - _stateStack.pushObject(obj); - if (!target.isEmpty()) - defineProperty(QLatin1String("target"), scriptBinding->colonToken.startLine, QLatin1Char('{') + target + QLatin1Char('}')); - if (!property.isEmpty()) - defineProperty(QLatin1String("property"), scriptBinding->colonToken.startLine, property); - if (!value.isEmpty()) - defineProperty(QLatin1String("value"), scriptBinding->colonToken.startLine, value); - _stateStack.pop(); // object - - } - - return 0; - } else if (objectType == QLatin1String("ParentChangeSet")) { - - AST::UiObjectMemberList *it = initializer->members; - for (; it; it = it->next) { - AST::UiScriptBinding *scriptBinding = AST::cast(it->member); - if (!scriptBinding) - continue; // ### TODO generate error - - - QString target; - QString property; - QString parent; - - int propertyCount = 0; - AST::UiQualifiedId *propertyName = scriptBinding->qualifiedId; - for (; propertyName; propertyName = propertyName->next){ - if (propertyName->next) { - if (!target.isEmpty()) - target += QLatin1Char('.'); - target += propertyName->name->asString(); - } else { - property = propertyName->name->asString(); - } - ++propertyCount; - } - - if (property != QLatin1String("parent")) { - // ### TODO generate error - } else { - - if (AST::ExpressionStatement *stmt = AST::cast(scriptBinding->statement)) { - parent = getPrimitive(property.toLatin1(), stmt->expression); - } else { - // #### TODO generate error - } - - Object *obj = defineObjectBinding_helper(line, - 0, - QLatin1String("ParentChange")); - - _stateStack.pushObject(obj); - if (!target.isEmpty()) - defineProperty(QLatin1String("target"), scriptBinding->colonToken.startLine, QLatin1Char('{') + target + QLatin1Char('}')); - if (!parent.isEmpty()) - defineProperty(QLatin1String("parent"), scriptBinding->colonToken.startLine, parent); - _stateStack.pop(); // object - } - - } - - return 0; - } else if(!currentProperty() && objectType == QLatin1String("State")) { - _stateStack.pushProperty(QLatin1String("states"), line); - Object *obj = defineObjectBinding_helper(line, 0, objectType, initializer); - _stateStack.pop(); - return obj; - } else if (!currentProperty() && objectType == QLatin1String("Transition")) { - _stateStack.pushProperty(QLatin1String("transitions"), line); - Object *obj = defineObjectBinding_helper(line, 0, objectType, initializer); - _stateStack.pop(); - return obj; } -#endif return defineObjectBinding_helper(line, qualifiedId, objectType, initializer); } diff --git a/tools/qmlconv/qmlconv.cpp b/tools/qmlconv/qmlconv.cpp index e9358df..3ba40a4 100644 --- a/tools/qmlconv/qmlconv.cpp +++ b/tools/qmlconv/qmlconv.cpp @@ -6,7 +6,7 @@ #include - +static bool optionInPlace = false; class Reader { @@ -34,8 +34,16 @@ public: loop(); out.flush(); - QTextStream print(stdout); - print << outString; + + if (! optionInPlace) { + QTextStream print(stdout); + print << outString; + } + } + + QString output() const + { + return outString; } void comment() @@ -100,7 +108,7 @@ public: startSetProperty(); else if (false && xml.name() == "ParentChange") startParentChange(); - else if (false && xml.name() == "Connection") + else if (true && xml.name() == "Connection") startConnection(); else if (false && xml.name() == "Script") startScript(); @@ -350,10 +358,32 @@ public: possiblyRemoveBraces(&sender); out << depthString() << "Connection {" << endl; ++depth; - out << depthString() << "signal: " << sender + "." + xml.attributes().value("signal").toString() << endl; - out << depthString() << "onSignal: { " << xml.attributes().value("script").toString() << " }" << endl; - --depth; - out << depthString() << "}" << endl; + if (! sender.isEmpty()) + out << depthString() << "sender: " << sender << endl; + if (xml.attributes().hasAttribute("signal")) + out << depthString() << "signal: \"" << xml.attributes().value("signal").toString() << '"' << endl; + if (xml.attributes().hasAttribute("script")) { + out << depthString() << "script: { " << xml.attributes().value("script").toString() << " }" << endl; + --depth; + out << depthString() << "}" << endl; + } else { + QString text; + while (!xml.atEnd()) { + xml.readNext(); + if (xml.tokenType() == QXmlStreamReader::EndElement) + break; + else if (xml.tokenType() == QXmlStreamReader::Characters) + text.append(xml.text()); + } + + out << depthString() << "script: {" << endl; + foreach (QString line, text.split(QLatin1Char('\n'))) { + out << depthString() << line << endl; + } + out << depthString() << "}" << endl; + --depth; + out << depthString() << "}" << endl; + } emptyLoop(); } @@ -409,17 +439,42 @@ int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); - if (argc != 2) { - qWarning() << "Usage: qmlconf filename"; + QStringList args = a.arguments(); + args.removeFirst(); + +again: + if (args.isEmpty()) { + qWarning() << "Usage: qmlconf [-i] filename"; exit(1); } - QFile file(argv[1]); - if (file.open(QIODevice::ReadOnly)) { - Reader r(&file); + if (args.first() == QLatin1String("-i")) { + optionInPlace = true; + args.removeFirst(); + goto again; } + const QString fileName = args.first(); + + QFile file(fileName); + if (! file.open(QIODevice::ReadOnly)) { + qWarning() << "qmlconv: no input file"; + exit(1); + } + Reader r(&file); file.close(); + + if (optionInPlace) { + if (! file.open(QFile::WriteOnly)) { + qWarning() << "qmlconv: cannot open file" << qPrintable(fileName); + exit(1); + } + + QTextStream out(&file); + out << r.output(); + file.close(); + } + return 0; } -- cgit v0.12 From e793ab29e651a7b07354224a82343d66c265f361 Mon Sep 17 00:00:00 2001 From: Roberto Raggi Date: Mon, 27 Apr 2009 12:32:25 +0200 Subject: Converted the examples. --- examples/declarative/animation/animation.qml | 79 ++++--- examples/declarative/behaviours/MyRect.qml | 15 +- examples/declarative/behaviours/test.qml | 140 +++++++++--- examples/declarative/contacts/contacts.qml | 165 ++++++++++---- examples/declarative/dial/DialLibrary/Dial.qml | 54 ++++- examples/declarative/dial/dial.qml | 52 +++-- examples/declarative/follow/follow.qml | 113 ++++++--- examples/declarative/listview/highlight.qml | 133 ++++++----- examples/declarative/listview/recipes.qml | 289 +++++++++++++++++------- examples/declarative/minehunt/Description.qml | 48 +++- examples/declarative/minehunt/Explosion.qml | 27 ++- examples/declarative/minehunt/minehunt.qml | 257 +++++++++++++++------ examples/declarative/scrollbar/ScrollBar.qml | 62 ++--- examples/declarative/scrollbar/display.qml | 91 +++++--- examples/declarative/slideswitch/Switch.qml | 104 ++++++--- examples/declarative/slideswitch/display.qml | 11 +- examples/declarative/states/states.qml | 119 ++++++---- examples/declarative/states/transitions.qml | 179 +++++++++------ examples/declarative/tutorials/t1/tutorial1.qml | 17 +- examples/declarative/tutorials/t2/Cell.qml | 23 +- examples/declarative/tutorials/t2/tutorial2.qml | 52 ++++- examples/declarative/tutorials/t3/Cell.qml | 23 +- examples/declarative/tutorials/t3/tutorial3.qml | 105 ++++++--- 23 files changed, 1503 insertions(+), 655 deletions(-) diff --git a/examples/declarative/animation/animation.qml b/examples/declarative/animation/animation.qml index 1d60ac0..5cb471e 100644 --- a/examples/declarative/animation/animation.qml +++ b/examples/declarative/animation/animation.qml @@ -1,28 +1,51 @@ - - - - - - - - - - - - - - - - - - - - - - - - - +Rect { + width: 400 + height: 200 + color: "white" + Rect { + width: 40 + height: 40 + y: 80 + color: "#FF0000" + radius: 10 + // Animate the x property. Setting repeat to true makes the + // animation repeat indefinitely, otherwise it would only run once. + x: SequentialAnimation { + running: true + repeat: true + // Move from 0 to 360 in 500ms, using the easeInOutQuad easing function + NumericAnimation { + from: 0 + to: 360 + easing: "easeInOutQuad" + duration: 500 + } + // Then pause for 200ms + PauseAnimation { + duration: 200 + } + // Then move back to 0 in 2 seconds, using the easeInOutElastic easing function + NumericAnimation { + from: 360 + to: 0 + easing: "easeInOutElastic" + duration: 2000 + } + } + // Alternate color between red and green + color: SequentialAnimation { + running: true + repeat: true + ColorAnimation { + from: "#FF0000" + to: "#00FF00" + duration: 5000 + } + ColorAnimation { + from: "#00FF00" + to: "#FF0000" + duration: 5000 + } + } + } +} diff --git a/examples/declarative/behaviours/MyRect.qml b/examples/declarative/behaviours/MyRect.qml index e40bd1b..dc9a094 100644 --- a/examples/declarative/behaviours/MyRect.qml +++ b/examples/declarative/behaviours/MyRect.qml @@ -1,4 +1,11 @@ - - - - +Rect { + radius: 15 + pen.color: "black" + width: 100 + height: 100 + id: Page + MouseRegion { + anchors.fill: parent + onClicked: { bluerect.parent = Page; bluerect.x=0 } + } +} diff --git a/examples/declarative/behaviours/test.qml b/examples/declarative/behaviours/test.qml index a544028..bb7109e 100644 --- a/examples/declarative/behaviours/test.qml +++ b/examples/declarative/behaviours/test.qml @@ -1,37 +1,103 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Rect { + color: "lightsteelblue" + width: 800 + height: 600 + id: Page + MouseRegion { + anchors.fill: parent + onClicked: { bluerect.parent = Page; bluerect.x = mouseX; } + } + MyRect { + color: "green" + x: 200 + y: 200 + } + MyRect { + color: "red" + x: 400 + y: 200 + } + MyRect { + color: "yellow" + x: 400 + y: 400 + } + MyRect { + color: "orange" + x: 400 + y: 500 + } + MyRect { + color: "pink" + x: 400 + y: 0 + } + MyRect { + color: "lightsteelblue" + x: 100 + y: 500 + } + MyRect { + color: "black" + x: 0 + y: 200 + } + MyRect { + color: "white" + x: 400 + y: 0 + } + Rect { + color: "blue" + x: 0 + y: 0 + width: 100 + height: 100 + id: bluerect + x: Behaviour { + SequentialAnimation { + NumericAnimation { + target: bluerect + properties: "y" + from: 0 + to: 10 + easing: "easeOutBounce(amplitude:30)" + duration: 250 + } + NumericAnimation { + target: bluerect + properties: "y" + from: 10 + to: 0 + easing: "easeOutBounce(amplitude:30)" + duration: 250 + } + } + NumericAnimation { + target: bluerect + property: "x" + duration: 500 + } + } + parent: Behaviour { + SequentialAnimation { + NumericAnimation { + target: bluerect + properties: "opacity" + to: 0 + duration: 150 + } + SetPropertyAction { + target: bluerect + property: "parent" + } + NumericAnimation { + target: bluerect + properties: "opacity" + to: 1 + duration: 150 + } + } + } + } +} diff --git a/examples/declarative/contacts/contacts.qml b/examples/declarative/contacts/contacts.qml index d4647f9..fa50010 100644 --- a/examples/declarative/contacts/contacts.qml +++ b/examples/declarative/contacts/contacts.qml @@ -1,44 +1,121 @@ - - - - - - - - - - - - - - - - {Math.max(email_layout.height + name.height + 25, portraitPic.height+20)} - - - - - - - - - - - - - - - - - - - - - - - - - - +Rect { + id: page + width: 320 + height: 480 + color: "white" + resources: [ + Component { + id: contactDelegate + Rect { + id: wrapper + x: 20 + width: List.width-40 + color: "#FEFFEE" + pen.color: "#FFBE4F" + radius: 5 + filter: Shadow { + xOffset: 5 + yOffset: 5 + } + MouseRegion { + id: pageMouse + anchors.fill: parent + onClicked: { if (wrapper.state == 'Details') { wrapper.state = '';} else {wrapper.state = 'Details';} } + } + Image { + id: portraitPic + src: portrait + x: 10 + y: 10 + } + Text { + id: name + text: firstName + ' ' + lastName + anchors.left: portraitPic.right + anchors.leftMargin: 10 + anchors.top: portraitPic.top + anchors.right: wrapper.right + anchors.rightMargin: 10 + font.family: "Comic Sans MS" + font.bold: true + font.size: 11 + } + VerticalLayout { + id: email_layout + anchors.left: name.left + anchors.top: name.bottom + anchors.topMargin: 10 + Repeater { + id: email_list + dataSource: emails + Component { + Text { + text: modelData + height: 18 + font.italic: true + color: "midnightblue" + } + } + } + } + height: Math.max(email_layout.height + name.height + 25, portraitPic.height+20) + states: [ + State { + name: "Details" + SetProperty { + target: wrapper + property: "color" + value: "white" + } + SetProperty { + target: wrapper + property: "x" + value: 0 + } + SetProperty { + target: wrapper + property: "height" + value: List.height + } + SetProperty { + target: wrapper + property: "width" + value: List.width + } + SetProperty { + target: wrapper.ListView.view + property: "yPosition" + value: wrapper.y + } + SetProperty { + target: wrapper.ListView.view + property: "locked" + value: 1 + } + } + ] + transitions: [ + Transition { + ParallelAnimation { + ColorAnimation { + duration: 500 + } + NumericAnimation { + duration: 150 + properties: "x,yPosition,height,width" + } + } + } + ] + } + } + ] + ListView { + id: List + model: contactModel + width: 320 + height: 480 + clip: true + delegate: contactDelegate + } +} diff --git a/examples/declarative/dial/DialLibrary/Dial.qml b/examples/declarative/dial/DialLibrary/Dial.qml index e2a11b1..8336a70 100644 --- a/examples/declarative/dial/DialLibrary/Dial.qml +++ b/examples/declarative/dial/DialLibrary/Dial.qml @@ -1,12 +1,42 @@ - - - - - - - - - - - - +Item { + width: 210 + height: 210 + properties: Property { + name: "value" + type: "real" + value: 0 + } + Image { + id: Background + src: "background.svg" + } + Item { + x: 104 + y: 102 + rotation: Needle.rotation + Image { + src: "needle_shadow.svg" + x: -104 + y: -102 + } + } + Item { + id: Needle + x: 102 + y: 98 + rotation: -130 + rotation: Follow { + spring: 1.4 + damping: .15 + source: Math.min(Math.max(-130, value*2.2 - 130), 133) + } + Image { + src: "needle.svg" + x: -102 + y: -98 + } + } + Image { + src: "overlay.svg" + } +} diff --git a/examples/declarative/dial/dial.qml b/examples/declarative/dial/dial.qml index bda9b41..fa11d79 100644 --- a/examples/declarative/dial/dial.qml +++ b/examples/declarative/dial/dial.qml @@ -1,14 +1,38 @@ - - - - - - - - - - +import "DialLibrary" +Rect { + color: "white" + width: 210 + height: 240 + // Dial with a slider to adjust it + Dial { + id: Dial + value: Slider.x-2 + } + Rect { + anchors.top: Dial.bottom + x: 20 + width: 160 + height: 16 + color: "steelblue" + gradientColor: "lightsteelblue" + radius: 8 + opacity: 0.7 + Rect { + id: Slider + x: 2 + y: 2 + width: 30 + height: 12 + color: "lightgray" + gradientColor: "gray" + radius: 6 + MouseRegion { + anchors.fill: parent + drag.target: parent + drag.axis: "x" + drag.xmin: 2 + drag.xmax: 128 + } + } + } +} diff --git a/examples/declarative/follow/follow.qml b/examples/declarative/follow/follow.qml index 0f3e772..598d953 100644 --- a/examples/declarative/follow/follow.qml +++ b/examples/declarative/follow/follow.qml @@ -1,35 +1,78 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Rect { + width: 320 + height: 240 + color: "#ffffff" + Rect { + id: Rect + y: 200 + color: "#00ff00" + width: 60 + height: 20 + y: SequentialAnimation { + running: true + repeat: true + NumericAnimation { + to: 200 + easing: "easeOutBounce(amplitude:180)" + duration: 2000 + } + PauseAnimation { + duration: 1000 + } + } + } + // Velocity + Rect { + x: Rect.width + color: "#ff0000" + width: Rect.width + height: 20 + y: Follow { + source: Rect.y + velocity: 200 + } + } + Text { + x: Rect.width + y: 220 + text: "Velocity" + } + // Spring + Rect { + x: Rect.width * 2 + color: "#ff0000" + width: Rect.width + height: 20 + y: Follow { + source: Rect.y + spring: 1.2 + damping: 0.1 + } + } + Text { + x: Rect.width * 2 + y: 220 + text: "Spring" + } + // Follow mouse + MouseRegion { + id: Mouse + anchors.fill: parent + Rect { + width: 20 + height: 20 + radius: 10 + color: "#0000ff" + x: Follow { + source: Mouse.mouseX-10 + spring: 1.0 + damping: 0.05 + } + y: Follow { + source: Mouse.mouseY-10 + spring: 1.0 + damping: 0.05 + } + } + } +} diff --git a/examples/declarative/listview/highlight.qml b/examples/declarative/listview/highlight.qml index 5ce7acb..cbadb72 100644 --- a/examples/declarative/listview/highlight.qml +++ b/examples/declarative/listview/highlight.qml @@ -1,56 +1,77 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Rect { + width: 400 + height: 300 + color: "white" + // MyPets model is defined in dummydata/MyPetsModel.qml + // The viewer automatically loads files in dummydata/* to assist + // development without a real data source. + // This one contains my pets. + // Define a delegate component. A component will be + // instantiated for each visible item in the list. + Component { + id: PetDelegate + Item { + id: Wrapper + width: 200 + height: 50 + VerticalLayout { + Text { + text: 'Name: ' + name + } + Text { + text: 'Type: ' + type + } + Text { + text: 'Age: ' + age + } + } + // Use the ListView.isCurrentItem attached property to + // indent the item if it is the current item. + states: [ + State { + name: "Current" + when: Wrapper.ListView.isCurrentItem + SetProperty { + target: Wrapper + property: "x" + value: 10 + } + } + ] + transitions: [ + Transition { + NumericAnimation { + properties: "x" + duration: 200 + } + } + ] + } + } + // Specify a highlight with custom movement. Note that autoHighlight + // is set to false in the ListView so that we can control how the + // highlight moves to the current item. + Component { + id: PetHighlight + Rect { + width: 200 + height: 50 + color: "#FFFF88" + y: Follow { + source: List1.current.y + spring: 3 + damping: 0.1 + } + } + } + ListView { + id: List1 + width: 200 + height: parent.height + model: MyPetsModel + delegate: PetDelegate + highlight: PetHighlight + autoHighlight: false + focus: true + } +} diff --git a/examples/declarative/listview/recipes.qml b/examples/declarative/listview/recipes.qml index 6826b78..0f6324f 100644 --- a/examples/declarative/listview/recipes.qml +++ b/examples/declarative/listview/recipes.qml @@ -1,85 +1,204 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 68 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +import "content" +// This example illustrates expanding a list item to show a more detailed view +Rect { + id: page + width: 400 + height: 240 + color: "black" + resources: [ + // Delegate for the recipes. This delegate has two modes: + // 1. the list mode (default), which just shows the picture and title of the recipe. + // 2. the details mode, which also shows the ingredients and method. + Component { + id: recipeDelegate + Item { + id: wrapper + width: List.width + // Create a property to contain the visibility of the details. + // We can bind multiple element's opacity to this one property, + // rather than having a "SetProperty" line for each element we + // want to fade. + properties: Property { + name: "detailsOpacity" + value: 0 + type: "real" + } + // A simple rounded rectangle for the background + Rect { + id: background + x: 1 + y: 2 + width: parent.width-2 + height: parent.height-4 + color: "#FEFFEE" + pen.color: "#FFBE4F" + radius: 5 + } + // This mouse region covers the entire delegate. + // When clicked it changes mode to 'Details'. If we are already + // in Details mode, then no change will happen. + MouseRegion { + id: pageMouse + anchors.fill: parent + onClicked: { wrapper.state = 'Details' } + } + // Layout the page. Picture, title and ingredients at the top, method at the + // bottom. Note that elements that should not be visible in the list + // mode have their opacity set to wrapper.detailsOpacity. + HorizontalLayout { + id: topLayout + x: 10 + y: 10 + spacing: 10 + height: recipePic.height + width: parent.width + Image { + id: recipePic + src: picture + width: 48 + height: 48 + } + VerticalLayout { + height: recipePic.height + spacing: 5 + width: background.width-recipePic.width-20 + Text { + id: name + text: title + font.bold: true + font.size: 16 + } + Text { + opacity: wrapper.detailsOpacity + text: "Ingredients" + font.size: 12 + font.bold: true + } + Text { + opacity: wrapper.detailsOpacity + text: ingredients + wrap: true + width: parent.width + } + } + } + Item { + id: details + x: 10 + width: parent.width-20 + anchors.top: topLayout.bottom + anchors.topMargin: 10 + anchors.bottom: parent.bottom + anchors.bottomMargin: 10 + opacity: wrapper.detailsOpacity + Text { + id: methodTitle + text: "Method" + font.size: 12 + font.bold: true + anchors.top: parent.top + } + Flickable { + id: flick + anchors.top: methodTitle.bottom + anchors.bottom: parent.bottom + width: parent.width + viewportHeight: methodText.height + clip: true + Text { + id: methodText + text: method + wrap: true + width: details.width + } + } + Image { + anchors.right: flick.right + anchors.top: flick.top + src: "content/pics/moreUp.png" + opacity: flick.atYBeginning ? 0 : 1 + } + Image { + anchors.right: flick.right + anchors.bottom: flick.bottom + src: "content/pics/moreDown.png" + opacity: flick.atYEnd ? 0 : 1 + } + } + // A button to close the detailed view, i.e. set the state back to default (''). + MediaButton { + anchors.right: background.right + anchors.rightMargin: 5 + y: 10 + opacity: wrapper.detailsOpacity + text: "Close" + onClicked: { wrapper.state = '' } + } + // Make the default height equal the hight of the picture, plus margin. + height: 68 + states: [ + State { + name: "Details" + SetProperty { + target: background + property: "color" + value: "white" + } + // Make the picture bigger + SetProperties { + target: recipePic + width: 128 + height: 128 + } + // Make details visible + SetProperties { + target: wrapper + detailsOpacity: 1 + x: 0 + } + // Make the detailed view fill the entire list area + SetProperty { + target: wrapper + property: "height" + value: List.height + } + // Move the list so that this item is at the top. + SetProperty { + target: wrapper.ListView.view + property: "yPosition" + value: wrapper.y + } + // Disallow flicking while we're in detailed view + SetProperty { + target: wrapper.ListView.view + property: "locked" + value: 1 + } + } + ] + transitions: [ + Transition { + // Make the state changes smooth + ParallelAnimation { + ColorAnimation { + duration: 500 + } + NumericAnimation { + duration: 300 + properties: "detailsOpacity,x,yPosition,height,width" + } + } + } + ] + } + } + ] + // The actual list + ListView { + id: List + model: Recipies + anchors.fill: parent + clip: true + delegate: recipeDelegate + } +} diff --git a/examples/declarative/minehunt/Description.qml b/examples/declarative/minehunt/Description.qml index 5bda5f8..f59c8f9 100644 --- a/examples/declarative/minehunt/Description.qml +++ b/examples/declarative/minehunt/Description.qml @@ -1,10 +1,38 @@ - - - - - - - - - - +Item { + id: Page + height: MyText.height + 20 + properties: Property { + name: "text" + } + MouseRegion { + anchors.fill: parent + drag.target: Page + drag.axis: "xy" + drag.xmin: 0 + drag.xmax: 1000 + drag.ymin: 0 + drag.ymax: 1000 + } + Rect { + radius: 10 + anchors.fill: parent + color: "lightsteelblue" + } + Item { + x: 10 + y: 10 + width: parent.width - 20 + height: parent.height - 20 + Text { + id: MyText + text: Page.text + width: parent.width + clip: true + wrap: true + } + } + filter: Shadow { + xOffset: 5 + yOffset: 5 + } +} diff --git a/examples/declarative/minehunt/Explosion.qml b/examples/declarative/minehunt/Explosion.qml index aec685b..1e4f03d 100644 --- a/examples/declarative/minehunt/Explosion.qml +++ b/examples/declarative/minehunt/Explosion.qml @@ -1,6 +1,21 @@ - - - - - - +Item { + properties: Property { + name: "explode" + type: "Bool" + value: false + } + Particles { + width: 38 + height: 21 + lifeSpan: 3600000 + lifeSpanDeviation: 0 + src: "pics/star.png" + count: 200 + angle: 270 + angleDeviation: 360 + velocity: 100 + velocityDeviation: 20 + z: 100 + emitting: explode + } +} diff --git a/examples/declarative/minehunt/minehunt.qml b/examples/declarative/minehunt/minehunt.qml index 9db0e84..9454f2f 100644 --- a/examples/declarative/minehunt/minehunt.qml +++ b/examples/declarative/minehunt/minehunt.qml @@ -1,73 +1,186 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - In play: - - - - +Item { + id: field + width: 370 + height: 480 + properties: Property { + name: "clickx" + type: "Int" + value: 0 + } + properties: Property { + name: "clicky" + type: "Int" + value: 0 + } + resources: [ + Component { + id: tile + Flipable { + id: flipable + width: 40 + height: 40 + transform: [ + Axis { + id: axis + xStart: 20 + xEnd: 20 + yStart: 20 + yEnd: 0 + } + ] + front: Image { + src: "pics/front.png" + width: 40 + height: 40 + Image { + anchors.horizontalCenter: parent.horizontalCenter + anchors.verticalCenter: parent.verticalCenter + src: "pics/flag.png" + opacity: modelData.hasFlag + opacity: Behaviour { + NumericAnimation { + property: "opacity" + duration: 250 + } + } + } + } + back: Image { + src: "pics/back.png" + width: 40 + height: 40 + Text { + anchors.horizontalCenter: parent.horizontalCenter + anchors.verticalCenter: parent.verticalCenter + text: modelData.hint + color: "white" + font.bold: true + opacity: modelData.hasMine == false && modelData.hint > 0 + } + Image { + anchors.horizontalCenter: parent.horizontalCenter + anchors.verticalCenter: parent.verticalCenter + src: "pics/bomb.png" + opacity: modelData.hasMine + } + Explosion { + anchors.horizontalCenter: parent.horizontalCenter + anchors.verticalCenter: parent.verticalCenter + explode: modelData.hasMine==true && modelData.flipped==true + } + } + states: [ + State { + name: "back" + when: modelData.flipped == true + SetProperty { + target: axis + property: "rotation" + value: 180 + } + } + ] + transitions: [ + Transition { + SequentialAnimation { + PauseAnimation { + duration: { + var ret = Math.abs(flipable.parent.x-field.clickx) + + Math.abs(flipable.parent.y-field.clicky); - - - - - + ret > 0 + ? (modelData.hasMine==true && modelData.flipped==true) ? ret * 3 : ret + : 0 + } + } + NumericAnimation { + easing: "easeInOutQuad" + properties: "rotation" + } + } + } + ] + MouseRegion { + anchors.fill: parent + onClicked: { + field.clickx = flipable.parent.x; + field.clicky = flipable.parent.y; + row = Math.floor(index/9); + col = index - (Math.floor(index/9) * 9); + if (mouseButton==undefined || mouseButton=='Right') { + flag(row, col); + } else{ + flip(row, col); + } + } + } + } + } + ] + Image { + src: "pics/No-Ones-Laughing-3.jpg" + tile: true + } + Description { + text: "Use the 'minehunt' executable to run this demo!" + width: 300 + opacity: tiles?0:1 + anchors.horizontalCenter: parent.horizontalCenter + anchors.verticalCenter: parent.verticalCenter + } + Repeater { + dataSource: tiles + x: 1 + y: 1 + Component { + ComponentInstance { + component: tile + x: (index - (Math.floor(index/9) * 9)) * 41 + y: Math.floor(index/9) * 41 + } + } + } + Item { + id: gamedata + width: 370 + height: 100 + y: 380 + Text { + color: "white" + font.size: 18 + x: 20 + y: 20 + } + Image { + x: 100 + y: 20 + src: "pics/bomb-color.png" + } + Text { + x: 100 + y: 60 + color: "white" + text: numMines + } + Image { + x: 140 + y: 20 + src: "pics/flag-color.png" + } + Text { + x: 140 + y: 60 + color: "white" + text: numFlags + } + Image { + x: 240 + y: 0 + src: if(isPlaying==true){'pics/smile.png'}else{if(hasWon==true){'pics/glee.png'}else{'pics/frown.png'}} + MouseRegion { + anchors.fill: parent + onClicked: { reset() } + } + } + } +} diff --git a/examples/declarative/scrollbar/ScrollBar.qml b/examples/declarative/scrollbar/ScrollBar.qml index 470a170..e3ca0c2 100644 --- a/examples/declarative/scrollbar/ScrollBar.qml +++ b/examples/declarative/scrollbar/ScrollBar.qml @@ -1,26 +1,36 @@ - - - - - - - - - - - - - - +Item { + id: ScrollBar + // The properties that define the scrollbar's state. + // position and pageSize are in the range 0.0 - 1.0. They are relative to the + // height of the page, i.e. a pageSize of 0.5 means that you can see 50% + // of the height of the view. + // orientation can be either 'Vertical' or 'Horizontal' + properties: Property { + name: "position" + } + properties: Property { + name: "pageSize" + } + properties: Property { + name: "orientation" + value: "Vertical" + } + // A light, semi-transparent background + Rect { + id: Background + radius: orientation == 'Vertical' ? (width/2) : (height/2) + color: "white" + opacity: 0.3 + anchors.fill: parent + } + // Size the bar to the required size, depending upon the orientation. + Rect { + opacity: 0.6 + color: "black" + radius: orientation == 'Vertical' ? (width/2) : (height/2) + x: orientation == 'Vertical' ? 2 : (ScrollBar.position * (ScrollBar.width-4) + 2) + y: orientation == 'Vertical' ? (ScrollBar.position * (ScrollBar.height-4) + 2) : 2 + width: orientation == 'Vertical' ? (parent.width-4) : (ScrollBar.pageSize * (ScrollBar.width-4)) + height: orientation == 'Vertical' ? (ScrollBar.pageSize * (ScrollBar.height-4)) : (parent.height-4) + } +} diff --git a/examples/declarative/scrollbar/display.qml b/examples/declarative/scrollbar/display.qml index 697b68a..4412d7f 100644 --- a/examples/declarative/scrollbar/display.qml +++ b/examples/declarative/scrollbar/display.qml @@ -1,28 +1,63 @@ - - - - - - {Picture.width} - {Picture.height} - - - - - - - - - - - - - - - - - - - - - +Rect { + width: 640 + height: 480 + // Create a flickable to view a large image. + Flickable { + id: View + anchors.fill: parent + Image { + id: Picture + src: "pics/niagara_falls.jpg" + } + viewportWidth: Picture.width + viewportHeight: Picture.height + // Only show the scrollbars when the view is moving. + states: [ + State { + name: "ShowBars" + when: View.moving + SetProperty { + target: SBV + property: "opacity" + value: 1 + } + SetProperty { + target: SBH + property: "opacity" + value: 1 + } + } + ] + transitions: [ + Transition { + fromState: "*" + toState: "*" + NumericAnimation { + properties: "opacity" + duration: 400 + } + } + ] + } + // Attach scrollbars to the right and bottom edges of the view. + ScrollBar { + id: SBV + opacity: 0 + orientation: "Vertical" + position: View.pageYPosition + pageSize: View.pageHeight + width: 12 + height: View.height-12 + anchors.right: View.right + } + ScrollBar { + id: SBH + opacity: 0 + orientation: "Horizontal" + position: View.pageXPosition + pageSize: View.pageWidth + height: 12 + width: View.width-12 + anchors.bottom: View.bottom + } +} diff --git a/examples/declarative/slideswitch/Switch.qml b/examples/declarative/slideswitch/Switch.qml index 90e6e64..f62e4b6 100644 --- a/examples/declarative/slideswitch/Switch.qml +++ b/examples/declarative/slideswitch/Switch.qml @@ -1,6 +1,12 @@ - - - - - - - - - - - - - - - - - - - - - - - - - + + } + Image { + id: Groove + src: "background.svg" + } + MouseRegion { + anchors.fill: Groove + onClicked: { toggle() } + } + Image { + id: Knob + src: "knob.svg" + x: 1 + y: 2 + } + MouseRegion { + anchors.fill: Knob + onClicked: { toggle() } + onReleased: { if (!isClick) dorelease() } + drag.target: Knob + drag.axis: "x" + drag.xmin: 1 + drag.xmax: 78 + } + states: [ + State { + name: "On" + SetProperty { + target: Knob + property: "x" + value: 78 + } + SetProperty { + target: Switch + property: "on" + value: true + } + }, + State { + name: "Off" + SetProperty { + target: Knob + property: "x" + value: 1 + } + SetProperty { + target: Switch + property: "on" + value: false + } + } + ] + transitions: [ + Transition { + NumericAnimation { + properties: "x" + easing: "easeInOutQuad" + duration: 200 + } + } + ] +} diff --git a/examples/declarative/slideswitch/display.qml b/examples/declarative/slideswitch/display.qml index b62422c..cea89b6 100644 --- a/examples/declarative/slideswitch/display.qml +++ b/examples/declarative/slideswitch/display.qml @@ -1,3 +1,8 @@ - - - +Rect { + color: "white" + width: 150 + height: 150 + Switch { + anchors.centeredIn: parent + } +} diff --git a/examples/declarative/states/states.qml b/examples/declarative/states/states.qml index e540d25..0c27637 100644 --- a/examples/declarative/states/states.qml +++ b/examples/declarative/states/states.qml @@ -1,40 +1,79 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Rect { + id: Page + width: 300 + height: 300 + color: "white" + // A target region. Clicking in here sets the state to '' - the default state + Rect { + width: 50 + height: 50 + x: 0 + y: 0 + color: "transparent" + pen.color: "black" + MouseRegion { + anchors.fill: parent + onClicked: { Page.state='' } + } + } + // Another target region. Clicking in here sets the state to 'Position1' + Rect { + width: 50 + height: 50 + x: 150 + y: 50 + color: "transparent" + pen.color: "black" + MouseRegion { + anchors.fill: parent + onClicked: { Page.state='Position1' } + } + } + // Another target region. Clicking in here sets the state to 'Position2' + Rect { + width: 50 + height: 50 + x: 0 + y: 200 + color: "transparent" + pen.color: "black" + MouseRegion { + anchors.fill: parent + onClicked: { Page.state='Position2' } + } + } + // Rect which will be moved when my state changes + Rect { + id: myrect + width: 50 + height: 50 + color: "red" + } + states: [ + // In state 'Position1', change the 'myrect' item x, y to 150, 50. + State { + name: "Position1" + SetProperty { + target: myrect + property: "x" + value: 150 + } + SetProperty { + target: myrect + property: "y" + value: 50 + } + } // In state 'Position2', change y to 100. We do not specify 'x' here - + // it will therefore be restored to its default value of 0, if it + // had been changed. +, + State { + name: "Position2" + SetProperty { + target: myrect + property: "y" + value: 200 + } + } + ] +} diff --git a/examples/declarative/states/transitions.qml b/examples/declarative/states/transitions.qml index c3f3515..c7fc656 100644 --- a/examples/declarative/states/transitions.qml +++ b/examples/declarative/states/transitions.qml @@ -1,68 +1,111 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Rect { + id: Page + width: 300 + height: 300 + color: "white" + // A target region. Clicking in here sets the state to '' - the default state + Rect { + width: 50 + height: 50 + x: 0 + y: 0 + color: "transparent" + pen.color: "black" + MouseRegion { + anchors.fill: parent + onClicked: { Page.state='' } + } + } + // Another target region. Clicking in here sets the state to 'Position1' + Rect { + width: 50 + height: 50 + x: 150 + y: 50 + color: "transparent" + pen.color: "black" + MouseRegion { + anchors.fill: parent + onClicked: { Page.state='Position1' } + } + } + // Another target region. Clicking in here sets the state to 'Position2' + Rect { + width: 50 + height: 50 + x: 0 + y: 200 + color: "transparent" + pen.color: "black" + MouseRegion { + anchors.fill: parent + onClicked: { Page.state='Position2' } + } + } + // Rect which will be moved when my state changes + Rect { + id: myrect + width: 50 + height: 50 + color: "red" + } + states: [ + // In state 'Position1', change the 'myrect' item x, y to 150, 50. + State { + name: "Position1" + SetProperty { + target: myrect + property: "x" + value: 150 + } + SetProperty { + target: myrect + property: "y" + value: 50 + } + } // In state 'Position2', change y to 100. We do not specify 'x' here - + // it will therefore be restored to its default value of 0, if it + // had been changed. +, + State { + name: "Position2" + SetProperty { + target: myrect + property: "y" + value: 200 + } + } + ] + // transitions define how the properties change. + transitions: [ + // When transitioning to 'Position1' move x,y over a duration of 1 second, + // with easeOutBounce easing function. + Transition { + fromState: "*" + toState: "Position1" + NumericAnimation { + properties: "x,y" + easing: "easeOutBounce" + duration: 1000 + } + } // When transitioning to 'Position2' move x,y over a duration of 2 seconds, + // with easeInOutQuad easing function. +, + Transition { + fromState: "*" + toState: "Position2" + NumericAnimation { + properties: "x,y" + easing: "easeInOutQuad" + duration: 2000 + } + } // For any other state changes move x,y linearly over duration of 200ms. +, + Transition { + NumericAnimation { + properties: "x,y" + duration: 200 + } + } + ] +} diff --git a/examples/declarative/tutorials/t1/tutorial1.qml b/examples/declarative/tutorials/t1/tutorial1.qml index e4de571..ec29f4f 100644 --- a/examples/declarative/tutorials/t1/tutorial1.qml +++ b/examples/declarative/tutorials/t1/tutorial1.qml @@ -1,3 +1,14 @@ - - - +Rect { + id: Page + width: 480 + height: 200 + color: "white" + Text { + id: HelloText + text: "Hello world!" + font.size: 24 + font.bold: true + y: 30 + anchors.horizontalCenter: Page.horizontalCenter + } +} diff --git a/examples/declarative/tutorials/t2/Cell.qml b/examples/declarative/tutorials/t2/Cell.qml index 5d6ff52..bd5bbe7 100644 --- a/examples/declarative/tutorials/t2/Cell.qml +++ b/examples/declarative/tutorials/t2/Cell.qml @@ -1,7 +1,16 @@ - - - - - - - +Item { + id: CellContainer + width: 40 + height: 25 + properties: Property { + name: "color" + } + Rect { + anchors.fill: parent + color: CellContainer.color + } + MouseRegion { + anchors.fill: parent + onClicked: { HelloText.color = CellContainer.color } + } +} diff --git a/examples/declarative/tutorials/t2/tutorial2.qml b/examples/declarative/tutorials/t2/tutorial2.qml index 1e3af16..08ea9eb 100644 --- a/examples/declarative/tutorials/t2/tutorial2.qml +++ b/examples/declarative/tutorials/t2/tutorial2.qml @@ -1,11 +1,41 @@ - - - - - - - - - - - +Rect { + id: Page + width: 480 + height: 200 + color: "white" + Text { + id: HelloText + text: "Hello world!" + font.size: 24 + font.bold: true + y: 30 + anchors.horizontalCenter: Page.horizontalCenter + } + GridLayout { + id: ColorPicker + x: 0 + anchors.bottom: Page.bottom + width: 120 + height: 50 + columns: 3 + rows: 2 + Cell { + color: "#ff0000" + } + Cell { + color: "#00ff00" + } + Cell { + color: "#0000ff" + } + Cell { + color: "#ffff00" + } + Cell { + color: "#00ffff" + } + Cell { + color: "#ff00ff" + } + } +} diff --git a/examples/declarative/tutorials/t3/Cell.qml b/examples/declarative/tutorials/t3/Cell.qml index 5d6ff52..bd5bbe7 100644 --- a/examples/declarative/tutorials/t3/Cell.qml +++ b/examples/declarative/tutorials/t3/Cell.qml @@ -1,7 +1,16 @@ - - - - - - - +Item { + id: CellContainer + width: 40 + height: 25 + properties: Property { + name: "color" + } + Rect { + anchors.fill: parent + color: CellContainer.color + } + MouseRegion { + anchors.fill: parent + onClicked: { HelloText.color = CellContainer.color } + } +} diff --git a/examples/declarative/tutorials/t3/tutorial3.qml b/examples/declarative/tutorials/t3/tutorial3.qml index f9f1415..8e2b697 100644 --- a/examples/declarative/tutorials/t3/tutorial3.qml +++ b/examples/declarative/tutorials/t3/tutorial3.qml @@ -1,27 +1,78 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - +Rect { + id: Page + width: 480 + height: 200 + color: "white" + Text { + id: HelloText + text: "Hello world!" + font.size: 24 + font.bold: true + y: 30 + anchors.horizontalCenter: Page.horizontalCenter + states: [ + State { + name: "down" + when: MouseRegion.pressed == true + SetProperty { + target: HelloText + property: "y" + value: 160 + } + SetProperty { + target: HelloText + property: "color" + value: "red" + } + } + ] + transitions: [ + Transition { + fromState: "*" + toState: "down" + reversible: true + ParallelAnimation { + NumericAnimation { + properties: "y" + duration: 500 + easing: "easeOutBounce" + } + ColorAnimation { + duration: 500 + } + } + } + ] + } + MouseRegion { + id: MouseRegion + anchors.fill: HelloText + } + GridLayout { + id: ColorPicker + x: 0 + anchors.bottom: Page.bottom + width: 120 + height: 50 + columns: 3 + rows: 2 + Cell { + color: "#ff0000" + } + Cell { + color: "#00ff00" + } + Cell { + color: "#0000ff" + } + Cell { + color: "#ffff00" + } + Cell { + color: "#00ffff" + } + Cell { + color: "#ff00ff" + } + } +} -- cgit v0.12 From 38d90a2d93d51325ef5dad0904eab2e3a30f3064 Mon Sep 17 00:00:00 2001 From: Roberto Raggi Date: Mon, 27 Apr 2009 12:38:12 +0200 Subject: Converted connections, listview and mouse. --- examples/declarative/connections/connections.qml | 38 +++-- examples/declarative/listview/listview.qml | 184 +++++++++++++---------- examples/declarative/mouseregion/mouse.qml | 72 ++++++--- 3 files changed, 180 insertions(+), 114 deletions(-) diff --git a/examples/declarative/connections/connections.qml b/examples/declarative/connections/connections.qml index 45c0e99..e66875a 100644 --- a/examples/declarative/connections/connections.qml +++ b/examples/declarative/connections/connections.qml @@ -1,9 +1,29 @@ - - - - - color="green"; - dot.x = mouse.x-1; - dot.y = mouse.y-1; - - +Rect { + id: rect + color: "blue" + width: 40 + height: 30 + Rect { + id: dot + color: "red" + width: 3 + height: 3 + x: rect.width/2 + y: rect.height/2 + } + MouseRegion { + id: mr + anchors.fill: rect + } + Connection { + sender: mr + signal: "clicked(mouse)" + script: { + + color="green"; + dot.x = mouse.x-1; + dot.y = mouse.y-1; + + } + } +} diff --git a/examples/declarative/listview/listview.qml b/examples/declarative/listview/listview.qml index 6cacdd1..b71ed4e 100644 --- a/examples/declarative/listview/listview.qml +++ b/examples/declarative/listview/listview.qml @@ -1,81 +1,103 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Rect { + width: 600 + height: 300 + color: "white" + // MyPets model is defined in dummydata/MyPetsModel.qml + // The viewer automatically loads files in dummydata/* to assist + // development without a real data source. + // This one contains my pets. + // Define a delegate component. A component will be + // instantiated for each visible item in the list. + Component { + id: PetDelegate + Item { + id: Wrapper + width: 200 + height: 50 + VerticalLayout { + Text { + text: 'Name: ' + name + } + Text { + text: 'Type: ' + type + } + Text { + text: 'Age: ' + age + } + } + } + } + // Define a highlight component. Just one of these will be instantiated + // by each ListView and placed behind the current item. + Component { + id: PetHighlight + Rect { + color: "#FFFF88" + } + } + // Show the model in three lists, with different currentItemPositioning. + // currentItemPositioning determines how the list behaves when the + // current item changes. Note that the second and third ListView + // set their currentIndex to be the same as the first, and that + // the first ListView is given keyboard focus. + // The default mode, Free, allows the currentItem to move freely + // within the visible area. If it would move outside the visible + // area, the view is scrolled to keep it visible. + // Snap currentItemPositioning attempts to keep the current item + // aligned with the snapPosition by scrolling the view, however the + // items will not scroll beyond the beginning or end of the view. + // SnapAuto currentItemPositioning always keeps the current item on + // the snapPosition by scrolling the view. It also automatically + // sets the current item as is scrolled with the mouse. Note + // that the first ListView sets its currentIndex to be equal to + // the third ListView's currentIndex. By flicking List3 with + // the mouse, the current index of List1 will be changed. + ListView { + id: List1 + width: 200 + height: parent.height + model: MyPetsModel + delegate: PetDelegate + highlight: PetHighlight + currentIndex: List3.currentIndex + focus: true + } + ListView { + id: List2 + x: 200 + width: 200 + height: parent.height + model: MyPetsModel + delegate: PetDelegate + highlight: PetHighlight + currentItemPositioning: "Snap" + snapPosition: 125 + currentIndex: List1.currentIndex + } + ListView { + id: List3 + x: 400 + width: 200 + height: parent.height + model: MyPetsModel + delegate: PetDelegate + currentItemPositioning: "SnapAuto" + snapPosition: 125 + currentIndex: List1.currentIndex + children: [ + // Position a static highlight rather than a normal highlight so that + // when the view is flicked, the highlight does not move. + // By positioning the highlight at the same position as the snapPosition + // the item under the highlight will always be the current item. + // Note that we specify the 'children' property. This is because + // the default property of a ListView is 'delegate'. + Rect { + y: 125 + width: 200 + height: 50 + color: "#FFFF88" + z: -1 + } + ] + } +} diff --git a/examples/declarative/mouseregion/mouse.qml b/examples/declarative/mouseregion/mouse.qml index 9581da2..070543c 100644 --- a/examples/declarative/mouseregion/mouse.qml +++ b/examples/declarative/mouseregion/mouse.qml @@ -1,24 +1,48 @@ - - - - - - - - - - +Rect { + color: "white" + width: 200 + height: 200 + Rect { + width: 50 + height: 50 + color: "red" + Text { + text: "Click" + anchors.centeredIn: parent + } + MouseRegion { + onPressed: { print('press (x: ' + mouse.x + ' y: ' + mouse.y + ')') } + onReleased: { print('release (x: ' + mouse.x + ' y: ' + mouse.y + ' isClick: ' + mouse.isClick + ' wasHeld: ' + mouse.wasHeld + ')') } + onClicked: { print('click (x: ' + mouse.x + ' y: ' + mouse.y + ' wasHeld: ' + mouse.wasHeld + ')') } + onDoubleClicked: { print('double click (x: ' + mouse.x + ' y: ' + mouse.y + ')') } + onPressAndHold: { print('press and hold') } + onExitedWhilePressed: { print('exiting while pressed') } + onReenteredWhilePressed: { print('reentering while pressed') } + anchors.fill: parent + } + } + Rect { + y: 100 + width: 50 + height: 50 + color: "blue" + Text { + text: "Drag" + anchors.centeredIn: parent + } + MouseRegion { + drag.target: parent + drag.axis: "x" + drag.xmin: 0 + drag.xmax: 150 + onPressed: { print('press') } + onReleased: { print('release (isClick: ' + mouse.isClick + ') (wasHeld: ' + mouse.wasHeld + ')') } + onClicked: { print('click' + '(wasHeld: ' + mouse.wasHeld + ')') } + onDoubleClicked: { print('double click') } + onPressAndHold: { print('press and hold') } + onExitedWhilePressed: { print('exiting while pressed') } + onReenteredWhilePressed: { print('reentering while pressed') } + anchors.fill: parent + } + } +} -- cgit v0.12 From d7ffaa8ccbf881d25004b9a710259701d1a8c9bc Mon Sep 17 00:00:00 2001 From: Roberto Raggi Date: Mon, 27 Apr 2009 15:45:31 +0200 Subject: Introduced Node::firstSourceLocation(), Node::lastSourceLocation(). --- src/declarative/qml/parser/javascript.g | 27 +- src/declarative/qml/parser/javascriptast.cpp | 8 + src/declarative/qml/parser/javascriptast_p.h | 459 ++++++++++++++++++--- src/declarative/qml/parser/javascriptastfwd_p.h | 1 + .../qml/parser/javascriptastvisitor_p.h | 3 + src/declarative/qml/parser/javascriptgrammar.cpp | 36 +- src/declarative/qml/parser/javascriptgrammar_p.h | 36 +- src/declarative/qml/parser/javascriptparser.cpp | 26 +- src/declarative/qml/parser/javascriptparser_p.h | 1 + src/declarative/qml/qmlscriptparser.cpp | 83 ++-- 10 files changed, 572 insertions(+), 108 deletions(-) diff --git a/src/declarative/qml/parser/javascript.g b/src/declarative/qml/parser/javascript.g index 0712828..961041e 100644 --- a/src/declarative/qml/parser/javascript.g +++ b/src/declarative/qml/parser/javascript.g @@ -240,6 +240,7 @@ public: JavaScript::AST::SourceElements *SourceElements; JavaScript::AST::Statement *Statement; JavaScript::AST::StatementList *StatementList; + JavaScript::AST::Block *Block; JavaScript::AST::VariableDeclaration *VariableDeclaration; JavaScript::AST::VariableDeclarationList *VariableDeclarationList; @@ -818,24 +819,36 @@ case $rule_number: { PrimaryExpression: T_LBRACE PropertyNameAndValueListOpt T_RBRACE ; /. case $rule_number: { + AST::ObjectLiteral *node = 0; if (sym(2).Node) - sym(1).Node = makeAstNode (driver->nodePool(), sym(2).PropertyNameAndValueList->finish ()); + node = makeAstNode (driver->nodePool(), + sym(2).PropertyNameAndValueList->finish ()); else - sym(1).Node = makeAstNode (driver->nodePool()); + node = makeAstNode (driver->nodePool()); + node->lbraceToken = loc(1); + node->lbraceToken = loc(3); + sym(1).Node = node; } break; ./ PrimaryExpression: T_LBRACE PropertyNameAndValueList T_COMMA T_RBRACE ; /. case $rule_number: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(2).PropertyNameAndValueList->finish ()); + AST::ObjectLiteral *node = makeAstNode (driver->nodePool(), + sym(2).PropertyNameAndValueList->finish ()); + node->lbraceToken = loc(1); + node->lbraceToken = loc(4); + sym(1).Node = node; } break; ./ PrimaryExpression: T_LPAREN Expression T_RPAREN ; /. case $rule_number: { - sym(1) = sym(2); + AST::NestedExpression *node = makeAstNode(driver->nodePool(), sym(2).Expression); + node->lparenToken = loc(1); + node->rparenToken = loc(3); + sym(1).Node = node; } break; ./ @@ -2360,7 +2373,7 @@ case $rule_number: { Catch: T_CATCH T_LPAREN T_IDENTIFIER T_RPAREN Block ; /. case $rule_number: { - AST::Catch *node = makeAstNode (driver->nodePool(), sym(3).sval, sym(5).Statement); + AST::Catch *node = makeAstNode (driver->nodePool(), sym(3).sval, sym(5).Block); node->catchToken = loc(1); node->lparenToken = loc(2); node->identifierToken = loc(3); @@ -2372,7 +2385,7 @@ case $rule_number: { Finally: T_FINALLY Block ; /. case $rule_number: { - AST::Finally *node = makeAstNode (driver->nodePool(), sym(2).Statement); + AST::Finally *node = makeAstNode (driver->nodePool(), sym(2).Block); node->finallyToken = loc(1); sym(1).Node = node; } break; @@ -2537,6 +2550,8 @@ PropertyNameAndValueListOpt: PropertyNameAndValueList ; tk.dval = yylval; tk.loc = yylloc; + yylloc.length = 0; + const QString msg = QString::fromUtf8("Missing `;'"); diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Warning, diff --git a/src/declarative/qml/parser/javascriptast.cpp b/src/declarative/qml/parser/javascriptast.cpp index f9ef71d..8a10650 100644 --- a/src/declarative/qml/parser/javascriptast.cpp +++ b/src/declarative/qml/parser/javascriptast.cpp @@ -79,6 +79,14 @@ Statement *Statement::statementCast() return this; } +void NestedExpression::accept0(Visitor *visitor) +{ + if (visitor->visit(this)) { + acceptChild(expression, visitor); + } + visitor->endVisit(this); +} + void ThisExpression::accept0(Visitor *visitor) { if (visitor->visit(this)) { diff --git a/src/declarative/qml/parser/javascriptast_p.h b/src/declarative/qml/parser/javascriptast_p.h index 267a697..69958e5 100644 --- a/src/declarative/qml/parser/javascriptast_p.h +++ b/src/declarative/qml/parser/javascriptast_p.h @@ -217,6 +217,7 @@ public: Kind_VoidExpression, Kind_WhileStatement, Kind_WithStatement, + Kind_NestedExpression, Kind_UiArrayBinding, Kind_UiImport, @@ -268,6 +269,9 @@ public: virtual ~ExpressionNode() {} virtual ExpressionNode *expressionCast(); + + virtual SourceLocation firstSourceLocation() const = 0; + virtual SourceLocation lastSourceLocation() const = 0; }; class Statement: public Node @@ -277,6 +281,32 @@ public: virtual ~Statement() {} virtual Statement *statementCast(); + + virtual SourceLocation firstSourceLocation() const = 0; + virtual SourceLocation lastSourceLocation() const = 0; +}; + +class NestedExpression: public ExpressionNode +{ +public: + JAVASCRIPT_DECLARE_AST_NODE(NestedExpression) + + NestedExpression(ExpressionNode *expression) + : expression(expression) + { kind = K; } + + virtual void accept0(Visitor *visitor); + + virtual SourceLocation firstSourceLocation() const + { return lparenToken; } + + virtual SourceLocation lastSourceLocation() const + { return rparenToken; } + +// attributes + ExpressionNode *expression; + SourceLocation lparenToken; + SourceLocation rparenToken; }; class ThisExpression: public ExpressionNode @@ -289,6 +319,12 @@ public: virtual void accept0(Visitor *visitor); + virtual SourceLocation firstSourceLocation() const + { return thisToken; } + + virtual SourceLocation lastSourceLocation() const + { return thisToken; } + // attributes SourceLocation thisToken; }; @@ -305,6 +341,12 @@ public: virtual void accept0(Visitor *visitor); + virtual SourceLocation firstSourceLocation() const + { return identifierToken; } + + virtual SourceLocation lastSourceLocation() const + { return identifierToken; } + // attributes JavaScriptNameIdImpl *name; SourceLocation identifierToken; @@ -320,6 +362,12 @@ public: virtual void accept0(Visitor *visitor); + virtual SourceLocation firstSourceLocation() const + { return nullToken; } + + virtual SourceLocation lastSourceLocation() const + { return nullToken; } + // attributes SourceLocation nullToken; }; @@ -334,6 +382,12 @@ public: virtual void accept0(Visitor *visitor); + virtual SourceLocation firstSourceLocation() const + { return trueToken; } + + virtual SourceLocation lastSourceLocation() const + { return trueToken; } + // attributes SourceLocation trueToken; }; @@ -348,6 +402,12 @@ public: virtual void accept0(Visitor *visitor); + virtual SourceLocation firstSourceLocation() const + { return falseToken; } + + virtual SourceLocation lastSourceLocation() const + { return falseToken; } + // attributes SourceLocation falseToken; }; @@ -363,6 +423,12 @@ public: virtual void accept0(Visitor *visitor); + virtual SourceLocation firstSourceLocation() const + { return literalToken; } + + virtual SourceLocation lastSourceLocation() const + { return literalToken; } + // attributes: double value; SourceLocation literalToken; @@ -380,6 +446,12 @@ public: virtual void accept0(Visitor *visitor); + virtual SourceLocation firstSourceLocation() const + { return literalToken; } + + virtual SourceLocation lastSourceLocation() const + { return literalToken; } + // attributes: JavaScriptNameIdImpl *value; SourceLocation literalToken; @@ -397,6 +469,12 @@ public: virtual void accept0(Visitor *visitor); + virtual SourceLocation firstSourceLocation() const + { return literalToken; } + + virtual SourceLocation lastSourceLocation() const + { return literalToken; } + // attributes: JavaScriptNameIdImpl *pattern; int flags; @@ -424,6 +502,12 @@ public: virtual void accept0(Visitor *visitor); + virtual SourceLocation firstSourceLocation() const + { return lbracketToken; } + + virtual SourceLocation lastSourceLocation() const + { return rbracketToken; } + // attributes ElementList *elements; Elision *elision; @@ -447,8 +531,16 @@ public: virtual void accept0(Visitor *visitor); + virtual SourceLocation firstSourceLocation() const + { return lbraceToken; } + + virtual SourceLocation lastSourceLocation() const + { return rbraceToken; } + // attributes PropertyNameAndValueList *properties; + SourceLocation lbraceToken; + SourceLocation rbraceToken; }; class ElementList: public Node @@ -624,6 +716,12 @@ public: virtual void accept0(Visitor *visitor); + virtual SourceLocation firstSourceLocation() const + { return base->firstSourceLocation(); } + + virtual SourceLocation lastSourceLocation() const + { return rbracketToken; } + // attributes ExpressionNode *base; ExpressionNode *expression; @@ -644,7 +742,13 @@ public: virtual void accept0(Visitor *visitor); -// attributes + virtual SourceLocation firstSourceLocation() const + { return base->firstSourceLocation(); } + + virtual SourceLocation lastSourceLocation() const + { return identifierToken; } + + // attributes ExpressionNode *base; JavaScriptNameIdImpl *name; SourceLocation dotToken; @@ -664,7 +768,13 @@ public: virtual void accept0(Visitor *visitor); -// attributes + virtual SourceLocation firstSourceLocation() const + { return newToken; } + + virtual SourceLocation lastSourceLocation() const + { return rparenToken; } + + // attributes ExpressionNode *base; ArgumentList *arguments; SourceLocation newToken; @@ -684,6 +794,12 @@ public: virtual void accept0(Visitor *visitor); + virtual SourceLocation firstSourceLocation() const + { return newToken; } + + virtual SourceLocation lastSourceLocation() const + { return expression->lastSourceLocation(); } + // attributes ExpressionNode *expression; SourceLocation newToken; @@ -702,6 +818,12 @@ public: virtual void accept0(Visitor *visitor); + virtual SourceLocation firstSourceLocation() const + { return base->firstSourceLocation(); } + + virtual SourceLocation lastSourceLocation() const + { return rparenToken; } + // attributes ExpressionNode *base; ArgumentList *arguments; @@ -755,6 +877,12 @@ public: virtual void accept0(Visitor *visitor); + virtual SourceLocation firstSourceLocation() const + { return base->firstSourceLocation(); } + + virtual SourceLocation lastSourceLocation() const + { return incrementToken; } + // attributes ExpressionNode *base; SourceLocation incrementToken; @@ -772,6 +900,12 @@ public: virtual void accept0(Visitor *visitor); + virtual SourceLocation firstSourceLocation() const + { return base->firstSourceLocation(); } + + virtual SourceLocation lastSourceLocation() const + { return decrementToken; } + // attributes ExpressionNode *base; SourceLocation decrementToken; @@ -788,6 +922,12 @@ public: virtual void accept0(Visitor *visitor); + virtual SourceLocation firstSourceLocation() const + { return deleteToken; } + + virtual SourceLocation lastSourceLocation() const + { return expression->lastSourceLocation(); } + // attributes ExpressionNode *expression; SourceLocation deleteToken; @@ -805,6 +945,12 @@ public: virtual void accept0(Visitor *visitor); + virtual SourceLocation firstSourceLocation() const + { return voidToken; } + + virtual SourceLocation lastSourceLocation() const + { return expression->lastSourceLocation(); } + // attributes ExpressionNode *expression; SourceLocation voidToken; @@ -822,6 +968,12 @@ public: virtual void accept0(Visitor *visitor); + virtual SourceLocation firstSourceLocation() const + { return typeofToken; } + + virtual SourceLocation lastSourceLocation() const + { return expression->lastSourceLocation(); } + // attributes ExpressionNode *expression; SourceLocation typeofToken; @@ -839,6 +991,12 @@ public: virtual void accept0(Visitor *visitor); + virtual SourceLocation firstSourceLocation() const + { return incrementToken; } + + virtual SourceLocation lastSourceLocation() const + { return expression->lastSourceLocation(); } + // attributes ExpressionNode *expression; SourceLocation incrementToken; @@ -856,6 +1014,12 @@ public: virtual void accept0(Visitor *visitor); + virtual SourceLocation firstSourceLocation() const + { return decrementToken; } + + virtual SourceLocation lastSourceLocation() const + { return expression->lastSourceLocation(); } + // attributes ExpressionNode *expression; SourceLocation decrementToken; @@ -873,6 +1037,12 @@ public: virtual void accept0(Visitor *visitor); + virtual SourceLocation firstSourceLocation() const + { return plusToken; } + + virtual SourceLocation lastSourceLocation() const + { return expression->lastSourceLocation(); } + // attributes ExpressionNode *expression; SourceLocation plusToken; @@ -890,6 +1060,12 @@ public: virtual void accept0(Visitor *visitor); + virtual SourceLocation firstSourceLocation() const + { return minusToken; } + + virtual SourceLocation lastSourceLocation() const + { return expression->lastSourceLocation(); } + // attributes ExpressionNode *expression; SourceLocation minusToken; @@ -907,6 +1083,12 @@ public: virtual void accept0(Visitor *visitor); + virtual SourceLocation firstSourceLocation() const + { return tildeToken; } + + virtual SourceLocation lastSourceLocation() const + { return expression->lastSourceLocation(); } + // attributes ExpressionNode *expression; SourceLocation tildeToken; @@ -924,6 +1106,12 @@ public: virtual void accept0(Visitor *visitor); + virtual SourceLocation firstSourceLocation() const + { return notToken; } + + virtual SourceLocation lastSourceLocation() const + { return expression->lastSourceLocation(); } + // attributes ExpressionNode *expression; SourceLocation notToken; @@ -944,6 +1132,12 @@ public: virtual void accept0(Visitor *visitor); + virtual SourceLocation firstSourceLocation() const + { return left->firstSourceLocation(); } + + virtual SourceLocation lastSourceLocation() const + { return right->lastSourceLocation(); } + // attributes ExpressionNode *left; int op; @@ -964,6 +1158,12 @@ public: virtual void accept0(Visitor *visitor); + virtual SourceLocation firstSourceLocation() const + { return expression->firstSourceLocation(); } + + virtual SourceLocation lastSourceLocation() const + { return ko->lastSourceLocation(); } + // attributes ExpressionNode *expression; ExpressionNode *ok; @@ -984,6 +1184,12 @@ public: virtual void accept0(Visitor *visitor); + virtual SourceLocation firstSourceLocation() const + { return left->firstSourceLocation(); } + + virtual SourceLocation lastSourceLocation() const + { return right->lastSourceLocation(); } + // attributes ExpressionNode *left; ExpressionNode *right; @@ -1002,7 +1208,13 @@ public: virtual void accept0(Visitor *visitor); -// attributes + virtual SourceLocation firstSourceLocation() const + { return lbraceToken; } + + virtual SourceLocation lastSourceLocation() const + { return rbraceToken; } + + // attributes StatementList *statements; SourceLocation lbraceToken; SourceLocation rbraceToken; @@ -1054,6 +1266,12 @@ public: virtual void accept0(Visitor *visitor); + virtual SourceLocation firstSourceLocation() const + { return declarationKindToken; } + + virtual SourceLocation lastSourceLocation() const + { return semicolonToken; } + // attributes VariableDeclarationList *declarations; SourceLocation declarationKindToken; @@ -1129,6 +1347,12 @@ public: virtual void accept0(Visitor *visitor); + virtual SourceLocation firstSourceLocation() const + { return semicolonToken; } + + virtual SourceLocation lastSourceLocation() const + { return semicolonToken; } + // attributes SourceLocation semicolonToken; }; @@ -1145,6 +1369,12 @@ public: virtual void accept0(Visitor *visitor); + virtual SourceLocation firstSourceLocation() const + { return expression->firstSourceLocation(); } + + virtual SourceLocation lastSourceLocation() const + { return semicolonToken; } + // attributes ExpressionNode *expression; SourceLocation semicolonToken; @@ -1163,6 +1393,17 @@ public: virtual void accept0(Visitor *visitor); + virtual SourceLocation firstSourceLocation() const + { return ifToken; } + + virtual SourceLocation lastSourceLocation() const + { + if (ko) + return ko->lastSourceLocation(); + + return ok->lastSourceLocation(); + } + // attributes ExpressionNode *expression; Statement *ok; @@ -1186,6 +1427,12 @@ public: virtual void accept0(Visitor *visitor); + virtual SourceLocation firstSourceLocation() const + { return doToken; } + + virtual SourceLocation lastSourceLocation() const + { return semicolonToken; } + // attributes Statement *statement; ExpressionNode *expression; @@ -1209,6 +1456,12 @@ public: virtual void accept0(Visitor *visitor); + virtual SourceLocation firstSourceLocation() const + { return whileToken; } + + virtual SourceLocation lastSourceLocation() const + { return statement->lastSourceLocation(); } + // attributes ExpressionNode *expression; Statement *statement; @@ -1230,6 +1483,12 @@ public: virtual void accept0(Visitor *visitor); + virtual SourceLocation firstSourceLocation() const + { return forToken; } + + virtual SourceLocation lastSourceLocation() const + { return statement->lastSourceLocation(); } + // attributes ExpressionNode *initialiser; ExpressionNode *condition; @@ -1255,6 +1514,12 @@ public: virtual void accept0(Visitor *visitor); + virtual SourceLocation firstSourceLocation() const + { return forToken; } + + virtual SourceLocation lastSourceLocation() const + { return statement->lastSourceLocation(); } + // attributes VariableDeclarationList *declarations; ExpressionNode *condition; @@ -1281,6 +1546,12 @@ public: virtual void accept0(Visitor *visitor); + virtual SourceLocation firstSourceLocation() const + { return forToken; } + + virtual SourceLocation lastSourceLocation() const + { return statement->lastSourceLocation(); } + // attributes ExpressionNode *initialiser; ExpressionNode *expression; @@ -1304,6 +1575,12 @@ public: virtual void accept0(Visitor *visitor); + virtual SourceLocation firstSourceLocation() const + { return forToken; } + + virtual SourceLocation lastSourceLocation() const + { return statement->lastSourceLocation(); } + // attributes VariableDeclaration *declaration; ExpressionNode *expression; @@ -1327,6 +1604,12 @@ public: virtual void accept0(Visitor *visitor); + virtual SourceLocation firstSourceLocation() const + { return continueToken; } + + virtual SourceLocation lastSourceLocation() const + { return semicolonToken; } + // attributes JavaScriptNameIdImpl *label; SourceLocation continueToken; @@ -1346,7 +1629,13 @@ public: virtual void accept0(Visitor *visitor); -// attributes + virtual SourceLocation firstSourceLocation() const + { return breakToken; } + + virtual SourceLocation lastSourceLocation() const + { return semicolonToken; } + + // attributes JavaScriptNameIdImpl *label; SourceLocation breakToken; SourceLocation identifierToken; @@ -1365,6 +1654,12 @@ public: virtual void accept0(Visitor *visitor); + virtual SourceLocation firstSourceLocation() const + { return returnToken; } + + virtual SourceLocation lastSourceLocation() const + { return semicolonToken; } + // attributes ExpressionNode *expression; SourceLocation returnToken; @@ -1384,6 +1679,12 @@ public: virtual void accept0(Visitor *visitor); + virtual SourceLocation firstSourceLocation() const + { return withToken; } + + virtual SourceLocation lastSourceLocation() const + { return statement->lastSourceLocation(); } + // attributes ExpressionNode *expression; Statement *statement; @@ -1392,46 +1693,52 @@ public: SourceLocation rparenToken; }; -class SwitchStatement: public Statement +class CaseBlock: public Node { public: - JAVASCRIPT_DECLARE_AST_NODE(SwitchStatement) + JAVASCRIPT_DECLARE_AST_NODE(CaseBlock) - SwitchStatement(ExpressionNode *e, CaseBlock *b): - expression (e), block (b) + CaseBlock(CaseClauses *c, DefaultClause *d = 0, CaseClauses *r = 0): + clauses (c), defaultClause (d), moreClauses (r) { kind = K; } - virtual ~SwitchStatement() {} + virtual ~CaseBlock() {} virtual void accept0(Visitor *visitor); // attributes - ExpressionNode *expression; - CaseBlock *block; - SourceLocation switchToken; - SourceLocation lparenToken; - SourceLocation rparenToken; + CaseClauses *clauses; + DefaultClause *defaultClause; + CaseClauses *moreClauses; + SourceLocation lbraceToken; + SourceLocation rbraceToken; }; -class CaseBlock: public Node +class SwitchStatement: public Statement { public: - JAVASCRIPT_DECLARE_AST_NODE(CaseBlock) + JAVASCRIPT_DECLARE_AST_NODE(SwitchStatement) - CaseBlock(CaseClauses *c, DefaultClause *d = 0, CaseClauses *r = 0): - clauses (c), defaultClause (d), moreClauses (r) + SwitchStatement(ExpressionNode *e, CaseBlock *b): + expression (e), block (b) { kind = K; } - virtual ~CaseBlock() {} + virtual ~SwitchStatement() {} virtual void accept0(Visitor *visitor); + virtual SourceLocation firstSourceLocation() const + { return switchToken; } + + virtual SourceLocation lastSourceLocation() const + { return block->rbraceToken; } + // attributes - CaseClauses *clauses; - DefaultClause *defaultClause; - CaseClauses *moreClauses; - SourceLocation lbraceToken; - SourceLocation rbraceToken; + ExpressionNode *expression; + CaseBlock *block; + SourceLocation switchToken; + SourceLocation lparenToken; + SourceLocation rparenToken; }; class CaseClauses: public Node @@ -1519,12 +1826,17 @@ public: virtual void accept0(Visitor *visitor); + virtual SourceLocation firstSourceLocation() const + { return identifierToken; } + + virtual SourceLocation lastSourceLocation() const + { return statement->lastSourceLocation(); } + // attributes JavaScriptNameIdImpl *label; Statement *statement; SourceLocation identifierToken; SourceLocation colonToken; - SourceLocation semicolonToken; }; class ThrowStatement: public Statement @@ -1539,46 +1851,24 @@ public: virtual void accept0(Visitor *visitor); -// attributes + virtual SourceLocation firstSourceLocation() const + { return throwToken; } + + virtual SourceLocation lastSourceLocation() const + { return semicolonToken; } + + // attributes ExpressionNode *expression; SourceLocation throwToken; SourceLocation semicolonToken; }; -class TryStatement: public Statement -{ -public: - JAVASCRIPT_DECLARE_AST_NODE(TryStatement) - - TryStatement(Statement *stmt, Catch *c, Finally *f): - statement (stmt), catchExpression (c), finallyExpression (f) - { kind = K; } - - TryStatement(Statement *stmt, Finally *f): - statement (stmt), catchExpression (0), finallyExpression (f) - { kind = K; } - - TryStatement(Statement *stmt, Catch *c): - statement (stmt), catchExpression (c), finallyExpression (0) - { kind = K; } - - virtual ~TryStatement() {} - - virtual void accept0(Visitor *visitor); - -// attributes - Statement *statement; - Catch *catchExpression; - Finally *finallyExpression; - SourceLocation tryToken; -}; - class Catch: public Node { public: JAVASCRIPT_DECLARE_AST_NODE(Catch) - Catch(JavaScriptNameIdImpl *n, Statement *stmt): + Catch(JavaScriptNameIdImpl *n, Block *stmt): name (n), statement (stmt) { kind = K; } @@ -1588,7 +1878,7 @@ public: // attributes JavaScriptNameIdImpl *name; - Statement *statement; + Block *statement; SourceLocation catchToken; SourceLocation lparenToken; SourceLocation identifierToken; @@ -1600,7 +1890,7 @@ class Finally: public Node public: JAVASCRIPT_DECLARE_AST_NODE(Finally) - Finally(Statement *stmt): + Finally(Block *stmt): statement (stmt) { kind = K; } @@ -1609,10 +1899,51 @@ public: virtual void accept0(Visitor *visitor); // attributes - Statement *statement; + Block *statement; SourceLocation finallyToken; }; +class TryStatement: public Statement +{ +public: + JAVASCRIPT_DECLARE_AST_NODE(TryStatement) + + TryStatement(Statement *stmt, Catch *c, Finally *f): + statement (stmt), catchExpression (c), finallyExpression (f) + { kind = K; } + + TryStatement(Statement *stmt, Finally *f): + statement (stmt), catchExpression (0), finallyExpression (f) + { kind = K; } + + TryStatement(Statement *stmt, Catch *c): + statement (stmt), catchExpression (c), finallyExpression (0) + { kind = K; } + + virtual ~TryStatement() {} + + virtual void accept0(Visitor *visitor); + + virtual SourceLocation firstSourceLocation() const + { return tryToken; } + + virtual SourceLocation lastSourceLocation() const + { + if (finallyExpression) + return finallyExpression->statement->rbraceToken; + else if (catchExpression) + return catchExpression->statement->rbraceToken; + + return statement->lastSourceLocation(); + } + +// attributes + Statement *statement; + Catch *catchExpression; + Finally *finallyExpression; + SourceLocation tryToken; +}; + class FunctionExpression: public ExpressionNode { public: @@ -1626,6 +1957,12 @@ public: virtual void accept0(Visitor *visitor); + virtual SourceLocation firstSourceLocation() const + { return functionToken; } + + virtual SourceLocation lastSourceLocation() const + { return rbraceToken; } + // attributes JavaScriptNameIdImpl *name; FormalParameterList *formals; @@ -1811,6 +2148,12 @@ public: virtual void accept0(Visitor *visitor); + virtual SourceLocation firstSourceLocation() const + { return debuggerToken; } + + virtual SourceLocation lastSourceLocation() const + { return semicolonToken; } + // attributes SourceLocation debuggerToken; SourceLocation semicolonToken; diff --git a/src/declarative/qml/parser/javascriptastfwd_p.h b/src/declarative/qml/parser/javascriptastfwd_p.h index e3951ed..858e393 100644 --- a/src/declarative/qml/parser/javascriptastfwd_p.h +++ b/src/declarative/qml/parser/javascriptastfwd_p.h @@ -140,6 +140,7 @@ class SourceElement; class FunctionSourceElement; class StatementSourceElement; class DebuggerStatement; +class NestedExpression; // ui elements class UiProgram; diff --git a/src/declarative/qml/parser/javascriptastvisitor_p.h b/src/declarative/qml/parser/javascriptastvisitor_p.h index e5f1427..81df364 100644 --- a/src/declarative/qml/parser/javascriptastvisitor_p.h +++ b/src/declarative/qml/parser/javascriptastvisitor_p.h @@ -135,6 +135,9 @@ public: virtual bool visit(PropertyNameAndValueList *) { return true; } virtual void endVisit(PropertyNameAndValueList *) {} + virtual bool visit(NestedExpression *) { return true; } + virtual void endVisit(NestedExpression *) {} + virtual bool visit(IdentifierPropertyName *) { return true; } virtual void endVisit(IdentifierPropertyName *) {} diff --git a/src/declarative/qml/parser/javascriptgrammar.cpp b/src/declarative/qml/parser/javascriptgrammar.cpp index dfa0c69..b06fd32 100644 --- a/src/declarative/qml/parser/javascriptgrammar.cpp +++ b/src/declarative/qml/parser/javascriptgrammar.cpp @@ -2,13 +2,41 @@ /**************************************************************************** ** ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) ** -** This file is part of the $MODULE$ of the Qt Toolkit. +** This file is part of the QtCore module of the Qt Toolkit. ** -** $TROLLTECH_DUAL_LICENSE$ +** $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. ** -** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +** 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$ ** ****************************************************************************/ diff --git a/src/declarative/qml/parser/javascriptgrammar_p.h b/src/declarative/qml/parser/javascriptgrammar_p.h index 4792cec..490acb2 100644 --- a/src/declarative/qml/parser/javascriptgrammar_p.h +++ b/src/declarative/qml/parser/javascriptgrammar_p.h @@ -2,13 +2,41 @@ /**************************************************************************** ** ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) ** -** This file is part of the $MODULE$ of the Qt Toolkit. +** This file is part of the QtCore module of the Qt Toolkit. ** -** $TROLLTECH_DUAL_LICENSE$ +** $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. ** -** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +** 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$ ** ****************************************************************************/ diff --git a/src/declarative/qml/parser/javascriptparser.cpp b/src/declarative/qml/parser/javascriptparser.cpp index f9661d5..6221386 100644 --- a/src/declarative/qml/parser/javascriptparser.cpp +++ b/src/declarative/qml/parser/javascriptparser.cpp @@ -384,18 +384,30 @@ case 39: { } break; case 40: { + AST::ObjectLiteral *node = 0; if (sym(2).Node) - sym(1).Node = makeAstNode (driver->nodePool(), sym(2).PropertyNameAndValueList->finish ()); + node = makeAstNode (driver->nodePool(), + sym(2).PropertyNameAndValueList->finish ()); else - sym(1).Node = makeAstNode (driver->nodePool()); + node = makeAstNode (driver->nodePool()); + node->lbraceToken = loc(1); + node->lbraceToken = loc(3); + sym(1).Node = node; } break; case 41: { - sym(1).Node = makeAstNode (driver->nodePool(), sym(2).PropertyNameAndValueList->finish ()); + AST::ObjectLiteral *node = makeAstNode (driver->nodePool(), + sym(2).PropertyNameAndValueList->finish ()); + node->lbraceToken = loc(1); + node->lbraceToken = loc(4); + sym(1).Node = node; } break; case 42: { - sym(1) = sym(2); + AST::NestedExpression *node = makeAstNode(driver->nodePool(), sym(2).Expression); + node->lparenToken = loc(1); + node->rparenToken = loc(3); + sym(1).Node = node; } break; case 43: { @@ -1339,7 +1351,7 @@ case 273: { } break; case 274: { - AST::Catch *node = makeAstNode (driver->nodePool(), sym(3).sval, sym(5).Statement); + AST::Catch *node = makeAstNode (driver->nodePool(), sym(3).sval, sym(5).Block); node->catchToken = loc(1); node->lparenToken = loc(2); node->identifierToken = loc(3); @@ -1348,7 +1360,7 @@ case 274: { } break; case 275: { - AST::Finally *node = makeAstNode (driver->nodePool(), sym(2).Statement); + AST::Finally *node = makeAstNode (driver->nodePool(), sym(2).Block); node->finallyToken = loc(1); sym(1).Node = node; } break; @@ -1451,6 +1463,8 @@ case 293: { tk.dval = yylval; tk.loc = yylloc; + yylloc.length = 0; + const QString msg = QString::fromUtf8("Missing `;'"); diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Warning, diff --git a/src/declarative/qml/parser/javascriptparser_p.h b/src/declarative/qml/parser/javascriptparser_p.h index d31597b..c08a14a 100644 --- a/src/declarative/qml/parser/javascriptparser_p.h +++ b/src/declarative/qml/parser/javascriptparser_p.h @@ -97,6 +97,7 @@ public: JavaScript::AST::SourceElements *SourceElements; JavaScript::AST::Statement *Statement; JavaScript::AST::StatementList *StatementList; + JavaScript::AST::Block *Block; JavaScript::AST::VariableDeclaration *VariableDeclaration; JavaScript::AST::VariableDeclarationList *VariableDeclarationList; diff --git a/src/declarative/qml/qmlscriptparser.cpp b/src/declarative/qml/qmlscriptparser.cpp index dbf71dd..4e0c283 100644 --- a/src/declarative/qml/qmlscriptparser.cpp +++ b/src/declarative/qml/qmlscriptparser.cpp @@ -9,7 +9,6 @@ #include "parser/javascriptnodepool_p.h" #include "parser/javascriptastvisitor_p.h" #include "parser/javascriptast_p.h" -#include "parser/javascriptprettypretty_p.h" #include #include @@ -60,7 +59,7 @@ public: ProcessAST(QmlScriptParser *parser); virtual ~ProcessAST(); - void operator()(AST::Node *node); + void operator()(const QString &code, AST::Node *node); protected: Object *defineObjectBinding(int line, @@ -97,10 +96,36 @@ protected: QString qualifiedNameId() const; + QString textAt(const AST::SourceLocation &loc) const + { return _contents.mid(loc.offset, loc.length); } + + QString textAt(const AST::SourceLocation &first, + const AST::SourceLocation &last) const + { return _contents.mid(first.offset, last.offset + last.length - first.offset); } + + QString asString(AST::ExpressionNode *expr) const + { + if (! expr) + return QString(); + + return textAt(expr->firstSourceLocation(), expr->lastSourceLocation()); + } + + QString asString(AST::Statement *stmt) const + { + if (! stmt) + return QString(); + + QString s = textAt(stmt->firstSourceLocation(), stmt->lastSourceLocation()); + s += QLatin1Char('\n'); + return s; + } + private: QmlScriptParser *_parser; StateStack _stateStack; QStringList _scope; + QString _contents; inline bool isSignalProperty(const QByteArray &propertyName) const { return (propertyName.length() >= 3 && propertyName.startsWith("on") && @@ -118,8 +143,9 @@ ProcessAST::~ProcessAST() { } -void ProcessAST::operator()(AST::Node *node) +void ProcessAST::operator()(const QString &code, AST::Node *node) { + _contents = code; accept(node); } @@ -258,9 +284,7 @@ Object *ProcessAST::defineObjectBinding(int line, if (AST::ExpressionStatement *stmt = AST::cast(scriptBinding->statement)) { script = getPrimitive("script", stmt->expression); } else { - QTextStream out(&script); - PrettyPretty pp(out); - pp(scriptBinding->statement); + script = asString(scriptBinding->statement); } defineProperty(QLatin1String("script"), line, script); } else { @@ -378,27 +402,25 @@ bool ProcessAST::visit(AST::UiObjectBinding *node) QString ProcessAST::getPrimitive(const QByteArray &propertyName, AST::ExpressionNode *expr) { QString primitive; - QTextStream out(&primitive); - PrettyPretty pp(out); if(isSignalProperty(propertyName)) { - pp(expr); + primitive = asString(expr); } else if (propertyName == "id" && expr && expr->kind == AST::Node::Kind_IdentifierExpression) { - primitive = AST::cast(expr)->name->asString(); - } else if (expr->kind == AST::Node::Kind_StringLiteral) { + primitive = asString(expr); + } else if (AST::StringLiteral *lit = AST::cast(expr)) { // hack: emulate weird XML feature that string literals are not quoted. //This needs to be fixed in the qmlcompiler once xml goes away. - primitive = AST::cast(expr)->value->asString(); + primitive = lit->value->asString(); } else if (expr->kind == AST::Node::Kind_TrueLiteral || expr->kind == AST::Node::Kind_FalseLiteral || expr->kind == AST::Node::Kind_NumericLiteral ) { - pp(expr); + primitive = asString(expr); } else { // create a binding - out << "{"; - pp(expr); - out << "}"; + primitive += QLatin1Char('{'); + primitive += asString(expr); + primitive += QLatin1Char('}'); } return primitive; } @@ -407,7 +429,6 @@ QString ProcessAST::getPrimitive(const QByteArray &propertyName, AST::Expression // UiObjectMember: UiQualifiedId T_COLON Statement ; bool ProcessAST::visit(AST::UiScriptBinding *node) { - int propertyCount = 0; AST::UiQualifiedId *propertyName = node->qualifiedId; for (; propertyName; propertyName = propertyName->next){ @@ -417,17 +438,20 @@ bool ProcessAST::visit(AST::UiScriptBinding *node) Property *prop = currentProperty(); QString primitive; - QTextStream out(&primitive); - PrettyPretty pp(out); if (AST::ExpressionStatement *stmt = AST::cast(node->statement)) { primitive = getPrimitive(prop->name, stmt->expression); } else if (isSignalProperty(prop->name)) { - pp(node->statement); + if (AST::Block *block = AST::cast(node->statement)) { + const int start = block->lbraceToken.offset + block->rbraceToken.length; + primitive += _contents.mid(start, block->rbraceToken.offset - start); + } else { + primitive += asString(node->statement); + } } else { // do binding - out << '{'; - pp(node->statement); - out << '}'; + primitive += QLatin1Char('{'); + primitive += asString(node->statement); + primitive += QLatin1Char('}'); } Value *v = new Value; @@ -468,16 +492,15 @@ bool ProcessAST::visit(AST::UiSourceElement *node) } QString source; - QTextStream out(&source); - PrettyPretty pp(out); - - pp(node->sourceElement); int line = 0; - if (AST::FunctionDeclaration *funDecl = AST::cast(node->sourceElement)) + if (AST::FunctionDeclaration *funDecl = AST::cast(node->sourceElement)) { line = funDecl->functionToken.startLine; - else if (AST::VariableStatement *varStmt = AST::cast(node->sourceElement)) + source = asString(funDecl); + } else if (AST::VariableStatement *varStmt = AST::cast(node->sourceElement)) { + // ignore variable declarations line = varStmt->declarationKindToken.startLine; + } Value *value = new Value; value->primitive = source; @@ -538,7 +561,7 @@ bool QmlScriptParser::parse(const QByteArray &data, const QUrl &url) } ProcessAST process(this); - process(parser.ast()); + process(code, parser.ast()); return true; } -- cgit v0.12 From dd056dc2c9bfc1dccfb31c076e2f16cf86f7228d Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Tue, 28 Apr 2009 15:15:24 +1000 Subject: Remove debug. --- src/declarative/fx/qfxmouseregion_p.h | 1 - 1 file changed, 1 deletion(-) diff --git a/src/declarative/fx/qfxmouseregion_p.h b/src/declarative/fx/qfxmouseregion_p.h index d72b423..e444bf2 100644 --- a/src/declarative/fx/qfxmouseregion_p.h +++ b/src/declarative/fx/qfxmouseregion_p.h @@ -82,7 +82,6 @@ public: lastButton = event->button(); lastButtons = event->buttons(); lastModifiers = event->modifiers(); - qDebug() << "modifiers" << lastModifiers; } bool absorb : 1; -- cgit v0.12 From c2f7a9a0d4c8c58d117220893a0ee0b965187f4c Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Tue, 28 Apr 2009 15:20:42 +1000 Subject: Don't create two atttached property objects per item. --- src/declarative/fx/qfxgridview.cpp | 7 +++++-- src/declarative/fx/qfxlistview.cpp | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/declarative/fx/qfxgridview.cpp b/src/declarative/fx/qfxgridview.cpp index 25c1565..b2fb1a1 100644 --- a/src/declarative/fx/qfxgridview.cpp +++ b/src/declarative/fx/qfxgridview.cpp @@ -79,8 +79,11 @@ public: } static QFxGridViewAttached *properties(QObject *obj) { - QFxGridViewAttached *rv = new QFxGridViewAttached(obj); - attachedProperties.insert(obj, rv); + QFxGridViewAttached *rv = attachedProperties.value(obj); + if(!rv) { + rv = new QFxGridViewAttached(obj); + attachedProperties.insert(obj, rv); + } return rv; } diff --git a/src/declarative/fx/qfxlistview.cpp b/src/declarative/fx/qfxlistview.cpp index c85d8ce..76f7e11 100644 --- a/src/declarative/fx/qfxlistview.cpp +++ b/src/declarative/fx/qfxlistview.cpp @@ -98,8 +98,11 @@ public: } static QFxListViewAttached *properties(QObject *obj) { - QFxListViewAttached *rv = new QFxListViewAttached(obj); - attachedProperties.insert(obj, rv); + QFxListViewAttached *rv = attachedProperties.value(obj); + if (!rv) { + rv = new QFxListViewAttached(obj); + attachedProperties.insert(obj, rv); + } return rv; } -- cgit v0.12