
#line 134 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtQml module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 2.0 or (at your option) the GNU General
** Public license version 3 or any later version approved by the KDE Free
** Qt Foundation. The licenses are as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-2.0.html and
** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/

#include <private/qqmljsengine_p.h>
#include <private/qqmljslexer_p.h>
#include <private/qqmljsast_p.h>
#include <private/qqmljsmemorypool_p.h>

#include <QtCore/qdebug.h>
#include <QtCore/qcoreapplication.h>

#include <string.h>


#line 493 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"


#include "qqmljsparser_p.h"

#include <QtCore/qvarlengtharray.h>

//
//  W A R N I N G
//  -------------
//
// This file is automatically generated from qqmljs.g.
// Changes should be made to that file, not here. Any change to this file will
// be lost!
//
// To regenerate this file, run:
//    qlalr --no-debug --no-lines --qt qqmljs.g
//

#define UNIMPLEMENTED syntaxError(loc(1), "Unimplemented"); return false

using namespace QQmlJS;

QT_BEGIN_NAMESPACE

void Parser::reallocateStack()
{
    if (! stack_size)
        stack_size = 128;
    else
        stack_size <<= 1;

    sym_stack = reinterpret_cast<Value*> (realloc(sym_stack, stack_size * sizeof(Value)));
    state_stack = reinterpret_cast<int*> (realloc(state_stack, stack_size * sizeof(int)));
    location_stack = reinterpret_cast<SourceLocation*> (realloc(location_stack, stack_size * sizeof(SourceLocation)));
    string_stack.resize(stack_size);
    rawString_stack.resize(stack_size);
}

Parser::Parser(Engine *engine):
    driver(engine),
    pool(engine->pool())
{
}

Parser::~Parser()
{
    if (stack_size) {
        free(sym_stack);
        free(state_stack);
        free(location_stack);
    }
}

static inline SourceLocation location(Lexer *lexer)
{
    SourceLocation loc;
    loc.offset = lexer->tokenOffset();
    loc.length = lexer->tokenLength();
    loc.startLine = lexer->tokenStartLine();
    loc.startColumn = lexer->tokenStartColumn();
    return loc;
}

AST::UiQualifiedId *Parser::reparseAsQualifiedId(AST::ExpressionNode *expr)
{
    QVarLengthArray<QStringRef, 4> nameIds;
    QVarLengthArray<SourceLocation, 4> locations;

    AST::ExpressionNode *it = expr;
    while (AST::FieldMemberExpression *m = AST::cast<AST::FieldMemberExpression *>(it)) {
        nameIds.append(m->name);
        locations.append(m->identifierToken);
        it = m->base;
    }

    if (AST::IdentifierExpression *idExpr = AST::cast<AST::IdentifierExpression *>(it)) {
        AST::UiQualifiedId *q = new (pool) AST::UiQualifiedId(idExpr->name);
        q->identifierToken = idExpr->identifierToken;

        AST::UiQualifiedId *currentId = q;
        for (int i = nameIds.size() - 1; i != -1; --i) {
            currentId = new (pool) AST::UiQualifiedId(currentId, nameIds[i]);
            currentId->identifierToken = locations[i];
        }

        return currentId->finish();
    }

    return 0;
}

void Parser::pushToken(int token)
{
    Q_ASSERT(last_token);
    Q_ASSERT(last_token < &token_buffer[TOKEN_BUFFER_SIZE]);
    last_token->token = yytoken;
    last_token->dval = yylval;
    last_token->spell = yytokenspell;
    last_token->raw = yytokenraw;
    last_token->loc = yylloc;
    ++last_token;
    yytoken = token;
}

int Parser::lookaheadToken(Lexer *lexer)
{
    if (yytoken < 0) {
        yytoken = lexer->lex();
        yylval = lexer->tokenValue();
        yytokenspell = lexer->tokenSpell();
        yytokenraw = lexer->rawString();
        yylloc = location(lexer);
    }
    return yytoken;
}

bool Parser::ensureNoFunctionTypeAnnotations(AST::TypeAnnotation *returnValueAnnotation, AST::FormalParameterList *formals)
{
    for (auto formal = formals; formal; formal = formal->next) {
        if (formal->element && formal->element->typeAnnotation) {
            syntaxError(formal->element->typeAnnotation->firstSourceLocation(), "Type annotations are not permitted in function parameters in JavaScript functions");
            return false;
        }
    }
    if (returnValueAnnotation) {
        syntaxError(returnValueAnnotation->firstSourceLocation(), "Type annotations are not permitted for the return value of JavaScript functions");
        return false;
    }
    return true;
}

//#define PARSER_DEBUG

bool Parser::parse(int startToken)
{
    Lexer *lexer = driver->lexer();
    bool hadErrors = false;
    yytoken = -1;
    int action = 0;

    token_buffer[0].token = startToken;
    first_token = &token_buffer[0];
    if (startToken == T_FEED_JS_SCRIPT && !lexer->qmlMode()) {
        Directives ignoreDirectives;
        Directives *directives = driver->directives();
        if (!directives)
            directives = &ignoreDirectives;
        DiagnosticMessage error;
        if (!lexer->scanDirectives(directives, &error)) {
            diagnostic_messages.append(error);
            return false;
        }
        token_buffer[1].token = lexer->tokenKind();
        token_buffer[1].dval = lexer->tokenValue();
        token_buffer[1].loc = location(lexer);
        token_buffer[1].spell = lexer->tokenSpell();
        last_token = &token_buffer[2];
    } else {
        last_token = &token_buffer[1];
    }

    tos = -1;
    program = 0;

    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->tokenValue();
                yytokenspell = lexer->tokenSpell();
                yytokenraw = lexer->rawString();
                yylloc = location(lexer);
            } else {
                yytoken = first_token->token;
                yylval = first_token->dval;
                yytokenspell = first_token->spell;
                yytokenraw = first_token->raw;
                yylloc = first_token->loc;
                ++first_token;
                if (first_token == last_token)
                    first_token = last_token = &token_buffer[0];
            }
        }

#ifdef PARSER_DEBUG
       qDebug() << "   in state" << action;
#endif

        action = t_action(action, yytoken);
#ifdef PARSER_DEBUG
       qDebug() << "   current token" << yytoken << (yytoken >= 0 ? spell[yytoken] : "(null)") << "new state" << action;
#endif
        if (action > 0) {
            if (action != ACCEPT_STATE) {
                yytoken = -1;
                sym(1).dval = yylval;
                stringRef(1) = yytokenspell;
                rawStringRef(1) = yytokenraw;
                loc(1) = yylloc;
            } else {
              --tos;
              return ! hadErrors;
            }
        } else if (action < 0) {
          const int r = -action - 1;
          tos -= rhs[r];

#ifdef PARSER_DEBUG
          qDebug() << "        reducing through rule " << -action;
#endif

          switch (r) {

#line 720 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 0: {
        sym(1).Node = sym(2).Node;
        program = sym(1).Node;
    } break;

#line 728 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 1: {
        sym(1).Node = sym(2).Node;
        program = sym(1).Node;
    } break;

#line 736 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 2: {
        sym(1).Node = sym(2).Node;
        program = sym(1).Node;
    } break;

#line 744 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 3: {
        sym(1).Node = sym(2).Node;
        program = sym(1).Node;
    } break;

#line 752 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 4: {
        sym(1).Node = sym(2).Node;
        program = sym(1).Node;
    } break;

#line 760 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 5: {
        sym(1).Node = sym(2).Node;
        program = sym(1).Node;
    } break;

#line 769 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 6: {
        sym(1).UiProgram = new (pool) AST::UiProgram(sym(1).UiHeaderItemList, sym(2).UiObjectMemberList->finish());
    } break;

#line 777 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 8: {
        sym(1).Node = sym(1).UiHeaderItemList->finish();
    } break;

#line 784 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 9: {
        sym(1).Node = new (pool) AST::UiHeaderItemList(sym(1).UiPragma);
    } break;

#line 791 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 10: {
        sym(1).Node = new (pool) AST::UiHeaderItemList(sym(1).UiImport);
    } break;

#line 798 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 11: {
        sym(1).Node = new (pool) AST::UiHeaderItemList(sym(1).UiHeaderItemList, sym(2).UiPragma);
    } break;

#line 805 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 12: {
        sym(1).Node = new (pool) AST::UiHeaderItemList(sym(1).UiHeaderItemList, sym(2).UiImport);
    } break;

#line 817 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 16: {
        AST::UiPragma *pragma = new (pool) AST::UiPragma(stringRef(2));
        pragma->pragmaToken = loc(1);
        pragma->semicolonToken = loc(3);
        sym(1).Node = pragma;
    } break;

#line 829 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 18: {
        sym(1).UiImport->semicolonToken = loc(2);
    } break;

#line 836 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 19: {
        auto version = new (pool) AST::UiVersionSpecifier(sym(1).dval, sym(3).dval);
        version->majorToken = loc(1);
        version->minorToken = loc(3);
        sym(1).UiVersionSpecifier = version;
    } break;

#line 847 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 20: {
        auto version = new (pool) AST::UiVersionSpecifier(sym(1).dval, 0);
        version->majorToken = loc(1);
        sym(1).UiVersionSpecifier = version;
    } break;

#line 856 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 21: {
        sym(1).UiImport->version = sym(2).UiVersionSpecifier;
        sym(1).UiImport->semicolonToken = loc(3);
    } break;

#line 864 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 22: {
        sym(1).UiImport->version = sym(2).UiVersionSpecifier;
        sym(1).UiImport->asToken = loc(3);
        sym(1).UiImport->importIdToken = loc(4);
        sym(1).UiImport->importId = stringRef(4);
        sym(1).UiImport->semicolonToken = loc(5);
    } break;

#line 875 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 23: {
        sym(1).UiImport->asToken = loc(2);
        sym(1).UiImport->importIdToken = loc(3);
        sym(1).UiImport->importId = stringRef(3);
        sym(1).UiImport->semicolonToken = loc(4);
    } break;

#line 885 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 24: {
        AST::UiImport *node = 0;

        if (AST::StringLiteral *importIdLiteral = AST::cast<AST::StringLiteral *>(sym(2).Expression)) {
            node = new (pool) AST::UiImport(importIdLiteral->value);
            node->fileNameToken = loc(2);
        } else if (AST::UiQualifiedId *qualifiedId = reparseAsQualifiedId(sym(2).Expression)) {
            node = new (pool) AST::UiImport(qualifiedId);
            node->fileNameToken = loc(2);
        }

        sym(1).Node = node;

        if (node) {
            node->importToken = loc(1);
        } else {
            diagnostic_messages.append(compileError(loc(1),
             QLatin1String("Expected a qualified name id or a string literal")));

            return false; // ### remove me
        }
    } break;

#line 911 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 25: {
        sym(1).Node = nullptr;
    } break;

#line 918 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 26: {
        sym(1).Node = new (pool) AST::UiObjectMemberList(sym(1).UiObjectMember);
    } break;

#line 925 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 27: {
        AST::IdentifierExpression *node = new (pool) AST::IdentifierExpression(stringRef(1));
        node->identifierToken = loc(1);
        sym(1).Node = node;
    } break;

#line 934 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 28: {
        AST::FieldMemberExpression *node = new (pool) AST::FieldMemberExpression(sym(1).Expression, stringRef(3));
        node->dotToken = loc(2);
        node->identifierToken = loc(3);
        sym(1).Node = node;
    } break;

#line 944 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 29: {
        if (AST::UiQualifiedId *qualifiedId = reparseAsQualifiedId(sym(1).Expression)) {
            sym(1).UiQualifiedId = qualifiedId;
        } else {
            sym(1).UiQualifiedId = 0;

            diagnostic_messages.append(compileError(loc(1),
            QLatin1String("Expected a qualified name id")));

            return false;
        }
        AST::UiAnnotation *node = new (pool) AST::UiAnnotation(sym(1).UiQualifiedId, sym(2).UiObjectInitializer);
        sym(1).Node = node;
    } break;

#line 962 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

case 30: {
    sym(1).Node = sym(2).Node;
} break;

#line 970 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 31: {
        sym(1).Node = new (pool) AST::UiAnnotationList(sym(1).UiAnnotation);
    } break;

#line 977 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 32: {
        AST::UiAnnotationList *node = new (pool) AST::UiAnnotationList(sym(1).UiAnnotationList, sym(2).UiAnnotation);
        sym(1).Node = node;
    } break;

#line 985 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

   case 33: {
       AST::UiObjectDefinition *node = sym(2).UiObjectDefinition;
       node->annotations = sym(1).UiAnnotationList->finish();
       sym(1).Node = node;
   } break;

#line 996 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 35: {
        sym(1).Node = new (pool) AST::UiObjectMemberList(sym(1).UiObjectMember);
    } break;

#line 1003 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 36: {
        AST::UiObjectMemberList *node = new (pool) AST:: UiObjectMemberList(sym(1).UiObjectMemberList, sym(2).UiObjectMember);
        sym(1).Node = node;
    } break;

#line 1011 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 37: {
        sym(1).Node = new (pool) AST::UiArrayMemberList(sym(1).UiObjectMember);
    } break;

#line 1018 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 38: {
        AST::UiArrayMemberList *node = new (pool) AST::UiArrayMemberList(sym(1).UiArrayMemberList, sym(3).UiObjectMember);
        node->commaToken = loc(2);
        sym(1).Node = node;
    } break;

#line 1027 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 39: {
        AST::UiObjectInitializer *node = new (pool) AST::UiObjectInitializer((AST::UiObjectMemberList*)0);
        node->lbraceToken = loc(1);
        node->rbraceToken = loc(2);
        sym(1).Node = node;
    } break;

#line 1037 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 40: {
        AST::UiObjectInitializer *node = new (pool) AST::UiObjectInitializer(sym(2).UiObjectMemberList->finish());
        node->lbraceToken = loc(1);
        node->rbraceToken = loc(3);
        sym(1).Node = node;
    } break;

#line 1047 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 41: {
        AST::UiObjectDefinition *node = new (pool) AST::UiObjectDefinition(sym(1).UiQualifiedId, sym(2).UiObjectInitializer);
        sym(1).Node = node;
    } break;

#line 1055 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

   case 42: {
       AST::UiObjectMember *node = sym(2).UiObjectMember;
       node->annotations = sym(1).UiAnnotationList->finish();
       sym(1).Node = sym(2).Node;
   } break;

#line 1068 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 45: {
        AST::UiArrayBinding *node = new (pool) AST::UiArrayBinding(sym(1).UiQualifiedId, sym(5).UiArrayMemberList->finish());
        node->colonToken = loc(2);
        node->lbracketToken = loc(4);
        node->rbracketToken = loc(6);
        sym(1).Node = node;
    } break;

#line 1079 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 46: {
        AST::UiObjectBinding *node = new (pool) AST::UiObjectBinding(
            sym(1).UiQualifiedId, sym(4).UiQualifiedId, sym(5).UiObjectInitializer);
        node->colonToken = loc(2);
        sym(1).Node = node;
    } break;

#line 1089 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 47: {
        AST::UiObjectBinding *node = new (pool) AST::UiObjectBinding(
          sym(3).UiQualifiedId, sym(1).UiQualifiedId, sym(4).UiObjectInitializer);
        node->colonToken = loc(2);
        node->hasOnToken = true;
        sym(1).Node = node;
    } break;

#line 1101 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 48: {
        AST::ObjectPattern *l = new (pool) AST::ObjectPattern(sym(3).PatternPropertyList->finish());
        l->lbraceToken = loc(1);
        l->rbraceToken = loc(4);
        AST::ExpressionStatement *node = new (pool) AST::ExpressionStatement(l);
        node->semicolonToken = loc(5);
        sym(1).Node = node;
    } break;

#line 1114 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 49: {
        AST::ObjectPattern *l = new (pool) AST::ObjectPattern(sym(3).PatternPropertyList->finish());
        l->lbraceToken = loc(1);
        l->rbraceToken = loc(5);
        AST::ExpressionStatement *node = new (pool) AST::ExpressionStatement(l);
        node->semicolonToken = loc(6);
        sym(1).Node = node;
    } break;

#line 1127 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"
  case 50: Q_FALLTHROUGH(); 
#line 1129 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"
  case 51: Q_FALLTHROUGH(); 
#line 1131 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 52: {
        sym(1).Node = sym(3).Node;
    } break;

#line 1139 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"
  case 53: Q_FALLTHROUGH(); 
#line 1141 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"
  case 54: Q_FALLTHROUGH(); 
#line 1143 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"
  case 55: Q_FALLTHROUGH(); 
#line 1145 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"
  case 56: Q_FALLTHROUGH(); 
#line 1147 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"
  case 57: Q_FALLTHROUGH(); 
#line 1149 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 58: {
        sym(1).Node = sym(2).Node;
    } break;

#line 1156 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

case 59:
{
    AST::UiScriptBinding *node = new (pool) AST::UiScriptBinding(sym(1).UiQualifiedId, sym(3).Statement);
    node->colonToken = loc(2);
    sym(1).Node = node;
    } break;

#line 1166 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"
  case 60: Q_FALLTHROUGH(); 
#line 1168 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"
  case 61: Q_FALLTHROUGH(); 
#line 1170 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 62: {
        AST::UiQualifiedId *node = new (pool) AST::UiQualifiedId(stringRef(1));
        node->identifierToken = loc(1);
        sym(1).Node = node;
    } break;

#line 1179 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 63: {
        AST::UiQualifiedId *node = new (pool) AST::UiQualifiedId(sym(1).UiQualifiedId, stringRef(3));
        node->identifierToken = loc(3);
        sym(1).Node = node;
    } break;

#line 1188 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 64: {
        sym(1).Node = nullptr;
    } break;

#line 1195 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 65: {
        sym(1).Node = sym(1).UiParameterList->finish();
    } break;

#line 1202 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 66: {
        AST::UiParameterList *node = new (pool) AST::UiParameterList(sym(3).UiQualifiedId->finish(), stringRef(1));
        node->identifierToken = loc(1);
        node->colonToken = loc(2);
        node->propertyTypeToken = loc(3);
        sym(1).Node = node;
    } break;

#line 1213 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 67: {
        AST::UiParameterList *node = new (pool) AST::UiParameterList(sym(1).UiQualifiedId->finish(), stringRef(2));
        node->propertyTypeToken = loc(1);
        node->identifierToken = loc(2);
        sym(1).Node = node;
    } break;

#line 1223 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 68: {
        AST::UiParameterList *node = new (pool) AST::UiParameterList(sym(1).UiParameterList, sym(5).UiQualifiedId->finish(), stringRef(3));
        node->propertyTypeToken = loc(5);
        node->commaToken = loc(2);
        node->identifierToken = loc(3);
        node->colonToken = loc(4);
        sym(1).Node = node;
    } break;

#line 1235 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 69: {
        AST::UiParameterList *node = new (pool) AST::UiParameterList(sym(1).UiParameterList, sym(3).UiQualifiedId->finish(), stringRef(4));
        node->propertyTypeToken = loc(3);
        node->commaToken = loc(2);
        node->identifierToken = loc(4);
        sym(1).Node = node;
    } break;

#line 1246 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 70: {
        AST::UiPublicMember *node = new (pool) AST::UiPublicMember(nullptr, stringRef(2));
        node->type = AST::UiPublicMember::Signal;
        node->propertyToken = loc(1);
        node->typeToken = loc(2);
        node->identifierToken = loc(2);
        node->parameters = sym(4).UiParameterList;
        node->semicolonToken = loc(6);
        sym(1).Node = node;
    } break;

#line 1260 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 71: {
        AST::UiPublicMember *node = new (pool) AST::UiPublicMember(nullptr, stringRef(2));
        node->type = AST::UiPublicMember::Signal;
        node->propertyToken = loc(1);
        node->typeToken = loc(2);
        node->identifierToken = loc(2);
        node->semicolonToken = loc(3);
        sym(1).Node = node;
    } break;

#line 1273 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 72: {
        AST::UiPublicMember *node = new (pool) AST::UiPublicMember(sym(4).UiQualifiedId->finish(), stringRef(6));
        node->typeModifier = stringRef(2);
        node->propertyToken = loc(1);
        node->typeModifierToken = loc(2);
        node->typeToken = loc(4);
        node->identifierToken = loc(6);
        node->semicolonToken = loc(7);
        sym(1).Node = node;
    } break;

#line 1289 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 74: {
        AST::UiPublicMember *node = sym(2).UiPublicMember;
        node->isReadonlyMember = true;
        node->readonlyToken = loc(1);
        sym(1).Node = node;
    } break;

#line 1299 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 75: {
        AST::UiPublicMember *node = new (pool) AST::UiPublicMember(sym(2).UiQualifiedId->finish(), stringRef(3));
        node->propertyToken = loc(1);
        node->typeToken = loc(2);
        node->identifierToken = loc(3);
        node->semicolonToken = loc(4);
        sym(1).Node = node;
    } break;

#line 1314 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 77: {
        AST::UiPublicMember *node = sym(2).UiPublicMember;
        node->isDefaultMember = true;
        node->defaultToken = loc(1);
        sym(1).Node = node;
    } break;

#line 1324 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 78: {
        AST::UiPublicMember *node = sym(2).UiPublicMember;
        node->isDefaultMember = true;
        node->defaultToken = loc(1);
        sym(1).Node = node;
    } break;

#line 1334 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 79: {
        AST::UiPublicMember *node = sym(3).UiPublicMember;
        node->isDefaultMember = true;
        node->defaultToken = loc(1);
        node->isRequired = true;
        node->requiredToken = loc(2);
        sym(1).Node = node;
    } break;

#line 1347 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 80: {
        AST::UiPublicMember *node = sym(3).UiPublicMember;
        node->isDefaultMember = true;
        node->defaultToken = loc(2);
        node->isRequired = true;
        node->requiredToken = loc(1);
        sym(1).Node = node;
    } break;

#line 1359 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

/* we need OptionalSemicolon because UiScriptStatement might already parse the last semicolon
  and then we would miss a semicolon (see tests/auto/quick/qquickvisualdatamodel/data/objectlist.qml)*/
 
#line 1365 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 83: {
        AST::UiRequired *node = new (pool) AST::UiRequired(stringRef(2));
        node->requiredToken = loc(1);
        node->semicolonToken = loc(3);
        sym(1).Node = node;
    } break;

#line 1377 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 85: {
        AST::UiPublicMember *node = sym(2).UiPublicMember;
        node->requiredToken = loc(1);
        node->isRequired = true;
        sym(1).Node = node;
    } break;

#line 1387 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 86: {
        AST::UiPublicMember *node = new (pool) AST::UiPublicMember(sym(2).UiQualifiedId->finish(), stringRef(3), sym(5).Statement);
        node->propertyToken = loc(1);
        node->typeToken = loc(2);
        node->identifierToken = loc(3);
        node->colonToken = loc(4);
        sym(1).Node = node;
    } break;

#line 1401 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 88: {
        AST::UiPublicMember *node = sym(2).UiPublicMember;
        node->isReadonlyMember = true;
        node->readonlyToken = loc(1);
        sym(1).Node = node;
    } break;

#line 1411 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 89: {
        AST::UiPublicMember *node = sym(2).UiPublicMember;
        node->isDefaultMember = true;
        node->defaultToken = loc(1);
        sym(1).Node = node;
    } break;

#line 1421 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 90: {
        AST::UiPublicMember *node = new (pool) AST::UiPublicMember(sym(4).UiQualifiedId->finish(), stringRef(6));
        node->typeModifier = stringRef(2);
        node->propertyToken = loc(1);
        node->typeModifierToken = loc(2);
        node->typeToken = loc(4);
        node->identifierToken = loc(6);
        node->semicolonToken = loc(7); // insert a fake ';' before ':'

        AST::UiQualifiedId *propertyName = new (pool) AST::UiQualifiedId(stringRef(6));
        propertyName->identifierToken = loc(6);
        propertyName->next = 0;

        AST::UiArrayBinding *binding = new (pool) AST::UiArrayBinding(propertyName, sym(9).UiArrayMemberList->finish());
        binding->colonToken = loc(7);
        binding->lbracketToken = loc(8);
        binding->rbracketToken = loc(10);

        node->binding = binding;

        sym(1).Node = node;
    } break;

#line 1449 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 92: {
        AST::UiPublicMember *node = sym(2).UiPublicMember;
        node->isReadonlyMember = true;
        node->readonlyToken = loc(1);
        sym(1).Node = node;
    } break;

#line 1459 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 93: {
        AST::UiPublicMember *node = new (pool) AST::UiPublicMember(sym(2).UiQualifiedId->finish(), stringRef(3));
        node->propertyToken = loc(1);
        node->typeToken = loc(2);
        node->identifierToken = loc(3);
        node->semicolonToken = loc(4); // insert a fake ';' before ':'

        AST::UiQualifiedId *propertyName = new (pool) AST::UiQualifiedId(stringRef(3));
        propertyName->identifierToken = loc(3);
        propertyName->next = 0;

        AST::UiObjectBinding *binding = new (pool) AST::UiObjectBinding(
          propertyName, sym(6).UiQualifiedId, sym(7).UiObjectInitializer);
        binding->colonToken = loc(4);

        node->binding = binding;

        sym(1).Node = node;
    } break;

#line 1484 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 95: {
        AST::UiPublicMember *node = sym(2).UiPublicMember;
        node->isReadonlyMember = true;
        node->readonlyToken = loc(1);
        sym(1).Node = node;
    } break;

#line 1494 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 96: {
        auto node = new (pool) AST::UiSourceElement(sym(1).Node);
        sym(1).Node = node;
    } break;

#line 1502 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 97: {
        sym(1).Node = new (pool) AST::UiSourceElement(sym(1).Node);
    } break;

#line 1509 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 98: {
        sym(1).Node = new (pool) AST::UiSourceElement(sym(1).Node);
    } break;

#line 1516 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 99: {
      if (AST::ArrayMemberExpression *mem = AST::cast<AST::ArrayMemberExpression *>(sym(1).Expression)) {
        diagnostic_messages.append(compileError(mem->lbracketToken,
          QLatin1String("Ignored annotation"), QtWarningMsg));

        sym(1).Expression = mem->base;
      }

      if (AST::UiQualifiedId *qualifiedId = reparseAsQualifiedId(sym(1).Expression)) {
        sym(1).UiQualifiedId = qualifiedId;
      } else {
        sym(1).UiQualifiedId = 0;

        diagnostic_messages.append(compileError(loc(1),
          QLatin1String("Expected a qualified name id")));

        return false; // ### recover
      }
    } break;

#line 1539 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 100: {
        AST::UiEnumDeclaration *enumDeclaration = new (pool) AST::UiEnumDeclaration(stringRef(2), sym(4).UiEnumMemberList->finish());
        enumDeclaration->enumToken = loc(1);
        enumDeclaration->rbraceToken = loc(5);
        sym(1).Node = enumDeclaration;
        break;
    }

#line 1550 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 101: {
        if (!stringRef(2).front().isUpper()) {
            diagnostic_messages.append(compileError(loc(2),
                QLatin1String("Type name must be upper case"), QtWarningMsg));
        }
        auto inlineComponent = new (pool) AST::UiInlineComponent(stringRef(2), sym(4).UiObjectDefinition);
        inlineComponent->componentToken = loc(1);
        sym(1).Node = inlineComponent;
    } break;

#line 1563 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 102: {
        AST::UiEnumMemberList *node = new (pool) AST::UiEnumMemberList(stringRef(1));
        node->memberToken = loc(1);
        sym(1).Node = node;
        break;
    }

#line 1573 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 103: {
        AST::UiEnumMemberList *node = new (pool) AST::UiEnumMemberList(stringRef(1), sym(3).dval);
        node->memberToken = loc(1);
        node->valueToken = loc(3);
        sym(1).Node = node;
        break;
    }

#line 1584 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 104: {
        AST::UiEnumMemberList *node = new (pool) AST::UiEnumMemberList(sym(1).UiEnumMemberList, stringRef(3));
        node->memberToken = loc(3);
        sym(1).Node = node;
        break;
    }

#line 1594 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 105: {
        AST::UiEnumMemberList *node = new (pool) AST::UiEnumMemberList(sym(1).UiEnumMemberList, stringRef(3), sym(5).dval);
        node->memberToken = loc(3);
        node->valueToken = loc(5);
        sym(1).Node = node;
        break;
    }

#line 1638 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 132: {
        sym(1).TypeArgumentList = new (pool) AST::TypeArgumentList(sym(1).Type);
    } break;

#line 1645 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 133: {
        sym(1).TypeArgumentList = new (pool) AST::TypeArgumentList(sym(1).TypeArgumentList, sym(3).Type);
    } break;

#line 1652 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 134: {
        sym(1).Type = new (pool) AST::Type(sym(1).UiQualifiedId, sym(3).TypeArgumentList->finish());
    } break;

#line 1659 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 135: {
        AST::UiQualifiedId *id = new (pool) AST::UiQualifiedId(stringRef(1));
        id->identifierToken = loc(1);
        sym(1).Type = new (pool) AST::Type(id->finish());
    } break;

#line 1668 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 136: {
        sym(1).Type = new (pool) AST::Type(sym(1).UiQualifiedId);
    } break;

#line 1675 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 137: {
        sym(1).TypeAnnotation = new (pool) AST::TypeAnnotation(sym(2).Type);
        sym(1).TypeAnnotation->colonToken = loc(1);
    } break;

#line 1684 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 139: {
        sym(1).TypeAnnotation = nullptr;
    } break;

#line 1695 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 140: {
        AST::ThisExpression *node = new (pool) AST::ThisExpression();
        node->thisToken = loc(1);
        sym(1).Node = node;
    } break;

#line 1704 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 141: {
        AST::IdentifierExpression *node = new (pool) AST::IdentifierExpression(stringRef(1));
        node->identifierToken = loc(1);
        sym(1).Node = node;
    } break;

#line 1722 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 150: {
        if (coverExpressionType != CE_ParenthesizedExpression) {
            syntaxError(coverExpressionErrorLocation, "Expected token ')'.");
            return false;
        }
    } break;

#line 1733 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 151: {
        AST::NestedExpression *node = new (pool) AST::NestedExpression(sym(2).Expression);
        node->lparenToken = loc(1);
        node->rparenToken = loc(3);
        sym(1).Node = node;
        coverExpressionType = CE_ParenthesizedExpression;
    } break;

#line 1744 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 152: {
        sym(1).Node = nullptr;
        coverExpressionErrorLocation = loc(2);
        coverExpressionType = CE_FormalParameterList;
    } break;

#line 1753 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 153: {
        AST::FormalParameterList *node = (new (pool) AST::FormalParameterList(nullptr, sym(2).PatternElement))->finish(pool);
        sym(1).Node = node;
        coverExpressionErrorLocation = loc(2);
        coverExpressionType = CE_FormalParameterList;
    } break;

#line 1763 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 154: {
        AST::FormalParameterList *list = sym(2).Expression->reparseAsFormalParameterList(pool);
        if (!list) {
            syntaxError(loc(1), "Invalid Arrow parameter list.");
            return false;
        }
        if (sym(4).Node) {
            list = new (pool) AST::FormalParameterList(list, sym(4).PatternElement);
        }
        coverExpressionErrorLocation = loc(4);
        coverExpressionType = CE_FormalParameterList;
        sym(1).Node = list->finish(pool);
    } break;

#line 1780 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 155: {
        AST::NullExpression *node = new (pool) AST::NullExpression();
        node->nullToken = loc(1);
        sym(1).Node = node;
    } break;

#line 1789 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 156: {
        AST::TrueLiteral *node = new (pool) AST::TrueLiteral();
        node->trueToken = loc(1);
        sym(1).Node = node;
    } break;

#line 1798 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 157: {
        AST::FalseLiteral *node = new (pool) AST::FalseLiteral();
        node->falseToken = loc(1);
        sym(1).Node = node;
    } break;

#line 1807 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 158: {
        AST::NumericLiteral *node = new (pool) AST::NumericLiteral(sym(1).dval);
        node->literalToken = loc(1);
        sym(1).Node = node;
    } break;

#line 1816 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"
  case 159: Q_FALLTHROUGH(); 
#line 1819 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 160: {
        AST::StringLiteral *node = new (pool) AST::StringLiteral(stringRef(1));
        node->literalToken = loc(1);
        sym(1).Node = node;
    } break;

#line 1831 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

{
    Lexer::RegExpBodyPrefix prefix;
    case 161:
        prefix = Lexer::NoPrefix;
        goto scan_regexp;

#line 1843 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 162:
        prefix = Lexer::EqualPrefix;
        goto scan_regexp;

    scan_regexp: {
        bool rx = lexer->scanRegExp(prefix);
        if (!rx) {
            diagnostic_messages.append(compileError(location(lexer), lexer->errorMessage()));
            return false;
        }

        loc(1).length = lexer->tokenLength();
        yylloc = loc(1); // adjust the location of the current token

        AST::RegExpLiteral *node = new (pool) AST::RegExpLiteral(driver->newStringRef(lexer->regExpPattern()), lexer->regExpFlags());
        node->literalToken = loc(1);
        sym(1).Node = node;
    } break;
}

#line 1867 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 163: {
        AST::PatternElementList *list = nullptr;
        if (sym(2).Elision)
            list = (new (pool) AST::PatternElementList(sym(2).Elision, nullptr))->finish();
        AST::ArrayPattern *node = new (pool) AST::ArrayPattern(list);
        node->lbracketToken = loc(1);
        node->rbracketToken = loc(3);
        sym(1).Node = node;
    } break;

#line 1880 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 164: {
        AST::ArrayPattern *node = new (pool) AST::ArrayPattern(sym(2).PatternElementList->finish());
        node->lbracketToken = loc(1);
        node->rbracketToken = loc(3);
        sym(1).Node = node;
    } break;

#line 1890 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 165: {
        auto *list = sym(2).PatternElementList;
        if (sym(4).Elision) {
            AST::PatternElementList *l = new (pool) AST::PatternElementList(sym(4).Elision, nullptr);
            list = list->append(l);
        }
        AST::ArrayPattern *node = new (pool) AST::ArrayPattern(list->finish());
        node->lbracketToken = loc(1);
        node->commaToken = loc(3);
        node->rbracketToken = loc(5);
        sym(1).Node = node;
        Q_ASSERT(node->isValidArrayLiteral());
    } break;

#line 1907 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 166: {
        AST::PatternElement *e = new (pool) AST::PatternElement(sym(1).Expression);
        sym(1).Node = new (pool) AST::PatternElementList(nullptr, e);
    } break;

#line 1915 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 167: {
        AST::PatternElement *e = new (pool) AST::PatternElement(sym(2).Expression);
        sym(1).Node = new (pool) AST::PatternElementList(sym(1).Elision->finish(), e);
    } break;

#line 1923 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 168: {
        AST::PatternElementList *node = new (pool) AST::PatternElementList(sym(1).Elision, sym(2).PatternElement);
        sym(1).Node = node;
    } break;

#line 1931 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 169: {
        AST::PatternElement *e = new (pool) AST::PatternElement(sym(4).Expression);
        AST::PatternElementList *node = new (pool) AST::PatternElementList(sym(3).Elision, e);
        sym(1).Node = sym(1).PatternElementList->append(node);
    } break;

#line 1940 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 170: {
        AST::PatternElementList *node = new (pool) AST::PatternElementList(sym(3).Elision, sym(4).PatternElement);
        sym(1).Node = sym(1).PatternElementList->append(node);
    } break;

#line 1948 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 171: {
        AST::Elision *node = new (pool) AST::Elision();
        node->commaToken = loc(1);
        sym(1).Node = node;
    } break;

#line 1957 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 172: {
        AST::Elision *node = new (pool) AST::Elision(sym(1).Elision);
        node->commaToken = loc(2);
        sym(1).Node = node;
    } break;

#line 1966 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 173: {
        sym(1).Node = nullptr;
    } break;

#line 1973 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 174: {
        sym(1).Node = sym(1).Elision->finish();
    } break;

#line 1980 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 175: {
        AST::PatternElement *node = new (pool) AST::PatternElement(sym(2).Expression, AST::PatternElement::SpreadElement);
        sym(1).Node = node;
    } break;

#line 1988 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 176: {
        AST::ObjectPattern *node = new (pool) AST::ObjectPattern();
        node->lbraceToken = loc(1);
        node->rbraceToken = loc(2);
        sym(1).Node = node;
    } break;

#line 1998 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 177: {
        AST::ObjectPattern *node = new (pool) AST::ObjectPattern(sym(2).PatternPropertyList->finish());
        node->lbraceToken = loc(1);
        node->rbraceToken = loc(3);
        sym(1).Node = node;
    } break;

#line 2008 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 178: {
        AST::ObjectPattern *node = new (pool) AST::ObjectPattern(sym(2).PatternPropertyList->finish());
        node->lbraceToken = loc(1);
        node->rbraceToken = loc(4);
        sym(1).Node = node;
    } break;

#line 2019 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"
  case 179: Q_FALLTHROUGH(); 
#line 2021 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 180: {
      sym(1).Node = new (pool) AST::PatternPropertyList(sym(1).PatternProperty);
    } break;

#line 2028 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"
  case 181: Q_FALLTHROUGH(); 
#line 2030 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 182: {
        AST::PatternPropertyList *node = new (pool) AST::PatternPropertyList(sym(1).PatternPropertyList, sym(3).PatternProperty);
        sym(1).Node = node;
    } break;

#line 2038 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 183: {
        AST::IdentifierPropertyName *name = new (pool) AST::IdentifierPropertyName(stringRef(1));
        name->propertyNameToken = loc(1);
        AST::IdentifierExpression *expr = new (pool) AST::IdentifierExpression(stringRef(1));
        expr->identifierToken = loc(1);
        AST::PatternProperty *node = new (pool) AST::PatternProperty(name, expr);
        node->colonToken = loc(2);
        sym(1).Node = node;
    } break;

#line 2054 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 185: {
        AST::IdentifierPropertyName *name = new (pool) AST::IdentifierPropertyName(stringRef(1));
        name->propertyNameToken = loc(1);
        AST::IdentifierExpression *left = new (pool) AST::IdentifierExpression(stringRef(1));
        left->identifierToken = loc(1);
        // if initializer is an anonymous function expression, we need to assign identifierref as it's name
        if (auto *f = asAnonymousFunctionDefinition(sym(2).Expression))
            f->name = stringRef(1);
        if (auto *c = asAnonymousClassDefinition(sym(2).Expression))
            c->name = stringRef(1);
        AST::BinaryExpression *assignment = new (pool) AST::BinaryExpression(left, QSOperator::Assign, sym(2).Expression);
        AST::PatternProperty *node = new (pool) AST::PatternProperty(name, assignment);
        node->colonToken = loc(1);
        sym(1).Node = node;

    } break;

#line 2074 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"
  case 186: Q_FALLTHROUGH(); 
#line 2076 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 187: {
        AST::PatternProperty *node = new (pool) AST::PatternProperty(sym(1).PropertyName, sym(3).Expression);
        if (auto *c = asAnonymousClassDefinition(sym(3).Expression)) {
            if (!AST::cast<AST::ComputedPropertyName *>(sym(1).PropertyName))
                c->name = driver->newStringRef(sym(1).PropertyName->asString());
        }
        node->colonToken = loc(2);
        sym(1).Node = node;
    } break;

#line 2094 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 191: {
        AST::IdentifierPropertyName *node = new (pool) AST::IdentifierPropertyName(stringRef(1));
        node->propertyNameToken = loc(1);
        sym(1).Node = node;
    } break;

#line 2103 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"
  case 192: Q_FALLTHROUGH(); 
#line 2105 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 193: {
        AST::StringLiteralPropertyName *node = new (pool) AST::StringLiteralPropertyName(stringRef(1));
        node->propertyNameToken = loc(1);
        sym(1).Node = node;
    } break;

#line 2114 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"
  case 194: Q_FALLTHROUGH(); 
#line 2116 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 195: {
        AST::NumericLiteralPropertyName *node = new (pool) AST::NumericLiteralPropertyName(sym(1).dval);
        node->propertyNameToken = loc(1);
        sym(1).Node = node;
    } break;

#line 2167 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 236: {
        AST::ComputedPropertyName *node = new (pool) AST::ComputedPropertyName(sym(2).Expression);
        node->propertyNameToken = loc(1);
        sym(1).Node = node;
    } break;

#line 2176 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"
  case 237: Q_FALLTHROUGH(); 
#line 2178 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

case 238: {
    sym(1) = sym(2);
} break;

#line 2186 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"
  case 239: Q_FALLTHROUGH(); 
#line 2188 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 240: {
        sym(1).Node = nullptr;
    } break;

#line 2198 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"
  case 243: Q_FALLTHROUGH(); 
#line 2201 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 244: {
        AST::TemplateLiteral *node = new (pool) AST::TemplateLiteral(stringRef(1), rawStringRef(1), nullptr);
        node->literalToken = loc(1);
        sym(1).Node = node;
    } break;

#line 2210 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"
  case 245: Q_FALLTHROUGH(); 
#line 2213 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 246: {
        AST::TemplateLiteral *node = new (pool) AST::TemplateLiteral(stringRef(1), rawStringRef(1), sym(2).Expression);
        node->next = sym(3).Template;
        node->literalToken = loc(1);
        sym(1).Node = node;
    } break;

#line 2226 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 248: {
        AST::SuperLiteral *node = new (pool) AST::SuperLiteral();
        node->superToken = loc(1);
        sym(1).Node = node;
    } break;

#line 2236 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"
  case 249: Q_FALLTHROUGH(); 
#line 2238 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 250: {
        AST::ArrayMemberExpression *node = new (pool) AST::ArrayMemberExpression(sym(1).Expression, sym(3).Expression);
        node->lbracketToken = loc(2);
        node->rbracketToken = loc(4);
        sym(1).Node = node;
    } break;

#line 2250 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"
  case 251:
    {
        AST::IdentifierExpression *node = new (pool) AST::IdentifierExpression(stringRef(1));
        node->identifierToken= loc(1);
        sym(1).Node = node;
    } Q_FALLTHROUGH();

#line 2258 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"
  case 252: Q_FALLTHROUGH(); 
#line 2260 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 253: {
        AST::FieldMemberExpression *node = new (pool) AST::FieldMemberExpression(sym(1).Expression, stringRef(3));
        node->dotToken = loc(2);
        node->identifierToken = loc(3);
        sym(1).Node = node;
    } break;

#line 2272 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 255: {
        AST::NewMemberExpression *node = new (pool) AST::NewMemberExpression(sym(2).Expression, sym(4).ArgumentList);
        node->newToken = loc(1);
        node->lparenToken = loc(3);
        node->rparenToken = loc(5);
        sym(1).Node = node;
    } break;

#line 2288 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 258: {
        AST::NewExpression *node = new (pool) AST::NewExpression(sym(2).Expression);
        node->newToken = loc(1);
        sym(1).Node = node;
    } break;

#line 2298 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"
  case 259: Q_FALLTHROUGH(); 
#line 2300 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 260: {
        AST::TaggedTemplate *node = new (pool) AST::TaggedTemplate(sym(1).Expression, sym(2).Template);
        sym(1).Node = node;
    } break;

#line 2308 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 261: {
        AST::CallExpression *node = new (pool) AST::CallExpression(sym(1).Expression, sym(3).ArgumentList);
        node->lparenToken = loc(2);
        node->rparenToken = loc(4);
        sym(1).Node = node;
    } break;

#line 2318 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"
  case 262: Q_FALLTHROUGH(); 
#line 2320 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 263: {
        AST::CallExpression *node = new (pool) AST::CallExpression(sym(1).Expression, sym(3).ArgumentList);
        node->lparenToken = loc(2);
        node->rparenToken = loc(4);
        sym(1).Node = node;
    } break;

#line 2330 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 264: {
        AST::ArrayMemberExpression *node = new (pool) AST::ArrayMemberExpression(sym(1).Expression, sym(3).Expression);
        node->lbracketToken = loc(2);
        node->rbracketToken = loc(4);
        sym(1).Node = node;
    } break;

#line 2340 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 265: {
        AST::FieldMemberExpression *node = new (pool) AST::FieldMemberExpression(sym(1).Expression, stringRef(3));
        node->dotToken = loc(2);
        node->identifierToken = loc(3);
        sym(1).Node = node;
    } break;

#line 2350 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 266: {
        sym(1).Node = nullptr;
    } break;

#line 2357 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"
  case 267: Q_FALLTHROUGH(); 
#line 2359 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 268: {
        sym(1).Node = sym(1).ArgumentList->finish();
    } break;

#line 2366 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 269: {
        sym(1).Node = new (pool) AST::ArgumentList(sym(1).Expression);
    } break;

#line 2373 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 270: {
        AST::ArgumentList *node = new (pool) AST::ArgumentList(sym(2).Expression);
        node->isSpreadElement = true;
        sym(1).Node = node;
    } break;

#line 2382 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 271: {
        AST::ArgumentList *node = new (pool) AST::ArgumentList(sym(1).ArgumentList, sym(3).Expression);
        node->commaToken = loc(2);
        sym(1).Node = node;
    } break;

#line 2391 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 272: {
        AST::ArgumentList *node = new (pool) AST::ArgumentList(sym(1).ArgumentList, sym(4).Expression);
        node->commaToken = loc(2);
        node->isSpreadElement = true;
        sym(1).Node = node;
    } break;

#line 2406 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 276: {
        AST::PostIncrementExpression *node = new (pool) AST::PostIncrementExpression(sym(1).Expression);
        node->incrementToken = loc(2);
        sym(1).Node = node;
    } break;

#line 2415 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 277: {
        AST::PostDecrementExpression *node = new (pool) AST::PostDecrementExpression(sym(1).Expression);
        node->decrementToken = loc(2);
        sym(1).Node = node;
    } break;

#line 2424 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 278: {
        AST::PreIncrementExpression *node = new (pool) AST::PreIncrementExpression(sym(2).Expression);
        node->incrementToken = loc(1);
        sym(1).Node = node;
    } break;

#line 2433 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 279: {
        AST::PreDecrementExpression *node = new (pool) AST::PreDecrementExpression(sym(2).Expression);
        node->decrementToken = loc(1);
        sym(1).Node = node;
    } break;

#line 2444 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 281: {
        AST::DeleteExpression *node = new (pool) AST::DeleteExpression(sym(2).Expression);
        node->deleteToken = loc(1);
        sym(1).Node = node;
    } break;

#line 2453 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 282: {
        AST::VoidExpression *node = new (pool) AST::VoidExpression(sym(2).Expression);
        node->voidToken = loc(1);
        sym(1).Node = node;
    } break;

#line 2462 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 283: {
        AST::TypeOfExpression *node = new (pool) AST::TypeOfExpression(sym(2).Expression);
        node->typeofToken = loc(1);
        sym(1).Node = node;
    } break;

#line 2471 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 284: {
        AST::UnaryPlusExpression *node = new (pool) AST::UnaryPlusExpression(sym(2).Expression);
        node->plusToken = loc(1);
        sym(1).Node = node;
    } break;

#line 2480 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 285: {
        AST::UnaryMinusExpression *node = new (pool) AST::UnaryMinusExpression(sym(2).Expression);
        node->minusToken = loc(1);
        sym(1).Node = node;
    } break;

#line 2489 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 286: {
        AST::TildeExpression *node = new (pool) AST::TildeExpression(sym(2).Expression);
        node->tildeToken = loc(1);
        sym(1).Node = node;
    } break;

#line 2498 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 287: {
        AST::NotExpression *node = new (pool) AST::NotExpression(sym(2).Expression);
        node->notToken = loc(1);
        sym(1).Node = node;
    } break;

#line 2509 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 289: {
        AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, QSOperator::Exp, sym(3).Expression);
        node->operatorToken = loc(2);
        sym(1).Node = node;
    } break;

#line 2520 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 291: {
        AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, sym(2).ival, sym(3).Expression);
        node->operatorToken = loc(2);
        sym(1).Node = node;
    } break;

#line 2529 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 292: {
        sym(1).ival = QSOperator::Mul;
    } break;

#line 2536 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 293: {
        sym(1).ival = QSOperator::Div;
    } break;

#line 2543 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 294: {
        sym(1).ival = QSOperator::Mod;
    } break;

#line 2552 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 296: {
        AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, QSOperator::Add, sym(3).Expression);
        node->operatorToken = loc(2);
        sym(1).Node = node;
    } break;

#line 2561 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 297: {
        AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, QSOperator::Sub, sym(3).Expression);
        node->operatorToken = loc(2);
        sym(1).Node = node;
    } break;

#line 2572 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 299: {
        AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, QSOperator::LShift, sym(3).Expression);
        node->operatorToken = loc(2);
        sym(1).Node = node;
    } break;

#line 2581 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 300: {
        AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, QSOperator::RShift, sym(3).Expression);
        node->operatorToken = loc(2);
        sym(1).Node = node;
    } break;

#line 2590 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 301: {
        AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, QSOperator::URShift, sym(3).Expression);
        node->operatorToken = loc(2);
        sym(1).Node = node;
    } break;

#line 2602 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"
  case 304: Q_FALLTHROUGH(); 
#line 2604 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 305: {
        AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, sym(2).ival, sym(3).Expression);
        node->operatorToken = loc(2);
        sym(1).Node = node;
    } break;

#line 2613 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 306: {
        sym(1).ival = QSOperator::Lt;
    } break;

#line 2619 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 307: {
        sym(1).ival = QSOperator::Gt;
    } break;

#line 2625 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 308: {
        sym(1).ival = QSOperator::Le;
    } break;

#line 2631 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 309: {
        sym(1).ival = QSOperator::Ge;
    } break;

#line 2637 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 310: {
        sym(1).ival = QSOperator::InstanceOf;
    } break;

#line 2644 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 311: {
        AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, QSOperator::In, sym(3).Expression);
        node->operatorToken = loc(2);
        sym(1).Node = node;
    } break;

#line 2653 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"
  case 312: Q_FALLTHROUGH(); 
#line 2655 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 313: {
        AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, QSOperator::As, sym(3).Expression);
        node->operatorToken = loc(2);
        sym(1).Node = node;
    } break;

#line 2670 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"
  case 318: Q_FALLTHROUGH(); 
#line 2672 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 319: {
        AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, sym(2).ival, sym(3).Expression);
        node->operatorToken = loc(2);
        sym(1).Node = node;
    } break;

#line 2681 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 320: {
        sym(1).ival = QSOperator::Equal;
    } break;

#line 2687 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 321: {
        sym(1).ival = QSOperator::NotEqual;
    } break;

#line 2693 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 322: {
        sym(1).ival = QSOperator::StrictEqual;
    } break;

#line 2699 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 323: {
        sym(1).ival = QSOperator::StrictNotEqual;
    } break;

#line 2710 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"
  case 326: Q_FALLTHROUGH(); 
#line 2712 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 327: {
        AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, QSOperator::BitAnd, sym(3).Expression);
        node->operatorToken = loc(2);
        sym(1).Node = node;
    } break;

#line 2725 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"
  case 330: Q_FALLTHROUGH(); 
#line 2727 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 331: {
        AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, QSOperator::BitXor, sym(3).Expression);
        node->operatorToken = loc(2);
        sym(1).Node = node;
    } break;

#line 2739 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"
  case 334: Q_FALLTHROUGH(); 
#line 2741 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 335: {
        AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, QSOperator::BitOr, sym(3).Expression);
        node->operatorToken = loc(2);
        sym(1).Node = node;
    } break;

#line 2753 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"
  case 338: Q_FALLTHROUGH(); 
#line 2755 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 339: {
        AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, QSOperator::And, sym(3).Expression);
        node->operatorToken = loc(2);
        sym(1).Node = node;
    } break;

#line 2767 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"
  case 342: Q_FALLTHROUGH(); 
#line 2769 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 343: {
        AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, QSOperator::Or, sym(3).Expression);
        node->operatorToken = loc(2);
        sym(1).Node = node;
    } break;

#line 2781 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"
  case 346: Q_FALLTHROUGH(); 
#line 2783 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 347: {

        auto *lhs = sym(1).Expression;
        auto *rhs = sym(3).Expression;

        // Check if lhs or rhs contain || or &&

        if (lhs->binaryExpressionCast() != nullptr) {
            auto *binaryExpr = lhs->binaryExpressionCast();
            if (binaryExpr->op == QSOperator::And || binaryExpr->op == QSOperator::Or) {
                syntaxError(binaryExpr->operatorToken, "Left-hand side may not contain || or &&");
                return false;
            }
        }

        if (rhs->binaryExpressionCast() != nullptr) {
            auto *binaryExpr = rhs->binaryExpressionCast();
            if (binaryExpr->op == QSOperator::And || binaryExpr->op == QSOperator::Or) {
                syntaxError(binaryExpr->operatorToken, "Right-hand side may not contain || or &&");
                return false;
            }
        }

        AST::BinaryExpression *node = new (pool) AST::BinaryExpression(lhs, QSOperator::Coalesce, rhs);
        node->operatorToken = loc(2);
        sym(1).Node = node;
    } break;

#line 2817 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"
  case 350: Q_FALLTHROUGH(); 
#line 2819 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 351: {
        AST::ConditionalExpression *node = new (pool) AST::ConditionalExpression(sym(1).Expression, sym(3).Expression, sym(5).Expression);
        node->questionToken = loc(2);
        node->colonToken = loc(4);
        sym(1).Node = node;
    } break;

#line 2838 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"
  case 358: Q_FALLTHROUGH(); 
#line 2840 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 359: {
        // need to convert the LHS to an AssignmentPattern if it was an Array/ObjectLiteral
        if (AST::Pattern *p = sym(1).Expression->patternCast()) {
            SourceLocation errorLoc;
            QString errorMsg;
            if (!p->convertLiteralToAssignmentPattern(pool, &errorLoc, &errorMsg)) {
                syntaxError(errorLoc, errorMsg);
                return false;
            }
        }
        // if lhs is an identifier expression and rhs is an anonymous function expression, we need to assign the name of lhs to the function
        if (auto *f = asAnonymousFunctionDefinition(sym(3).Expression)) {
            if (auto *id = AST::cast<AST::IdentifierExpression *>(sym(1).Expression))
                f->name = id->name;
        }
        if (auto *c = asAnonymousClassDefinition(sym(3).Expression)) {
            if (auto *id = AST::cast<AST::IdentifierExpression *>(sym(1).Expression))
                c->name = id->name;
        }

        AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, QSOperator::Assign, sym(3).Expression);
        node->operatorToken = loc(2);
        sym(1).Node = node;
    } break;

#line 2868 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"
  case 360: Q_FALLTHROUGH(); 
#line 2870 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 361: {
        AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, sym(2).ival, sym(3).Expression);
        node->operatorToken = loc(2);
        sym(1).Node = node;
    } break;

#line 2879 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 362: {
        sym(1).ival = QSOperator::InplaceMul;
    } break;

#line 2886 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 363: {
        sym(1).ival = QSOperator::InplaceExp;
    } break;

#line 2893 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 364: {
        sym(1).ival = QSOperator::InplaceDiv;
    } break;

#line 2900 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 365: {
        sym(1).ival = QSOperator::InplaceMod;
    } break;

#line 2907 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 366: {
        sym(1).ival = QSOperator::InplaceAdd;
    } break;

#line 2914 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 367: {
        sym(1).ival = QSOperator::InplaceSub;
    } break;

#line 2921 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 368: {
        sym(1).ival = QSOperator::InplaceLeftShift;
    } break;

#line 2928 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 369: {
        sym(1).ival = QSOperator::InplaceRightShift;
    } break;

#line 2935 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 370: {
        sym(1).ival = QSOperator::InplaceURightShift;
    } break;

#line 2942 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 371: {
        sym(1).ival = QSOperator::InplaceAnd;
    } break;

#line 2949 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 372: {
        sym(1).ival = QSOperator::InplaceXor;
    } break;

#line 2956 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 373: {
        sym(1).ival = QSOperator::InplaceOr;
    } break;

#line 2966 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"
  case 376: Q_FALLTHROUGH(); 
#line 2968 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 377: {
          AST::Expression *node = new (pool) AST::Expression(sym(1).Expression, sym(3).Expression);
          node->commaToken = loc(2);
          sym(1).Node = node;
    } break;

#line 2977 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"
  case 378: Q_FALLTHROUGH(); 
#line 2979 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 379: {
      sym(1).Node = nullptr;
    } break;

#line 2991 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 382: {
        sym(1).Node = sym(3).Node;
    } break;

#line 2998 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"
  case 383: Q_FALLTHROUGH(); 
#line 3000 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"
  case 384: Q_FALLTHROUGH(); 
#line 3002 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"
  case 385: Q_FALLTHROUGH(); 
#line 3004 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"
  case 386: Q_FALLTHROUGH(); 
#line 3006 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"
  case 387: Q_FALLTHROUGH(); 
#line 3008 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"
  case 388: Q_FALLTHROUGH(); 
#line 3010 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"
  case 389: Q_FALLTHROUGH(); 
#line 3012 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"
  case 390: Q_FALLTHROUGH(); 
#line 3014 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"
  case 391: Q_FALLTHROUGH(); 
#line 3016 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"
  case 392: Q_FALLTHROUGH(); 
#line 3018 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"
  case 393: Q_FALLTHROUGH(); 
#line 3020 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"
  case 394: Q_FALLTHROUGH(); 
#line 3022 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 395: {
        sym(1).Node = sym(2).Node;
    } break;

#line 3044 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 406: {
        AST::Block *node = new (pool) AST::Block(sym(2).StatementList);
        node->lbraceToken = loc(1);
        node->rbraceToken = loc(3);
        sym(1).Node = node;
    } break;

#line 3056 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 408: {
        sym(1).StatementList = sym(1).StatementList->append(sym(2).StatementList);
    } break;

#line 3063 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 409: {
        sym(1).StatementList = new (pool) AST::StatementList(sym(1).Statement);
    } break;

#line 3070 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 410: {
        sym(1).Node = new (pool) AST::StatementList(sym(3).FunctionDeclaration);
    } break;

#line 3077 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 411: {
        sym(1).Node = nullptr;
    } break;

#line 3084 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 412: {
        sym(1).Node = sym(1).StatementList->finish();
    } break;

#line 3091 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 413: {
        sym(1).scope = AST::VariableScope::Let;
    } break;

#line 3097 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 414: {
        sym(1).scope = AST::VariableScope::Const;
    } break;

#line 3104 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 415: {
        sym(1).scope = AST::VariableScope::Var;
    } break;

#line 3111 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"
  case 416: Q_FALLTHROUGH(); 
#line 3113 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"
  case 417: Q_FALLTHROUGH(); 
#line 3115 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"
  case 418: Q_FALLTHROUGH(); 
#line 3117 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 419: {
        AST::VariableDeclarationList *declarations = sym(2).VariableDeclarationList->finish(sym(1).scope);
        for (auto it = declarations; it; it = it->next) {
            if (it->declaration && it->declaration->typeAnnotation) {
                syntaxError(it->declaration->typeAnnotation->firstSourceLocation(), "Type annotations are not permitted in variable declarations");
                return false;
            }
        }
        AST::VariableStatement *node = new (pool) AST::VariableStatement(declarations);
        node->declarationKindToken = loc(1);
        sym(1).Node = node;
    } break;

#line 3135 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"
  case 421: Q_FALLTHROUGH(); 
#line 3137 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"
  case 422: Q_FALLTHROUGH(); 
#line 3139 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"
  case 423: Q_FALLTHROUGH(); 
#line 3141 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 424: {
  sym(1).Node = new (pool) AST::VariableDeclarationList(sym(1).PatternElement);
    } break;

#line 3148 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"
  case 425: Q_FALLTHROUGH(); 
#line 3150 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"
  case 426: Q_FALLTHROUGH(); 
#line 3152 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"
  case 427: Q_FALLTHROUGH(); 
#line 3154 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 428: {
        AST::VariableDeclarationList *node = new (pool) AST::VariableDeclarationList(sym(1).VariableDeclarationList, sym(3).PatternElement);
        node->commaToken = loc(2);
        sym(1).Node = node;
    } break;

#line 3163 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"
  case 429: Q_FALLTHROUGH(); 
#line 3165 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"
  case 430: Q_FALLTHROUGH(); 
#line 3167 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"
  case 431: Q_FALLTHROUGH(); 
#line 3169 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 432: {
        auto *node = new (pool) AST::PatternElement(stringRef(1), sym(2).TypeAnnotation, sym(3).Expression);
        node->identifierToken = loc(1);
        sym(1).Node = node;
        // if initializer is an anonymous function expression, we need to assign identifierref as it's name
        if (auto *f = asAnonymousFunctionDefinition(sym(3).Expression))
            f->name = stringRef(1);
        if (auto *c = asAnonymousClassDefinition(sym(3).Expression))
            c->name = stringRef(1);
    } break;

#line 3183 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"
  case 433: Q_FALLTHROUGH(); 
#line 3185 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"
  case 434: Q_FALLTHROUGH(); 
#line 3187 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"
  case 435: Q_FALLTHROUGH(); 
#line 3189 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 436: {
        auto *node = new (pool) AST::PatternElement(sym(1).Pattern, sym(2).Expression);
        node->identifierToken = loc(1);
        sym(1).Node = node;
    } break;

#line 3198 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 437: {
        auto *node = new (pool) AST::ObjectPattern(sym(2).PatternPropertyList);
        node->lbraceToken = loc(1);
        node->rbraceToken = loc(3);
        node->parseMode = AST::Pattern::Binding;
        sym(1).Node = node;
    } break;

#line 3209 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 438: {
        auto *node = new (pool) AST::ArrayPattern(sym(2).PatternElementList);
        node->lbracketToken = loc(1);
        node->rbracketToken = loc(3);
        node->parseMode = AST::Pattern::Binding;
        sym(1).Node = node;
    } break;

#line 3220 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 439: {
        sym(1).Node = nullptr;
    } break;

#line 3227 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"
 case 440: 
#line 3229 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 441: {
        sym(1).Node = sym(1).PatternPropertyList->finish();
    } break;

#line 3236 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 442: {
        if (sym(1).Elision || sym(2).Node) {
            auto *l = new (pool) AST::PatternElementList(sym(1).Elision, sym(2).PatternElement);
            sym(1).Node = l->finish();
        } else {
            sym(1).Node = nullptr;
        }
    } break;

#line 3248 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 443: {
        sym(1).Node = sym(1).PatternElementList->finish();
    } break;

#line 3255 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 444: {
        if (sym(3).Elision || sym(4).Node) {
            auto *l = new (pool) AST::PatternElementList(sym(3).Elision, sym(4).PatternElement);
            l = sym(1).PatternElementList->append(l);
            sym(1).Node = l;
        }
        sym(1).Node = sym(1).PatternElementList->finish();
    } break;

#line 3267 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 445: {
        sym(1).Node = new (pool) AST::PatternPropertyList(sym(1).PatternProperty);
    } break;

#line 3274 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 446: {
        sym(1).Node = new (pool) AST::PatternPropertyList(sym(1).PatternPropertyList, sym(3).PatternProperty);
    } break;

#line 3283 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 448: {
        sym(1).PatternElementList = sym(1).PatternElementList->append(sym(3).PatternElementList);
    } break;

#line 3290 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 449: {
        sym(1).Node = new (pool) AST::PatternElementList(sym(1).Elision, sym(2).PatternElement);
    } break;

#line 3298 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 450: {
        AST::StringLiteralPropertyName *name = new (pool) AST::StringLiteralPropertyName(stringRef(1));
        name->propertyNameToken = loc(1);
        // if initializer is an anonymous function expression, we need to assign identifierref as it's name
        if (auto *f = asAnonymousFunctionDefinition(sym(2).Expression))
            f->name = stringRef(1);
        if (auto *c = asAnonymousClassDefinition(sym(2).Expression))
            c->name = stringRef(1);
        sym(1).Node = new (pool) AST::PatternProperty(name, stringRef(1), sym(2).Expression);
    } break;

#line 3312 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 451: {
        AST::PatternProperty *node = new (pool) AST::PatternProperty(sym(1).PropertyName, stringRef(3), sym(4).Expression);
        sym(1).Node = node;
    } break;

#line 3320 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 452: {
        AST::PatternProperty *node = new (pool) AST::PatternProperty(sym(1).PropertyName, sym(3).Pattern, sym(4).Expression);
        sym(1).Node = node;
    } break;

#line 3328 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 453: {
      AST::PatternElement *node = new (pool) AST::PatternElement(stringRef(1), sym(2).TypeAnnotation, sym(3).Expression);
      node->identifierToken = loc(1);
      // if initializer is an anonymous function expression, we need to assign identifierref as it's name
      if (auto *f = asAnonymousFunctionDefinition(sym(3).Expression))
          f->name = stringRef(1);
      if (auto *c = asAnonymousClassDefinition(sym(3).Expression))
          c->name = stringRef(1);
      sym(1).Node = node;
    } break;

#line 3342 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 454: {
        AST::PatternElement *node = new (pool) AST::PatternElement(sym(1).Pattern, sym(2).Expression);
        sym(1).Node = node;
    } break;

#line 3350 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 455: {
        AST::PatternElement *node = new (pool) AST::PatternElement(stringRef(2), /*type annotation*/nullptr, nullptr, AST::PatternElement::RestElement);
        node->identifierToken = loc(2);
        sym(1).Node = node;
    } break;

#line 3359 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 456: {
        AST::PatternElement *node = new (pool) AST::PatternElement(sym(2).Pattern, nullptr, AST::PatternElement::RestElement);
        sym(1).Node = node;
    } break;

#line 3367 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 457: {
        sym(1).Node = nullptr;
    } break;

#line 3377 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 459: {
        AST::EmptyStatement *node = new (pool) AST::EmptyStatement();
        node->semicolonToken = loc(1);
        sym(1).Node = node;
    } break;

#line 3392 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 460: {
        int token = lookaheadToken(lexer);
        if (token == T_LBRACE)
            pushToken(T_FORCE_BLOCK);
        else if (token == T_FUNCTION || token == T_FUNCTION_STAR || token == T_CLASS || token == T_LET || token == T_CONST)
            pushToken(T_FORCE_DECLARATION);
    } break;

#line 3403 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 461: {
        AST::ExpressionStatement *node = new (pool) AST::ExpressionStatement(sym(1).Expression);
        node->semicolonToken = loc(2);
        sym(1).Node = node;
    } break;

#line 3412 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 462: {
        AST::IfStatement *node = new (pool) AST::IfStatement(sym(3).Expression, sym(5).Statement, sym(7).Statement);
        node->ifToken = loc(1);
        node->lparenToken = loc(2);
        node->rparenToken = loc(4);
        node->elseToken = loc(6);
        sym(1).Node = node;
    } break;

#line 3424 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 463: {
        AST::IfStatement *node = new (pool) AST::IfStatement(sym(3).Expression, sym(5).Statement);
        node->ifToken = loc(1);
        node->lparenToken = loc(2);
        node->rparenToken = loc(4);
        sym(1).Node = node;
    } break;

#line 3437 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 465: {
        AST::DoWhileStatement *node = new (pool) AST::DoWhileStatement(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;

#line 3450 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 466: {
        AST::WhileStatement *node = new (pool) AST::WhileStatement(sym(3).Expression, sym(5).Statement);
        node->whileToken = loc(1);
        node->lparenToken = loc(2);
        node->rparenToken = loc(4);
        sym(1).Node = node;
    } break;

#line 3461 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 467: {
        AST::ForStatement *node = new (pool) AST::ForStatement(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;

#line 3474 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"
  case 468: Q_FALLTHROUGH(); 
#line 3476 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 469: {
        // ### get rid of the static_cast!
        AST::ForStatement *node = new (pool) AST::ForStatement(
          static_cast<AST::VariableStatement *>(sym(3).Node)->declarations, 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;

#line 3492 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 470: {
        sym(1).forEachType = AST::ForEachType::In;
    } break;

#line 3499 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 471: {
        sym(1).forEachType = AST::ForEachType::Of;
    } break;

#line 3506 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 472: {
        // need to convert the LHS to an AssignmentPattern if it was an Array/ObjectLiteral
        if (AST::Pattern *p = sym(3).Expression->patternCast()) {
            SourceLocation errorLoc;
            QString errorMsg;
            if (!p->convertLiteralToAssignmentPattern(pool, &errorLoc, &errorMsg)) {
                syntaxError(errorLoc, errorMsg);
                return false;
            }
        }
        AST::ForEachStatement *node = new (pool) AST::ForEachStatement(sym(3).Expression, sym(5).Expression, sym(7).Statement);
        node->forToken = loc(1);
        node->lparenToken = loc(2);
        node->inOfToken = loc(4);
        node->rparenToken = loc(6);
        node->type = sym(4).forEachType;
        sym(1).Node = node;
    } break;

#line 3528 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 473: {
        AST::ForEachStatement *node = new (pool) AST::ForEachStatement(sym(3).PatternElement, sym(5).Expression, sym(7).Statement);
        node->forToken = loc(1);
        node->lparenToken = loc(2);
        node->inOfToken = loc(4);
        node->rparenToken = loc(6);
        node->type = sym(4).forEachType;
        sym(1).Node = node;
    } break;

#line 3541 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"
  case 474: Q_FALLTHROUGH(); 
#line 3543 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 475: {
        if (auto typeAnnotation = sym(3).TypeAnnotation) {
            syntaxError(typeAnnotation->firstSourceLocation(), "Type annotations are not permitted in variable declarations");
            return false;
        }
        auto *node = new (pool) AST::PatternElement(stringRef(2), sym(3).TypeAnnotation, nullptr);
        node->identifierToken = loc(2);
        node->scope = sym(1).scope;
        node->isForDeclaration = true;
        sym(1).Node = node;
    } break;

#line 3558 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"
  case 476: Q_FALLTHROUGH(); 
#line 3560 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 477: {
        auto *node = new (pool) AST::PatternElement(sym(2).Pattern, nullptr);
        node->scope = sym(1).scope;
        node->isForDeclaration = true;
        sym(1).Node = node;
    } break;

#line 3570 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 478: {
        AST::ContinueStatement *node = new (pool) AST::ContinueStatement();
        node->continueToken = loc(1);
        node->semicolonToken = loc(2);
        sym(1).Node = node;
    } break;

#line 3580 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 479: {
        AST::ContinueStatement *node = new (pool) AST::ContinueStatement(stringRef(2));
        node->continueToken = loc(1);
        node->identifierToken = loc(2);
        node->semicolonToken = loc(3);
        sym(1).Node = node;
    } break;

#line 3591 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 480: {
        AST::BreakStatement *node = new (pool) AST::BreakStatement(QStringRef());
        node->breakToken = loc(1);
        node->semicolonToken = loc(2);
        sym(1).Node = node;
    } break;

#line 3601 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 481: {
        AST::BreakStatement *node = new (pool) AST::BreakStatement(stringRef(2));
        node->breakToken = loc(1);
        node->identifierToken = loc(2);
        node->semicolonToken = loc(3);
        sym(1).Node = node;
    } break;

#line 3612 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 482: {
        if (!functionNestingLevel) {
            syntaxError(loc(1), "Return statement not allowed outside of Function declaration.");
            return false;
        }
        AST::ReturnStatement *node = new (pool) AST::ReturnStatement(sym(2).Expression);
        node->returnToken = loc(1);
        node->semicolonToken = loc(3);
        sym(1).Node = node;
    } break;

#line 3626 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 483: {
        AST::WithStatement *node = new (pool) AST::WithStatement(sym(3).Expression, sym(5).Statement);
        node->withToken = loc(1);
        node->lparenToken = loc(2);
        node->rparenToken = loc(4);
        sym(1).Node = node;
    } break;

#line 3637 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 484: {
        AST::SwitchStatement *node = new (pool) AST::SwitchStatement(sym(3).Expression, sym(5).CaseBlock);
        node->switchToken = loc(1);
        node->lparenToken = loc(2);
        node->rparenToken = loc(4);
        sym(1).Node = node;
    } break;

#line 3648 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 485: {
        AST::CaseBlock *node = new (pool) AST::CaseBlock(sym(2).CaseClauses);
        node->lbraceToken = loc(1);
        node->rbraceToken = loc(3);
        sym(1).Node = node;
    } break;

#line 3658 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 486: {
        AST::CaseBlock *node = new (pool) AST::CaseBlock(sym(2).CaseClauses, sym(3).DefaultClause, sym(4).CaseClauses);
        node->lbraceToken = loc(1);
        node->rbraceToken = loc(5);
        sym(1).Node = node;
    } break;

#line 3668 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 487: {
        sym(1).Node = new (pool) AST::CaseClauses(sym(1).CaseClause);
    } break;

#line 3675 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 488: {
        sym(1).Node = new (pool) AST::CaseClauses(sym(1).CaseClauses, sym(2).CaseClause);
    } break;

#line 3682 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 489: {
        sym(1).Node = nullptr;
    } break;

#line 3689 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 490: {
        sym(1).Node = sym(1).CaseClauses->finish();
    } break;

#line 3696 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 491: {
        AST::CaseClause *node = new (pool) AST::CaseClause(sym(2).Expression, sym(4).StatementList);
        node->caseToken = loc(1);
        node->colonToken = loc(3);
        sym(1).Node = node;
    } break;

#line 3706 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 492: {
        AST::DefaultClause *node = new (pool) AST::DefaultClause(sym(3).StatementList);
        node->defaultToken = loc(1);
        node->colonToken = loc(2);
        sym(1).Node = node;
    } break;

#line 3716 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 493: {
        AST::LabelledStatement *node = new (pool) AST::LabelledStatement(stringRef(1), sym(3).Statement);
        node->identifierToken = loc(1);
        node->colonToken = loc(2);
        sym(1).Node = node;
    } break;

#line 3728 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 495: {
        syntaxError(loc(3), "FunctionDeclarations are not allowed after a label.");
        return false;
    } break;

#line 3736 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 496: {
        AST::ThrowStatement *node = new (pool) AST::ThrowStatement(sym(2).Expression);
        node->throwToken = loc(1);
        node->semicolonToken = loc(3);
        sym(1).Node = node;
    } break;

#line 3746 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 497: {
        AST::TryStatement *node = new (pool) AST::TryStatement(sym(2).Statement, sym(3).Catch);
        node->tryToken = loc(1);
        sym(1).Node = node;
    } break;

#line 3755 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 498: {
        AST::TryStatement *node = new (pool) AST::TryStatement(sym(2).Statement, sym(3).Finally);
        node->tryToken = loc(1);
        sym(1).Node = node;
    } break;

#line 3764 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 499: {
        AST::TryStatement *node = new (pool) AST::TryStatement(sym(2).Statement, sym(3).Catch, sym(4).Finally);
        node->tryToken = loc(1);
        sym(1).Node = node;
    } break;

#line 3773 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 500: {
        AST::Catch *node = new (pool) AST::Catch(sym(3).PatternElement, sym(5).Block);
        node->catchToken = loc(1);
        node->lparenToken = loc(2);
        node->identifierToken = loc(3);
        node->rparenToken = loc(4);
        sym(1).Node = node;
    } break;

#line 3785 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 501: {
        AST::Finally *node = new (pool) AST::Finally(sym(2).Block);
        node->finallyToken = loc(1);
        sym(1).Node = node;
    } break;

#line 3794 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 502: {
        AST::PatternElement *node = new (pool) AST::PatternElement(stringRef(1));
        node->identifierToken = loc(1);
        node->scope = AST::VariableScope::Let;
        sym(1).Node = node;
    } break;

#line 3804 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 503: {
        AST::PatternElement *node = new (pool) AST::PatternElement(sym(1).Pattern);
        node->scope = AST::VariableScope::Let;
        sym(1).Node = node;
    } break;

#line 3813 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 504: {
        AST::DebuggerStatement *node = new (pool) AST::DebuggerStatement();
        node->debuggerToken = loc(1);
        node->semicolonToken = loc(2);
        sym(1).Node = node;
    } break;

#line 3830 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 506: {
        if (!ensureNoFunctionTypeAnnotations(sym(6).TypeAnnotation, sym(4).FormalParameterList))
            return false;
        AST::FunctionDeclaration *node = new (pool) AST::FunctionDeclaration(stringRef(2), sym(4).FormalParameterList, sym(8).StatementList,
                                                                             /*type annotation*/nullptr);
        node->functionToken = loc(1);
        node->identifierToken = loc(2);
        node->lparenToken = loc(3);
        node->rparenToken = loc(5);
        node->lbraceToken = loc(7);
        node->rbraceToken = loc(9);
        sym(1).Node = node;
    } break;

#line 3847 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 507: {
        AST::FunctionDeclaration *node = new (pool) AST::FunctionDeclaration(stringRef(2), sym(4).FormalParameterList, sym(8).StatementList,
                                                                             sym(6).TypeAnnotation);
        node->functionToken = loc(1);
        node->identifierToken = loc(2);
        node->lparenToken = loc(3);
        node->rparenToken = loc(5);
        node->lbraceToken = loc(7);
        node->rbraceToken = loc(9);
        sym(1).Node = node;
    } break;

#line 3863 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 509: {
        if (!ensureNoFunctionTypeAnnotations(sym(5).TypeAnnotation, sym(3).FormalParameterList))
            return false;
        AST::FunctionDeclaration *node = new (pool) AST::FunctionDeclaration(QStringRef(), sym(3).FormalParameterList, sym(7).StatementList,
                                                                             /*type annotation*/nullptr);
        node->functionToken = loc(1);
        node->lparenToken = loc(2);
        node->rparenToken = loc(4);
        node->lbraceToken = loc(6);
        node->rbraceToken = loc(8);
        sym(1).Node = node;
    } break;

#line 3879 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 510: {
        if (!ensureNoFunctionTypeAnnotations(sym(6).TypeAnnotation, sym(4).FormalParameterList))
            return false;
        AST::FunctionExpression *node = new (pool) AST::FunctionExpression(stringRef(2), sym(4).FormalParameterList, sym(8).StatementList,
                                                                           /*type annotation*/nullptr);
        node->functionToken = loc(1);
        if (! stringRef(2).isNull())
          node->identifierToken = loc(2);
        node->lparenToken = loc(3);
        node->rparenToken = loc(5);
        node->lbraceToken = loc(7);
        node->rbraceToken = loc(9);
        sym(1).Node = node;
    } break;

#line 3897 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 511: {
        if (!ensureNoFunctionTypeAnnotations(sym(5).TypeAnnotation, sym(3).FormalParameterList))
            return false;
        AST::FunctionExpression *node = new (pool) AST::FunctionExpression(QStringRef(), sym(3).FormalParameterList, sym(7).StatementList,
                                                                           /*type annotation*/nullptr);
        node->functionToken = loc(1);
        node->lparenToken = loc(2);
        node->rparenToken = loc(4);
        node->lbraceToken = loc(6);
        node->rbraceToken = loc(8);
        sym(1).Node = node;
    } break;

#line 3915 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 513: {
        sym(1).Node = nullptr;
    } break;

#line 3922 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 514: {
        AST::FormalParameterList *node = (new (pool) AST::FormalParameterList(nullptr, sym(1).PatternElement))->finish(pool);
        sym(1).Node = node;
    } break;

#line 3930 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"
 case 515: 
#line 3932 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 516: {
        sym(1).Node = sym(1).FormalParameterList->finish(pool);
    } break;

#line 3939 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 517: {
        AST::FormalParameterList *node = (new (pool) AST::FormalParameterList(sym(1).FormalParameterList, sym(3).PatternElement))->finish(pool);
        sym(1).Node = node;
    } break;

#line 3947 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 518: {
        AST::FormalParameterList *node = new (pool) AST::FormalParameterList(nullptr, sym(1).PatternElement);
        sym(1).Node = node;
    } break;

#line 3956 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 519: {
        AST::FormalParameterList *node = new (pool) AST::FormalParameterList(sym(1).FormalParameterList, sym(3).PatternElement);
        sym(1).Node = node;
    } break;

#line 3966 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 521: {
        ++functionNestingLevel;
    } break;

#line 3973 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 522: {
        --functionNestingLevel;
    } break;

#line 3983 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"
  case 524: Q_FALLTHROUGH(); 
#line 3985 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 525: {
        AST::ReturnStatement *ret = new (pool) AST::ReturnStatement(sym(4).Expression);
        ret->returnToken = sym(4).Node->firstSourceLocation();
        ret->semicolonToken = sym(4).Node->lastSourceLocation();
        AST::StatementList *statements = (new (pool) AST::StatementList(ret))->finish();
        AST::FunctionExpression *f = new (pool) AST::FunctionExpression(QStringRef(), sym(1).FormalParameterList, statements);
        f->isArrowFunction = true;
        f->functionToken = sym(1).Node ? sym(1).Node->firstSourceLocation() : loc(1);
        f->lbraceToken = sym(4).Node->firstSourceLocation();
        f->rbraceToken = sym(4).Node->lastSourceLocation();
        sym(1).Node = f;
    } break;

#line 4001 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"
  case 526: Q_FALLTHROUGH(); 
#line 4003 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 527: {
        AST::FunctionExpression *f = new (pool) AST::FunctionExpression(QStringRef(), sym(1).FormalParameterList, sym(6).StatementList);
        f->isArrowFunction = true;
        f->functionToken = sym(1).Node ? sym(1).Node->firstSourceLocation() : loc(1);
        f->lbraceToken = loc(6);
        f->rbraceToken = loc(7);
        sym(1).Node = f;
    } break;

#line 4015 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 528: {
        AST::PatternElement *e = new (pool) AST::PatternElement(stringRef(1), /*type annotation*/nullptr, nullptr, AST::PatternElement::Binding);
        e->identifierToken = loc(1);
        sym(1).FormalParameterList = (new (pool) AST::FormalParameterList(nullptr, e))->finish(pool);
    } break;

#line 4026 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 529: {
        if (coverExpressionType != CE_FormalParameterList) {
            AST::NestedExpression *ne = static_cast<AST::NestedExpression *>(sym(1).Node);
            AST::FormalParameterList *list = ne->expression->reparseAsFormalParameterList(pool);
            if (!list) {
                syntaxError(loc(1), "Invalid Arrow parameter list.");
                return false;
            }
            sym(1).Node = list->finish(pool);
        }
    } break;

#line 4044 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 530: {
        if (lookaheadToken(lexer) == T_LBRACE)
            pushToken(T_FORCE_BLOCK);
    } break;

#line 4052 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 531: {
        if (!ensureNoFunctionTypeAnnotations(sym(5).TypeAnnotation, sym(3).FormalParameterList))
            return false;
        AST::FunctionExpression *f = new (pool) AST::FunctionExpression(stringRef(1), sym(3).FormalParameterList, sym(7).StatementList);
        f->functionToken = sym(1).PropertyName->firstSourceLocation();
        f->lparenToken = loc(2);
        f->rparenToken = loc(4);
        f->lbraceToken = loc(6);
        f->rbraceToken = loc(8);
        AST::PatternProperty *node = new (pool) AST::PatternProperty(sym(1).PropertyName, f, AST::PatternProperty::Method);
        node->colonToken = loc(2);
        sym(1).Node = node;
    } break;

#line 4069 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 532: {
        if (!ensureNoFunctionTypeAnnotations(sym(6).TypeAnnotation, sym(4).FormalParameterList))
            return false;
        AST::FunctionExpression *f = new (pool) AST::FunctionExpression(stringRef(2), sym(4).FormalParameterList, sym(8).StatementList);
        f->functionToken = sym(2).PropertyName->firstSourceLocation();
        f->lparenToken = loc(3);
        f->rparenToken = loc(5);
        f->lbraceToken = loc(7);
        f->rbraceToken = loc(9);
        f->isGenerator = true;
        AST::PatternProperty *node = new (pool) AST::PatternProperty(sym(2).PropertyName, f, AST::PatternProperty::Method);
        node->colonToken = loc(2);
        sym(1).Node = node;
    } break;

#line 4088 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 533: {
        if (!ensureNoFunctionTypeAnnotations(sym(5).TypeAnnotation, /*formals*/nullptr))
            return false;
        AST::FunctionExpression *f = new (pool) AST::FunctionExpression(stringRef(2), nullptr, sym(7).StatementList);
        f->functionToken = sym(2).PropertyName->firstSourceLocation();
        f->lparenToken = loc(3);
        f->rparenToken = loc(4);
        f->lbraceToken = loc(6);
        f->rbraceToken = loc(8);
        AST::PatternProperty *node = new (pool) AST::PatternProperty(sym(2).PropertyName, f, AST::PatternProperty::Getter);
        node->colonToken = loc(2);
        sym(1).Node = node;
    } break;

#line 4105 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 534: {
        if (!ensureNoFunctionTypeAnnotations(sym(6).TypeAnnotation, sym(4).FormalParameterList))
            return false;
        AST::FunctionExpression *f = new (pool) AST::FunctionExpression(stringRef(2), sym(4).FormalParameterList, sym(8).StatementList);
        f->functionToken = sym(2).PropertyName->firstSourceLocation();
        f->lparenToken = loc(3);
        f->rparenToken = loc(5);
        f->lbraceToken = loc(7);
        f->rbraceToken = loc(9);
        AST::PatternProperty *node = new (pool) AST::PatternProperty(sym(2).PropertyName, f, AST::PatternProperty::Setter);
        node->colonToken = loc(2);
        sym(1).Node = node;
    } break;

#line 4123 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 535: {
        AST::FormalParameterList *node = (new (pool) AST::FormalParameterList(nullptr, sym(1).PatternElement))->finish(pool);
        sym(1).Node = node;
    } break;

#line 4131 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 536: {
        lexer->enterGeneratorBody();
    } break;

#line 4138 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 537: {
        --functionNestingLevel;
        lexer->leaveGeneratorBody();
    } break;

#line 4148 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 539: {
        AST::FunctionDeclaration *node = new (pool) AST::FunctionDeclaration(stringRef(2), sym(4).FormalParameterList, sym(7).StatementList);
        node->functionToken = loc(1);
        node->identifierToken = loc(2);
        node->lparenToken = loc(3);
        node->rparenToken = loc(5);
        node->lbraceToken = loc(6);
        node->rbraceToken = loc(8);
        node->isGenerator = true;
        sym(1).Node = node;
    } break;

#line 4164 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 541: {
        AST::FunctionDeclaration *node = new (pool) AST::FunctionDeclaration(QStringRef(), sym(3).FormalParameterList, sym(6).StatementList);
        node->functionToken = loc(1);
        node->lparenToken = loc(2);
        node->rparenToken = loc(4);
        node->lbraceToken = loc(5);
        node->rbraceToken = loc(7);
        node->isGenerator = true;
        sym(1).Node = node;
    } break;

#line 4178 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 542: {
        AST::FunctionExpression *node = new (pool) AST::FunctionExpression(stringRef(2), sym(4).FormalParameterList, sym(7).StatementList);
        node->functionToken = loc(1);
        if (!stringRef(2).isNull())
          node->identifierToken = loc(2);
        node->lparenToken = loc(3);
        node->rparenToken = loc(5);
        node->lbraceToken = loc(6);
        node->rbraceToken = loc(8);
        node->isGenerator = true;
        sym(1).Node = node;
    } break;

#line 4194 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 543: {
        AST::FunctionExpression *node = new (pool) AST::FunctionExpression(QStringRef(), sym(3).FormalParameterList, sym(6).StatementList);
        node->functionToken = loc(1);
        node->lparenToken = loc(2);
        node->rparenToken = loc(4);
        node->lbraceToken = loc(5);
        node->rbraceToken = loc(7);
        node->isGenerator = true;
        sym(1).Node = node;
    } break;

#line 4210 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"
  case 545: Q_FALLTHROUGH(); 
#line 4212 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 546: {
        AST::YieldExpression *node = new (pool) AST::YieldExpression();
        node->yieldToken = loc(1);
        sym(1).Node = node;
    } break;

#line 4221 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"
  case 547: Q_FALLTHROUGH(); 
#line 4223 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 548: {
        AST::YieldExpression *node = new (pool) AST::YieldExpression(sym(3).Expression);
        node->yieldToken = loc(1);
        node->isYieldStar = true;
        sym(1).Node = node;
    } break;

#line 4233 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"
  case 549: Q_FALLTHROUGH(); 
#line 4235 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 550: {
        AST::YieldExpression *node = new (pool) AST::YieldExpression(sym(2).Expression);
        node->yieldToken = loc(1);
        sym(1).Node = node;
    } break;

#line 4245 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 551: {
        AST::ClassDeclaration *node = new (pool) AST::ClassDeclaration(stringRef(2), sym(3).Expression, sym(5).ClassElementList);
        node->classToken = loc(1);
        node->identifierToken = loc(2);
        node->lbraceToken = loc(4);
        node->rbraceToken = loc(6);
        sym(1).Node = node;
    } break;

#line 4257 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 552: {
        AST::ClassExpression *node = new (pool) AST::ClassExpression(stringRef(2), sym(3).Expression, sym(5).ClassElementList);
        node->classToken = loc(1);
        node->identifierToken = loc(2);
        node->lbraceToken = loc(4);
        node->rbraceToken = loc(6);
        sym(1).Node = node;
    } break;

#line 4269 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 553: {
        AST::ClassDeclaration *node = new (pool) AST::ClassDeclaration(QStringRef(), sym(2).Expression, sym(4).ClassElementList);
        node->classToken = loc(1);
        node->lbraceToken = loc(3);
        node->rbraceToken = loc(5);
        sym(1).Node = node;
    } break;

#line 4280 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 554: {
        AST::ClassExpression *node = new (pool) AST::ClassExpression(QStringRef(), sym(2).Expression, sym(4).ClassElementList);
        node->classToken = loc(1);
        node->lbraceToken = loc(3);
        node->rbraceToken = loc(5);
        sym(1).Node = node;
    } break;

#line 4293 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 556: {
        lexer->setStaticIsKeyword(true);
    } break;

#line 4300 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"
 case 557: 
#line 4302 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 558: {
        lexer->setStaticIsKeyword(false);
    } break;

#line 4309 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 559: {
        sym(1).Node = nullptr;
    } break;

#line 4316 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 560: {
        sym(1).Node = sym(2).Node;
    } break;

#line 4323 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 561: {
        sym(1).Node = nullptr;
    } break;

#line 4330 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 562: {
        if (sym(1).Node)
            sym(1).Node = sym(1).ClassElementList->finish();
    } break;

#line 4340 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 564: {
        if (sym(1).Node) {
            if (sym(2).Node)
                sym(1).ClassElementList = sym(1).ClassElementList->append(sym(2).ClassElementList);
        } else if (sym(2).Node) {
            sym(1).Node = sym(2).Node;
        }
    } break;

#line 4352 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 565: {
        AST::ClassElementList *node = new (pool) AST::ClassElementList(sym(1).PatternProperty, false);
        sym(1).Node = node;
    } break;

#line 4360 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 566: {
        lexer->setStaticIsKeyword(true);
        AST::ClassElementList *node = new (pool) AST::ClassElementList(sym(2).PatternProperty, true);
        sym(1).Node = node;
    } break;

#line 4369 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 567: {
        sym(1).Node = nullptr;
    } break;

#line 4378 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 568: {
        sym(1).Node = nullptr;
    } break;

#line 4387 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 570: {
        sym(1).Node = new (pool) AST::Program(sym(1).StatementList->finish());
    } break;

#line 4394 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"
  case 571: {
        sym(1).Node = new (pool) AST::ESModule(sym(1).StatementList);
    } break;

#line 4400 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 572: {
        sym(1).StatementList = sym(1).StatementList->finish();
    } break;

#line 4407 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 573: {
        sym(1).StatementList = nullptr;
    } break;

#line 4417 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 576: {
        sym(1).StatementList = sym(1).StatementList->append(sym(2).StatementList);
    } break;

#line 4425 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"
 case 577:  Q_FALLTHROUGH(); 
#line 4427 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 578: {
        sym(1).StatementList = new (pool) AST::StatementList(sym(1).Node);
    } break;

#line 4436 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 580: {
        auto decl = new (pool) AST::ImportDeclaration(sym(2).ImportClause, sym(3).FromClause);
        decl->importToken = loc(1);
        sym(1).Node = decl;
    } break;

#line 4444 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 581: {
        auto decl = new (pool) AST::ImportDeclaration(stringRef(2));
        decl->importToken = loc(1);
        decl->moduleSpecifierToken = loc(2);
        sym(1).Node = decl;
    } break;

#line 4454 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 582: {
        auto clause = new (pool) AST::ImportClause(stringRef(1));
        clause->importedDefaultBindingToken = loc(1);
        sym(1).ImportClause = clause;
    } break;

#line 4462 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 583: {
        sym(1).ImportClause = new (pool) AST::ImportClause(sym(1).NameSpaceImport);
    } break;

#line 4468 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 584: {
        sym(1).ImportClause = new (pool) AST::ImportClause(sym(1).NamedImports);
    } break;

#line 4474 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 585: {
        auto importClause = new (pool) AST::ImportClause(stringRef(1), sym(3).NameSpaceImport);
        importClause->importedDefaultBindingToken = loc(1);
        sym(1).ImportClause = importClause;
    } break;

#line 4482 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 586: {
        auto importClause = new (pool) AST::ImportClause(stringRef(1), sym(3).NamedImports);
        importClause->importedDefaultBindingToken = loc(1);
        sym(1).ImportClause = importClause;
    } break;

#line 4493 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 588: {
        auto import = new (pool) AST::NameSpaceImport(stringRef(3));
        import->starToken = loc(1);
        import->importedBindingToken = loc(3);
        sym(1).NameSpaceImport = import;
    } break;

#line 4503 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 589: {
        auto namedImports = new (pool) AST::NamedImports();
        namedImports->leftBraceToken = loc(1);
        namedImports->rightBraceToken = loc(2);
        sym(1).NamedImports = namedImports;
    } break;

#line 4512 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 590: {
        auto namedImports = new (pool) AST::NamedImports(sym(2).ImportsList->finish());
        namedImports->leftBraceToken = loc(1);
        namedImports->rightBraceToken = loc(3);
        sym(1).NamedImports = namedImports;
    } break;

#line 4521 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 591: {
        auto namedImports = new (pool) AST::NamedImports(sym(2).ImportsList->finish());
        namedImports->leftBraceToken = loc(1);
        namedImports->rightBraceToken = loc(4);
        sym(1).NamedImports = namedImports;
    } break;

#line 4531 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 592: {
        auto clause = new (pool) AST::FromClause(stringRef(2));
        clause->fromToken = loc(1);
        clause->moduleSpecifierToken = loc(2);
        sym(1).FromClause = clause;
    } break;

#line 4541 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 593: {
        auto importsList = new (pool) AST::ImportsList(sym(1).ImportSpecifier);
        importsList->importSpecifierToken = loc(1);
        sym(1).ImportsList = importsList;
    } break;

#line 4549 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 594: {
        auto importsList = new (pool) AST::ImportsList(sym(1).ImportsList, sym(3).ImportSpecifier);
        importsList->importSpecifierToken = loc(3);
        sym(1).ImportsList = importsList;
    } break;

#line 4561 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 595: {
        auto importSpecifier = new (pool) AST::ImportSpecifier(stringRef(1));
        importSpecifier->importedBindingToken = loc(1);
        sym(1).ImportSpecifier = importSpecifier;
    } break;

#line 4569 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 596: {
    auto importSpecifier = new (pool) AST::ImportSpecifier(stringRef(1), stringRef(3));
    importSpecifier->identifierToken = loc(1);
    importSpecifier->importedBindingToken = loc(3);
    sym(1).ImportSpecifier = importSpecifier;
    } break;

#line 4586 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 599: {
        int token = lookaheadToken(lexer);
        if (token == T_FUNCTION || token == T_FUNCTION_STAR || token == T_CLASS)
            pushToken(T_FORCE_DECLARATION);
    } break;

#line 4595 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 600: {
        auto exportDeclaration = new (pool) AST::ExportDeclaration(sym(3).FromClause);
        exportDeclaration->exportToken = loc(1);
        sym(1).ExportDeclaration = exportDeclaration;
    } break;

#line 4603 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 601: {
        auto exportDeclaration = new (pool) AST::ExportDeclaration(sym(2).ExportClause, sym(3).FromClause);
        exportDeclaration->exportToken = loc(1);
        sym(1).ExportDeclaration = exportDeclaration;
    } break;

#line 4611 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 602: {
        auto exportDeclaration = new (pool) AST::ExportDeclaration(sym(2).ExportClause);
        exportDeclaration->exportToken = loc(1);
        sym(1).ExportDeclaration = exportDeclaration;
    } break;

#line 4619 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"
 case 603:  Q_FALLTHROUGH(); 
#line 4621 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 604: {
        auto exportDeclaration = new (pool) AST::ExportDeclaration(/*exportDefault=*/false, sym(2).Node);
        exportDeclaration->exportToken = loc(1);
        sym(1).ExportDeclaration = exportDeclaration;
    } break;

#line 4629 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 605: {
        if (auto *f = AST::cast<AST::FunctionDeclaration*>(sym(5).Node)) {
            if (f->name.isEmpty()) {
                f->name = stringRef(2);
                f->identifierToken = loc(2);
            }
        }
    } Q_FALLTHROUGH();

#line 4640 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 606: {
        // Emulate 15.2.3.11
        if (auto *cls = AST::cast<AST::ClassDeclaration*>(sym(5).Node)) {
            if (cls->name.isEmpty()) {
                cls->name = stringRef(2);
                cls->identifierToken = loc(2);
            }
        }

        auto exportDeclaration = new (pool) AST::ExportDeclaration(/*exportDefault=*/true, sym(5).Node);
        exportDeclaration->exportToken = loc(1);
        sym(1).ExportDeclaration = exportDeclaration;
    } break;

#line 4656 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 607: {
        // if lhs is an identifier expression and rhs is an anonymous function expression, we need to assign the name of lhs to the function
        if (auto *f = asAnonymousFunctionDefinition(sym(4).Node)) {
            f->name = stringRef(2);
        }
        if (auto *c = asAnonymousClassDefinition(sym(4).Expression)) {
            c->name = stringRef(2);
        }

        auto exportDeclaration = new (pool) AST::ExportDeclaration(/*exportDefault=*/true, sym(4).Node);
        exportDeclaration->exportToken = loc(1);
        sym(1).ExportDeclaration = exportDeclaration;
    } break;

#line 4673 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 608: {
        auto exportClause = new (pool) AST::ExportClause();
        exportClause->leftBraceToken = loc(1);
        exportClause->rightBraceToken = loc(2);
        sym(1).ExportClause = exportClause;
    } break;

#line 4682 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 609: {
        auto exportClause = new (pool) AST::ExportClause(sym(2).ExportsList->finish());
        exportClause->leftBraceToken = loc(1);
        exportClause->rightBraceToken = loc(3);
        sym(1).ExportClause = exportClause;
    } break;

#line 4691 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 610: {
        auto exportClause = new (pool) AST::ExportClause(sym(2).ExportsList->finish());
        exportClause->leftBraceToken = loc(1);
        exportClause->rightBraceToken = loc(4);
        sym(1).ExportClause = exportClause;
    } break;

#line 4701 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 611: {
        sym(1).ExportsList = new (pool) AST::ExportsList(sym(1).ExportSpecifier);
    } break;

#line 4707 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 612: {
        sym(1).ExportsList = new (pool) AST::ExportsList(sym(1).ExportsList, sym(3).ExportSpecifier);
    } break;

#line 4714 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 613: {
        auto exportSpecifier = new (pool) AST::ExportSpecifier(stringRef(1));
        exportSpecifier->identifierToken = loc(1);
        sym(1).ExportSpecifier = exportSpecifier;
    } break;

#line 4722 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    case 614: {
        auto exportSpecifier = new (pool) AST::ExportSpecifier(stringRef(1), stringRef(3));
        exportSpecifier->identifierToken = loc(1);
        exportSpecifier->exportedIdentifierToken = loc(3);
        sym(1).ExportSpecifier = exportSpecifier;
    } break;

#line 4733 "/build/qt5-declarative/src/qtdeclarative/src/qml/parser/qqmljs.g"

    // ------------ end of switch statement
            } // switch
            action = nt_action(state_stack[tos], lhs[r] - TERMINAL_COUNT);
        } // if
    } while (action != 0);

#ifdef PARSER_DEBUG
    qDebug() << "Done or error.";
#endif

    if (first_token == last_token) {
        const int errorState = state_stack[tos];

        // automatic insertion of `;'
        if (yytoken != -1 && ((t_action(errorState, T_AUTOMATIC_SEMICOLON) && lexer->canInsertAutomaticSemicolon(yytoken))
                              || t_action(errorState, T_COMPATIBILITY_SEMICOLON))) {
#ifdef PARSER_DEBUG
            qDebug() << "Inserting automatic semicolon.";
#endif
            SavedToken &tk = token_buffer[0];
            tk.token = yytoken;
            tk.dval = yylval;
            tk.spell = yytokenspell;
            tk.raw = yytokenraw;
            tk.loc = yylloc;

            yylloc = yyprevlloc;
            yylloc.offset += yylloc.length;
            yylloc.startColumn += yylloc.length;
            yylloc.length = 0;

            //const QString msg = QCoreApplication::translate("QQmlParser", "Missing `;'");
            //diagnostic_messages.append(compileError(yyloc, msg, QtWarningMsg));

            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].spell = yytokenspell;
        token_buffer[0].raw = yytokenraw;
        token_buffer[0].loc = yylloc;

        token_buffer[1].token = yytoken       = lexer->lex();
        token_buffer[1].dval  = yylval        = lexer->tokenValue();
        token_buffer[1].spell = yytokenspell  = lexer->tokenSpell();
        token_buffer[1].raw   = yytokenraw    = lexer->rawString();
        token_buffer[1].loc   = yylloc        = location(lexer);

        if (t_action(errorState, yytoken)) {
#ifdef PARSER_DEBUG
            qDebug() << "Parse error, trying to recover.";
#endif
            QString msg;
            int token = token_buffer[0].token;
            if (token < 0 || token >= TERMINAL_COUNT)
                msg = QCoreApplication::translate("QQmlParser", "Syntax error");
            else
                msg = QCoreApplication::translate("QQmlParser", "Unexpected token `%1'").arg(QLatin1String(spell[token]));
            diagnostic_messages.append(compileError(token_buffer[0].loc, 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)) {
#ifdef PARSER_DEBUG
                qDebug() << "Parse error, trying to recover (2).";
#endif
                const QString msg = QCoreApplication::translate("QQmlParser", "Expected token `%1'").arg(QLatin1String(spell[*tk]));
                diagnostic_messages.append(compileError(token_buffer[0].loc, msg));

                pushToken(*tk);
                goto _Lcheck_token;
            }
        }

        for (int tk = 1; tk < TERMINAL_COUNT; ++tk) {
            if (tk == T_AUTOMATIC_SEMICOLON || tk == T_FEED_UI_PROGRAM    ||
                tk == T_FEED_JS_STATEMENT   || tk == T_FEED_JS_EXPRESSION)
               continue;

            int a = t_action(errorState, tk);
            if (a > 0 && t_action(a, yytoken)) {
                const QString msg = QCoreApplication::translate("QQmlParser", "Expected token `%1'").arg(QLatin1String(spell[tk]));
                diagnostic_messages.append(compileError(token_buffer[0].loc, msg));

                pushToken(tk);
                goto _Lcheck_token;
            }
        }

        const QString msg = QCoreApplication::translate("QQmlParser", "Syntax error");
        diagnostic_messages.append(compileError(token_buffer[0].loc, msg));
    }

    return false;
}

QT_END_NAMESPACE


