diff --git a/src/plugins/qtscripteditor/parser/cmd.sed b/src/plugins/qtscripteditor/parser/cmd.sed
new file mode 100644
index 0000000000000000000000000000000000000000..d9ffe43a9fde276808934dda0162e87c5f272345
--- /dev/null
+++ b/src/plugins/qtscripteditor/parser/cmd.sed
@@ -0,0 +1,16 @@
+s/#include "qscriptcontext_p.h"//g
+s/#include "qscriptcontext.h"//g
+s/#include "qscriptengine.h"//g
+s/#include "qscriptmember_p.h"//g
+s/#include "qscriptobject_p.h"//g
+s/#include "qscriptvalueimpl_p.h"//g
+
+s/#ifndef QT_NO_SCRIPT//g
+s,#endif // QT_NO_SCRIPT,,g
+
+s/QScript/JavaScript/g
+s/QSCRIPT/JAVASCRIPT/g
+s/qscript/javascript/g
+s/Q_SCRIPT/J_SCRIPT/g
+
+s/qsreal/qjsreal/g
\ No newline at end of file
diff --git a/src/plugins/qtscripteditor/parser/gen.sh b/src/plugins/qtscripteditor/parser/gen.sh
new file mode 100644
index 0000000000000000000000000000000000000000..ebf34b2c2b458d3cc36da5eb88458e6d85685b51
--- /dev/null
+++ b/src/plugins/qtscripteditor/parser/gen.sh
@@ -0,0 +1,44 @@
+#!/bin/sh
+
+me=$(dirname $0)
+
+rm -f javascript.g
+rm -f javascriptast.cpp
+rm -f javascriptast_p.h
+rm -f javascriptastfwd_p.h
+rm -f javascriptastvisitor.cpp
+rm -f javascriptastvisitor_p.h
+rm -f javascriptlexer.cpp
+rm -f javascriptlexer_p.h
+rm -f javascriptmemorypool_p.h
+rm -f javascriptnodepool_p.h
+
+sed -f $me/cmd.sed $QTDIR/src/script/qscript.g > javascript.g
+
+sed -f $me/cmd.sed $QTDIR/src/script/qscriptast.cpp > javascriptast.cpp
+sed -f $me/cmd.sed $QTDIR/src/script/qscriptast_p.h > javascriptast_p.h
+sed -f $me/cmd.sed $QTDIR/src/script/qscriptastfwd_p.h > javascriptastfwd_p.h
+sed -f $me/cmd.sed $QTDIR/src/script/qscriptastvisitor.cpp > javascriptastvisitor.cpp
+sed -f $me/cmd.sed $QTDIR/src/script/qscriptastvisitor_p.h > javascriptastvisitor_p.h
+sed -f $me/cmd.sed $QTDIR/src/script/qscriptlexer_p.h > javascriptlexer_p.h
+sed -f $me/cmd.sed $QTDIR/src/script/qscriptlexer.cpp > javascriptlexer.cpp
+sed -f $me/cmd.sed $QTDIR/src/script/qscriptmemorypool_p.h > javascriptmemorypool_p.h
+sed -f $me/cmd.sed $QTDIR/src/script/qscriptnodepool_p.h > javascriptnodepool_p.h
+
+qlalr $me/javascript.g
+
+chmod ugo-w javascript.g
+chmod ugo-w javascriptast.cpp
+chmod ugo-w javascriptast_p.h
+chmod ugo-w javascriptastfwd_p.h
+chmod ugo-w javascriptastvisitor.cpp
+chmod ugo-w javascriptastvisitor_p.h
+chmod ugo-w javascriptlexer_p.h
+chmod ugo-w javascriptlexer.cpp
+chmod ugo-w javascriptmemorypool_p.h
+chmod ugo-w javascriptnodepool_p.h
+
+chmod ugo-w javascriptgrammar_p.h
+chmod ugo-w javascriptgrammar.cpp
+chmod ugo-w javascriptparser_p.h
+chmod ugo-w javascriptparser.cpp
diff --git a/src/plugins/qtscripteditor/parser/javascript.g b/src/plugins/qtscripteditor/parser/javascript.g
new file mode 100644
index 0000000000000000000000000000000000000000..743e80a1c3db4079b09da8055c1b6f1ac835c2ca
--- /dev/null
+++ b/src/plugins/qtscripteditor/parser/javascript.g
@@ -0,0 +1,2123 @@
+----------------------------------------------------------------------------
+--
+-- Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+-- Contact: Qt Software Information (qt-info@nokia.com)
+--
+-- This file is part of the QtScript module of the Qt Toolkit.
+--
+-- $QT_BEGIN_LICENSE:LGPL$
+-- No Commercial Usage
+-- This file contains pre-release code and may not be distributed.
+-- You may use this file in accordance with the terms and conditions
+-- contained in the either Technology Preview License Agreement or the
+-- Beta Release License Agreement.
+--
+-- GNU Lesser General Public License Usage
+-- Alternatively, this file may be used under the terms of the GNU Lesser
+-- General Public License version 2.1 as published by the Free Software
+-- Foundation and appearing in the file LICENSE.LGPL included in the
+-- packaging of this file.  Please review the following information to
+-- ensure the GNU Lesser General Public License version 2.1 requirements
+-- will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+--
+-- In addition, as a special exception, Nokia gives you certain
+-- additional rights. These rights are described in the Nokia Qt LGPL
+-- Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
+-- package.
+--
+-- GNU General Public License Usage
+-- Alternatively, this file may be used under the terms of the GNU
+-- General Public License version 3.0 as published by the Free Software
+-- Foundation and appearing in the file LICENSE.GPL included in the
+-- packaging of this file.  Please review the following information to
+-- ensure the GNU General Public License version 3.0 requirements will be
+-- met: http://www.gnu.org/copyleft/gpl.html.
+--
+-- If you are unsure which license is appropriate for your use, please
+-- contact the sales department at qt-sales@nokia.com.
+-- $QT_END_LICENSE$
+--
+-- This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+-- WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+--
+----------------------------------------------------------------------------
+
+%parser         JavaScriptGrammar
+%decl           javascriptparser_p.h
+%impl           javascriptparser.cpp
+%expect         3
+%expect-rr      1
+
+%token T_AND "&"                T_AND_AND "&&"              T_AND_EQ "&="
+%token T_BREAK "break"          T_CASE "case"               T_CATCH "catch"
+%token T_COLON ":"              T_COMMA ";"                 T_CONTINUE "continue"
+%token T_DEFAULT "default"      T_DELETE "delete"           T_DIVIDE_ "/"
+%token T_DIVIDE_EQ "/="         T_DO "do"                   T_DOT "."
+%token T_ELSE "else"            T_EQ "="                    T_EQ_EQ "=="
+%token T_EQ_EQ_EQ "==="         T_FINALLY "finally"         T_FOR "for"
+%token T_FUNCTION "function"    T_GE ">="                   T_GT ">"
+%token T_GT_GT ">>"             T_GT_GT_EQ ">>="            T_GT_GT_GT ">>>"
+%token T_GT_GT_GT_EQ ">>>="     T_IDENTIFIER "identifier"   T_IF "if"
+%token T_IN "in"                T_INSTANCEOF "instanceof"   T_LBRACE "{"
+%token T_LBRACKET "["           T_LE "<="                   T_LPAREN "("
+%token T_LT "<"                 T_LT_LT "<<"                T_LT_LT_EQ "<<="
+%token T_MINUS "-"              T_MINUS_EQ "-="             T_MINUS_MINUS "--"
+%token T_NEW "new"              T_NOT "!"                   T_NOT_EQ "!="
+%token T_NOT_EQ_EQ "!=="        T_NUMERIC_LITERAL "numeric literal"     T_OR "|"
+%token T_OR_EQ "|="             T_OR_OR "||"                T_PLUS "+"
+%token T_PLUS_EQ "+="           T_PLUS_PLUS "++"            T_QUESTION "?"
+%token T_RBRACE "}"             T_RBRACKET "]"              T_REMAINDER "%"
+%token T_REMAINDER_EQ "%="      T_RETURN "return"           T_RPAREN ")"
+%token T_SEMICOLON ";"          T_AUTOMATIC_SEMICOLON       T_STAR "*"
+%token T_STAR_EQ "*="           T_STRING_LITERAL "string literal"
+%token T_SWITCH "switch"        T_THIS "this"               T_THROW "throw"
+%token T_TILDE "~"              T_TRY "try"                 T_TYPEOF "typeof"
+%token T_VAR "var"              T_VOID "void"               T_WHILE "while"
+%token T_WITH "with"            T_XOR "^"                   T_XOR_EQ "^="
+%token T_NULL "null"            T_TRUE "true"               T_FALSE "false"
+%token T_CONST "const"
+%token T_DEBUGGER "debugger"
+%token T_RESERVED_WORD "reserved word"
+
+%start Program
+
+/.
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the QtScript module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain
+** additional rights. These rights are described in the Nokia Qt LGPL
+** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtCore/QtDebug>
+
+
+
+#include <string.h>
+
+
+#include "javascriptengine_p.h"
+
+
+
+
+#include "javascriptlexer_p.h"
+#include "javascriptast_p.h"
+#include "javascriptnodepool_p.h"
+
+#define J_SCRIPT_UPDATE_POSITION(node, startloc, endloc) do { \
+    node->startLine = startloc.startLine; \
+    node->startColumn = startloc.startColumn; \
+    node->endLine = endloc.endLine; \
+    node->endColumn = endloc.endColumn; \
+} while (0)
+
+./
+
+/:
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the QtScript module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain
+** additional rights. These rights are described in the Nokia Qt LGPL
+** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//
+//  W A R N I N G
+//  -------------
+//
+// This file is not part of the Qt API.  It exists purely as an
+// implementation detail.  This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+//
+// This file is automatically generated from javascript.g.
+// Changes will be lost.
+//
+
+#ifndef JAVASCRIPTPARSER_P_H
+#define JAVASCRIPTPARSER_P_H
+
+#include "javascriptgrammar_p.h"
+
+
+
+#include "javascriptastfwd_p.h"
+
+QT_BEGIN_NAMESPACE
+
+class QString;
+class JavaScriptEnginePrivate;
+class JavaScriptNameIdImpl;
+
+class JavaScriptParser: protected $table
+{
+public:
+    union Value {
+      int ival;
+      double dval;
+      JavaScriptNameIdImpl *sval;
+      JavaScript::AST::ArgumentList *ArgumentList;
+      JavaScript::AST::CaseBlock *CaseBlock;
+      JavaScript::AST::CaseClause *CaseClause;
+      JavaScript::AST::CaseClauses *CaseClauses;
+      JavaScript::AST::Catch *Catch;
+      JavaScript::AST::DefaultClause *DefaultClause;
+      JavaScript::AST::ElementList *ElementList;
+      JavaScript::AST::Elision *Elision;
+      JavaScript::AST::ExpressionNode *Expression;
+      JavaScript::AST::Finally *Finally;
+      JavaScript::AST::FormalParameterList *FormalParameterList;
+      JavaScript::AST::FunctionBody *FunctionBody;
+      JavaScript::AST::FunctionDeclaration *FunctionDeclaration;
+      JavaScript::AST::Node *Node;
+      JavaScript::AST::PropertyName *PropertyName;
+      JavaScript::AST::PropertyNameAndValueList *PropertyNameAndValueList;
+      JavaScript::AST::SourceElement *SourceElement;
+      JavaScript::AST::SourceElements *SourceElements;
+      JavaScript::AST::Statement *Statement;
+      JavaScript::AST::StatementList *StatementList;
+      JavaScript::AST::VariableDeclaration *VariableDeclaration;
+      JavaScript::AST::VariableDeclarationList *VariableDeclarationList;
+    };
+
+    struct Location {
+      int startLine;
+      int startColumn;
+      int endLine;
+      int endColumn;
+    };
+
+public:
+    JavaScriptParser();
+    ~JavaScriptParser();
+
+    bool parse(JavaScriptEnginePrivate *driver);
+
+    inline QString errorMessage() const
+    { return error_message; }
+    inline int errorLineNumber() const
+    { return error_lineno; }
+    inline int errorColumnNumber() const
+    { return error_column; }
+
+protected:
+    inline void reallocateStack();
+
+    inline Value &sym(int index)
+    { return sym_stack [tos + index - 1]; }
+
+    inline Location &loc(int index)
+    { return location_stack [tos + index - 2]; }
+
+protected:
+    int tos;
+    int stack_size;
+    Value *sym_stack;
+    int *state_stack;
+    Location *location_stack;
+    QString error_message;
+    int error_lineno;
+    int error_column;
+};
+
+inline void JavaScriptParser::reallocateStack()
+{
+    if (! stack_size)
+        stack_size = 128;
+    else
+        stack_size <<= 1;
+
+    sym_stack = reinterpret_cast<Value*> (qRealloc(sym_stack, stack_size * sizeof(Value)));
+    state_stack = reinterpret_cast<int*> (qRealloc(state_stack, stack_size * sizeof(int)));
+    location_stack = reinterpret_cast<Location*> (qRealloc(location_stack, stack_size * sizeof(Location)));
+}
+
+:/
+
+
+/.
+
+#include "javascriptparser_p.h"
+
+//
+// This file is automatically generated from javascript.g.
+// Changes will be lost.
+//
+
+QT_BEGIN_NAMESPACE
+
+inline static bool automatic(JavaScriptEnginePrivate *driver, int token)
+{
+    return token == $table::T_RBRACE
+        || token == 0
+        || driver->lexer()->prevTerminator();
+}
+
+
+JavaScriptParser::JavaScriptParser():
+    tos(0),
+    stack_size(0),
+    sym_stack(0),
+    state_stack(0),
+    location_stack(0),
+    error_lineno(0),
+    error_column(0)
+{
+}
+
+JavaScriptParser::~JavaScriptParser()
+{
+    if (stack_size) {
+        qFree(sym_stack);
+        qFree(state_stack);
+        qFree(location_stack);
+    }
+}
+
+static inline JavaScriptParser::Location location(JavaScript::Lexer *lexer)
+{
+    JavaScriptParser::Location loc;
+    loc.startLine = lexer->startLineNo();
+    loc.startColumn = lexer->startColumnNo();
+    loc.endLine = lexer->endLineNo();
+    loc.endColumn = lexer->endColumnNo();
+    return loc;
+}
+
+bool JavaScriptParser::parse(JavaScriptEnginePrivate *driver)
+{
+  const int INITIAL_STATE = 0;
+  JavaScript::Lexer *lexer = driver->lexer();
+
+  int yytoken = -1;
+  int saved_yytoken = -1;
+
+  reallocateStack();
+
+  tos = 0;
+  state_stack[++tos] = INITIAL_STATE;
+
+  while (true)
+    {
+      const int state = state_stack [tos];
+      if (yytoken == -1 && - TERMINAL_COUNT != action_index [state])
+        {
+          if (saved_yytoken == -1)
+            {
+              yytoken = lexer->lex();
+              location_stack [tos] = location(lexer);
+            }
+          else
+            {
+              yytoken = saved_yytoken;
+              saved_yytoken = -1;
+            }
+        }
+
+      int act = t_action (state, yytoken);
+
+      if (act == ACCEPT_STATE)
+        return true;
+
+      else if (act > 0)
+        {
+          if (++tos == stack_size)
+            reallocateStack();
+
+          sym_stack [tos].dval = lexer->dval ();
+          state_stack [tos] = act;
+          location_stack [tos] = location(lexer);
+          yytoken = -1;
+        }
+
+      else if (act < 0)
+        {
+          int r = - act - 1;
+
+          tos -= rhs [r];
+          act = state_stack [tos++];
+
+          switch (r) {
+./
+
+PrimaryExpression: T_THIS ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::ThisExpression> (driver->nodePool());
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
+} break;
+./
+
+PrimaryExpression: T_IDENTIFIER ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::IdentifierExpression> (driver->nodePool(), sym(1).sval);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
+} break;
+./
+
+PrimaryExpression: T_NULL ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::NullExpression> (driver->nodePool());
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
+} break;
+./
+
+PrimaryExpression: T_TRUE ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::TrueLiteral> (driver->nodePool());
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
+} break;
+./
+
+PrimaryExpression: T_FALSE ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::FalseLiteral> (driver->nodePool());
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
+} break;
+./
+
+PrimaryExpression: T_NUMERIC_LITERAL ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::NumericLiteral> (driver->nodePool(), sym(1).dval);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
+} break;
+./
+
+PrimaryExpression: T_STRING_LITERAL ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::StringLiteral> (driver->nodePool(), sym(1).sval);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
+} break;
+./
+
+PrimaryExpression: T_DIVIDE_ ;
+/:
+#define J_SCRIPT_REGEXPLITERAL_RULE1 $rule_number
+:/
+/.
+case $rule_number: {
+  bool rx = lexer->scanRegExp(JavaScript::Lexer::NoPrefix);
+  if (!rx) {
+      error_message = lexer->errorMessage();
+      error_lineno = lexer->startLineNo();
+      error_column = lexer->startColumnNo();
+      return false;
+  }
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::RegExpLiteral> (driver->nodePool(), lexer->pattern, lexer->flags);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
+} break;
+./
+
+PrimaryExpression: T_DIVIDE_EQ ;
+/:
+#define J_SCRIPT_REGEXPLITERAL_RULE2 $rule_number
+:/
+/.
+case $rule_number: {
+  bool rx = lexer->scanRegExp(JavaScript::Lexer::EqualPrefix);
+  if (!rx) {
+      error_message = lexer->errorMessage();
+      error_lineno = lexer->startLineNo();
+      error_column = lexer->startColumnNo();
+      return false;
+  }
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::RegExpLiteral> (driver->nodePool(), lexer->pattern, lexer->flags);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
+} break;
+./
+
+PrimaryExpression: T_LBRACKET ElisionOpt T_RBRACKET ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::ArrayLiteral> (driver->nodePool(), sym(2).Elision);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+./
+
+PrimaryExpression: T_LBRACKET ElementList T_RBRACKET ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::ArrayLiteral> (driver->nodePool(), sym(2).ElementList->finish ());
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+./
+
+PrimaryExpression: T_LBRACKET ElementList T_COMMA ElisionOpt T_RBRACKET ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::ArrayLiteral> (driver->nodePool(), sym(2).ElementList->finish (), sym(4).Elision);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(5));
+} break;
+./
+
+-- PrimaryExpression: T_LBRACE T_RBRACE ;
+-- /.
+-- case $rule_number: {
+--   sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::ObjectLiteral> (driver->nodePool());
+--   J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
+-- } break;
+-- ./
+
+PrimaryExpression: T_LBRACE PropertyNameAndValueListOpt T_RBRACE ;
+/.
+case $rule_number: {
+  if (sym(2).Node)
+    sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::ObjectLiteral> (driver->nodePool(), sym(2).PropertyNameAndValueList->finish ());
+  else
+    sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::ObjectLiteral> (driver->nodePool());
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+./
+
+PrimaryExpression: T_LBRACE PropertyNameAndValueList T_COMMA T_RBRACE ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::ObjectLiteral> (driver->nodePool(), sym(2).PropertyNameAndValueList->finish ());
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(4));
+} break;
+./
+
+PrimaryExpression: T_LPAREN Expression T_RPAREN ;
+/.
+case $rule_number: {
+  sym(1) = sym(2);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+./
+
+ElementList: ElisionOpt AssignmentExpression ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::ElementList> (driver->nodePool(), sym(1).Elision, sym(2).Expression);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
+} break;
+./
+
+ElementList: ElementList T_COMMA ElisionOpt AssignmentExpression ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::ElementList> (driver->nodePool(), sym(1).ElementList, sym(3).Elision, sym(4).Expression);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(4));
+} break;
+./
+
+Elision: T_COMMA ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::Elision> (driver->nodePool());
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
+} break;
+./
+
+Elision: Elision T_COMMA ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::Elision> (driver->nodePool(), sym(1).Elision);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
+} break;
+./
+
+ElisionOpt: ;
+/.
+case $rule_number: {
+  sym(1).Node = 0;
+} break;
+./
+
+ElisionOpt: Elision ;
+/.
+case $rule_number: {
+  sym(1).Elision = sym(1).Elision->finish ();
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
+} break;
+./
+
+PropertyNameAndValueList: PropertyName T_COLON AssignmentExpression ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::PropertyNameAndValueList> (driver->nodePool(), sym(1).PropertyName, sym(3).Expression);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+./
+
+PropertyNameAndValueList: PropertyNameAndValueList T_COMMA PropertyName T_COLON AssignmentExpression ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::PropertyNameAndValueList> (driver->nodePool(), sym(1).PropertyNameAndValueList, sym(3).PropertyName, sym(5).Expression);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(5));
+} break;
+./
+
+PropertyName: T_IDENTIFIER ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::IdentifierPropertyName> (driver->nodePool(), sym(1).sval);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
+} break;
+./
+
+PropertyName: T_STRING_LITERAL ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::StringLiteralPropertyName> (driver->nodePool(), sym(1).sval);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
+} break;
+./
+
+PropertyName: T_NUMERIC_LITERAL ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::NumericLiteralPropertyName> (driver->nodePool(), sym(1).dval);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
+} break;
+./
+
+PropertyName: ReservedIdentifier ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::IdentifierPropertyName> (driver->nodePool(), sym(1).sval);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
+} break;
+./
+
+ReservedIdentifier: T_BREAK ;
+/.
+case $rule_number:
+./
+ReservedIdentifier: T_CASE ;
+/.
+case $rule_number:
+./
+ReservedIdentifier: T_CATCH ;
+/.
+case $rule_number:
+./
+ReservedIdentifier: T_CONTINUE ;
+/.
+case $rule_number:
+./
+ReservedIdentifier: T_DEFAULT ;
+/.
+case $rule_number:
+./
+ReservedIdentifier: T_DELETE ;
+/.
+case $rule_number:
+./
+ReservedIdentifier: T_DO ;
+/.
+case $rule_number:
+./
+ReservedIdentifier: T_ELSE ;
+/.
+case $rule_number:
+./
+ReservedIdentifier: T_FALSE ;
+/.
+case $rule_number:
+./
+ReservedIdentifier: T_FINALLY ;
+/.
+case $rule_number:
+./
+ReservedIdentifier: T_FOR ;
+/.
+case $rule_number:
+./
+ReservedIdentifier: T_FUNCTION ;
+/.
+case $rule_number:
+./
+ReservedIdentifier: T_IF ;
+/.
+case $rule_number:
+./
+ReservedIdentifier: T_IN ;
+/.
+case $rule_number:
+./
+ReservedIdentifier: T_INSTANCEOF ;
+/.
+case $rule_number:
+./
+ReservedIdentifier: T_NEW ;
+/.
+case $rule_number:
+./
+ReservedIdentifier: T_NULL ;
+/.
+case $rule_number:
+./
+ReservedIdentifier: T_RETURN ;
+/.
+case $rule_number:
+./
+ReservedIdentifier: T_SWITCH ;
+/.
+case $rule_number:
+./
+ReservedIdentifier: T_THIS ;
+/.
+case $rule_number:
+./
+ReservedIdentifier: T_THROW ;
+/.
+case $rule_number:
+./
+ReservedIdentifier: T_TRUE ;
+/.
+case $rule_number:
+./
+ReservedIdentifier: T_TRY ;
+/.
+case $rule_number:
+./
+ReservedIdentifier: T_TYPEOF ;
+/.
+case $rule_number:
+./
+ReservedIdentifier: T_VAR ;
+/.
+case $rule_number:
+./
+ReservedIdentifier: T_VOID ;
+/.
+case $rule_number:
+./
+ReservedIdentifier: T_WHILE ;
+/.
+case $rule_number:
+./
+ReservedIdentifier: T_CONST ;
+/.
+case $rule_number:
+./
+ReservedIdentifier: T_DEBUGGER ;
+/.
+case $rule_number:
+./
+ReservedIdentifier: T_RESERVED_WORD ;
+/.
+case $rule_number:
+./
+ReservedIdentifier: T_WITH ;
+/.
+case $rule_number:
+{
+  sym(1).sval = driver->intern(lexer->characterBuffer(), lexer->characterCount());
+} break;
+./
+
+PropertyIdentifier: T_IDENTIFIER ;
+PropertyIdentifier: ReservedIdentifier ;
+
+MemberExpression: PrimaryExpression ;
+MemberExpression: FunctionExpression ;
+
+MemberExpression: MemberExpression T_LBRACKET Expression T_RBRACKET ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::ArrayMemberExpression> (driver->nodePool(), sym(1).Expression, sym(3).Expression);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(4));
+} break;
+./
+
+MemberExpression: MemberExpression T_DOT PropertyIdentifier ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::FieldMemberExpression> (driver->nodePool(), sym(1).Expression, sym(3).sval);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(4));
+} break;
+./
+
+MemberExpression: T_NEW MemberExpression Arguments ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::NewMemberExpression> (driver->nodePool(), sym(2).Expression, sym(3).ArgumentList);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+./
+
+NewExpression: MemberExpression ;
+
+NewExpression: T_NEW NewExpression ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::NewExpression> (driver->nodePool(), sym(2).Expression);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
+} break;
+./
+
+CallExpression: MemberExpression Arguments ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::CallExpression> (driver->nodePool(), sym(1).Expression, sym(2).ArgumentList);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
+} break;
+./
+
+CallExpression: CallExpression Arguments ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::CallExpression> (driver->nodePool(), sym(1).Expression, sym(2).ArgumentList);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
+} break;
+./
+
+CallExpression: CallExpression T_LBRACKET Expression T_RBRACKET ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::ArrayMemberExpression> (driver->nodePool(), sym(1).Expression, sym(3).Expression);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(4));
+} break;
+./
+
+CallExpression: CallExpression T_DOT PropertyIdentifier ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::FieldMemberExpression> (driver->nodePool(), sym(1).Expression, sym(3).sval);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+./
+
+Arguments: T_LPAREN T_RPAREN ;
+/.
+case $rule_number: {
+  sym(1).Node = 0;
+} break;
+./
+
+Arguments: T_LPAREN ArgumentList T_RPAREN ;
+/.
+case $rule_number: {
+  sym(1).Node = sym(2).ArgumentList->finish ();
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+./
+
+ArgumentList: AssignmentExpression ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::ArgumentList> (driver->nodePool(), sym(1).Expression);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
+} break;
+./
+
+ArgumentList: ArgumentList T_COMMA AssignmentExpression ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::ArgumentList> (driver->nodePool(), sym(1).ArgumentList, sym(3).Expression);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+./
+
+LeftHandSideExpression: NewExpression ;
+LeftHandSideExpression: CallExpression ;
+PostfixExpression: LeftHandSideExpression ;
+
+PostfixExpression: LeftHandSideExpression T_PLUS_PLUS ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::PostIncrementExpression> (driver->nodePool(), sym(1).Expression);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
+} break;
+./
+
+PostfixExpression: LeftHandSideExpression T_MINUS_MINUS ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::PostDecrementExpression> (driver->nodePool(), sym(1).Expression);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
+} break;
+./
+
+UnaryExpression: PostfixExpression ;
+
+UnaryExpression: T_DELETE UnaryExpression ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::DeleteExpression> (driver->nodePool(), sym(2).Expression);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
+} break;
+./
+
+UnaryExpression: T_VOID UnaryExpression ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::VoidExpression> (driver->nodePool(), sym(2).Expression);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
+} break;
+./
+
+UnaryExpression: T_TYPEOF UnaryExpression ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::TypeOfExpression> (driver->nodePool(), sym(2).Expression);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
+} break;
+./
+
+UnaryExpression: T_PLUS_PLUS UnaryExpression ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::PreIncrementExpression> (driver->nodePool(), sym(2).Expression);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
+} break;
+./
+
+UnaryExpression: T_MINUS_MINUS UnaryExpression ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::PreDecrementExpression> (driver->nodePool(), sym(2).Expression);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
+} break;
+./
+
+UnaryExpression: T_PLUS UnaryExpression ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::UnaryPlusExpression> (driver->nodePool(), sym(2).Expression);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
+} break;
+./
+
+UnaryExpression: T_MINUS UnaryExpression ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::UnaryMinusExpression> (driver->nodePool(), sym(2).Expression);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
+} break;
+./
+
+UnaryExpression: T_TILDE UnaryExpression ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::TildeExpression> (driver->nodePool(), sym(2).Expression);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
+} break;
+./
+
+UnaryExpression: T_NOT UnaryExpression ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::NotExpression> (driver->nodePool(), sym(2).Expression);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
+} break;
+./
+
+MultiplicativeExpression: UnaryExpression ;
+
+MultiplicativeExpression: MultiplicativeExpression T_STAR UnaryExpression ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Mul, sym(3).Expression);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+./
+
+MultiplicativeExpression: MultiplicativeExpression T_DIVIDE_ UnaryExpression ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Div, sym(3).Expression);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+./
+
+MultiplicativeExpression: MultiplicativeExpression T_REMAINDER UnaryExpression ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Mod, sym(3).Expression);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+./
+
+AdditiveExpression: MultiplicativeExpression ;
+
+AdditiveExpression: AdditiveExpression T_PLUS MultiplicativeExpression ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Add, sym(3).Expression);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+./
+
+AdditiveExpression: AdditiveExpression T_MINUS MultiplicativeExpression ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Sub, sym(3).Expression);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+./
+
+ShiftExpression: AdditiveExpression ;
+
+ShiftExpression: ShiftExpression T_LT_LT AdditiveExpression ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::LShift, sym(3).Expression);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+./
+
+ShiftExpression: ShiftExpression T_GT_GT AdditiveExpression ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::RShift, sym(3).Expression);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+./
+
+ShiftExpression: ShiftExpression T_GT_GT_GT AdditiveExpression ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::URShift, sym(3).Expression);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+./
+
+RelationalExpression: ShiftExpression ;
+
+RelationalExpression: RelationalExpression T_LT ShiftExpression ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Lt, sym(3).Expression);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+./
+
+RelationalExpression: RelationalExpression T_GT ShiftExpression ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Gt, sym(3).Expression);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+./
+
+RelationalExpression: RelationalExpression T_LE ShiftExpression ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Le, sym(3).Expression);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+./
+
+RelationalExpression: RelationalExpression T_GE ShiftExpression ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Ge, sym(3).Expression);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+./
+
+RelationalExpression: RelationalExpression T_INSTANCEOF ShiftExpression ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::InstanceOf, sym(3).Expression);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+./
+
+RelationalExpression: RelationalExpression T_IN ShiftExpression ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::In, sym(3).Expression);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+./
+
+RelationalExpressionNotIn: ShiftExpression ;
+
+RelationalExpressionNotIn: RelationalExpressionNotIn T_LT ShiftExpression ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Lt, sym(3).Expression);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+./
+
+RelationalExpressionNotIn: RelationalExpressionNotIn T_GT ShiftExpression ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Gt, sym(3).Expression);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+./
+
+RelationalExpressionNotIn: RelationalExpressionNotIn T_LE ShiftExpression ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Le, sym(3).Expression);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+./
+
+RelationalExpressionNotIn: RelationalExpressionNotIn T_GE ShiftExpression ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Ge, sym(3).Expression);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+./
+
+RelationalExpressionNotIn: RelationalExpressionNotIn T_INSTANCEOF ShiftExpression ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::InstanceOf, sym(3).Expression);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+./
+
+EqualityExpression: RelationalExpression ;
+
+EqualityExpression: EqualityExpression T_EQ_EQ RelationalExpression ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Equal, sym(3).Expression);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+./
+
+EqualityExpression: EqualityExpression T_NOT_EQ RelationalExpression ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::NotEqual, sym(3).Expression);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+./
+
+EqualityExpression: EqualityExpression T_EQ_EQ_EQ RelationalExpression ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::StrictEqual, sym(3).Expression);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+./
+
+EqualityExpression: EqualityExpression T_NOT_EQ_EQ RelationalExpression ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::StrictNotEqual, sym(3).Expression);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+./
+
+EqualityExpressionNotIn: RelationalExpressionNotIn ;
+
+EqualityExpressionNotIn: EqualityExpressionNotIn T_EQ_EQ RelationalExpressionNotIn ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Equal, sym(3).Expression);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+./
+
+EqualityExpressionNotIn: EqualityExpressionNotIn T_NOT_EQ RelationalExpressionNotIn;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::NotEqual, sym(3).Expression);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+./
+
+EqualityExpressionNotIn: EqualityExpressionNotIn T_EQ_EQ_EQ RelationalExpressionNotIn ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::StrictEqual, sym(3).Expression);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+./
+
+EqualityExpressionNotIn: EqualityExpressionNotIn T_NOT_EQ_EQ RelationalExpressionNotIn ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::StrictNotEqual, sym(3).Expression);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+./
+
+BitwiseANDExpression: EqualityExpression ;
+
+BitwiseANDExpression: BitwiseANDExpression T_AND EqualityExpression ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::BitAnd, sym(3).Expression);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+./
+
+BitwiseANDExpressionNotIn: EqualityExpressionNotIn ;
+
+BitwiseANDExpressionNotIn: BitwiseANDExpressionNotIn T_AND EqualityExpressionNotIn ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::BitAnd, sym(3).Expression);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+./
+
+BitwiseXORExpression: BitwiseANDExpression ;
+
+BitwiseXORExpression: BitwiseXORExpression T_XOR BitwiseANDExpression ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::BitXor, sym(3).Expression);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+./
+
+BitwiseXORExpressionNotIn: BitwiseANDExpressionNotIn ;
+
+BitwiseXORExpressionNotIn: BitwiseXORExpressionNotIn T_XOR BitwiseANDExpressionNotIn ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::BitXor, sym(3).Expression);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+./
+
+BitwiseORExpression: BitwiseXORExpression ;
+
+BitwiseORExpression: BitwiseORExpression T_OR BitwiseXORExpression ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::BitOr, sym(3).Expression);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+./
+
+BitwiseORExpressionNotIn: BitwiseXORExpressionNotIn ;
+
+BitwiseORExpressionNotIn: BitwiseORExpressionNotIn T_OR BitwiseXORExpressionNotIn ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::BitOr, sym(3).Expression);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+./
+
+LogicalANDExpression: BitwiseORExpression ;
+
+LogicalANDExpression: LogicalANDExpression T_AND_AND BitwiseORExpression ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::And, sym(3).Expression);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+./
+
+LogicalANDExpressionNotIn: BitwiseORExpressionNotIn ;
+
+LogicalANDExpressionNotIn: LogicalANDExpressionNotIn T_AND_AND BitwiseORExpressionNotIn ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::And, sym(3).Expression);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+./
+
+LogicalORExpression: LogicalANDExpression ;
+
+LogicalORExpression: LogicalORExpression T_OR_OR LogicalANDExpression ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Or, sym(3).Expression);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+./
+
+LogicalORExpressionNotIn: LogicalANDExpressionNotIn ;
+
+LogicalORExpressionNotIn: LogicalORExpressionNotIn T_OR_OR LogicalANDExpressionNotIn ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Or, sym(3).Expression);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+./
+
+ConditionalExpression: LogicalORExpression ;
+
+ConditionalExpression: LogicalORExpression T_QUESTION AssignmentExpression T_COLON AssignmentExpression ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::ConditionalExpression> (driver->nodePool(), sym(1).Expression, sym(3).Expression, sym(5).Expression);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+./
+
+ConditionalExpressionNotIn: LogicalORExpressionNotIn ;
+
+ConditionalExpressionNotIn: LogicalORExpressionNotIn T_QUESTION AssignmentExpressionNotIn T_COLON AssignmentExpressionNotIn ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::ConditionalExpression> (driver->nodePool(), sym(1).Expression, sym(3).Expression, sym(5).Expression);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+./
+
+AssignmentExpression: ConditionalExpression ;
+
+AssignmentExpression: LeftHandSideExpression AssignmentOperator AssignmentExpression ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, sym(2).ival, sym(3).Expression);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+./
+
+AssignmentExpressionNotIn: ConditionalExpressionNotIn ;
+
+AssignmentExpressionNotIn: LeftHandSideExpression AssignmentOperator AssignmentExpressionNotIn ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, sym(2).ival, sym(3).Expression);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+./
+
+AssignmentOperator: T_EQ ;
+/.
+case $rule_number: {
+  sym(1).ival = QSOperator::Assign;
+} break;
+./
+
+AssignmentOperator: T_STAR_EQ ;
+/.
+case $rule_number: {
+  sym(1).ival = QSOperator::InplaceMul;
+} break;
+./
+
+AssignmentOperator: T_DIVIDE_EQ ;
+/.
+case $rule_number: {
+  sym(1).ival = QSOperator::InplaceDiv;
+} break;
+./
+
+AssignmentOperator: T_REMAINDER_EQ ;
+/.
+case $rule_number: {
+  sym(1).ival = QSOperator::InplaceMod;
+} break;
+./
+
+AssignmentOperator: T_PLUS_EQ ;
+/.
+case $rule_number: {
+  sym(1).ival = QSOperator::InplaceAdd;
+} break;
+./
+
+AssignmentOperator: T_MINUS_EQ ;
+/.
+case $rule_number: {
+  sym(1).ival = QSOperator::InplaceSub;
+} break;
+./
+
+AssignmentOperator: T_LT_LT_EQ ;
+/.
+case $rule_number: {
+  sym(1).ival = QSOperator::InplaceLeftShift;
+} break;
+./
+
+AssignmentOperator: T_GT_GT_EQ ;
+/.
+case $rule_number: {
+  sym(1).ival = QSOperator::InplaceRightShift;
+} break;
+./
+
+AssignmentOperator: T_GT_GT_GT_EQ ;
+/.
+case $rule_number: {
+  sym(1).ival = QSOperator::InplaceURightShift;
+} break;
+./
+
+AssignmentOperator: T_AND_EQ ;
+/.
+case $rule_number: {
+  sym(1).ival = QSOperator::InplaceAnd;
+} break;
+./
+
+AssignmentOperator: T_XOR_EQ ;
+/.
+case $rule_number: {
+  sym(1).ival = QSOperator::InplaceXor;
+} break;
+./
+
+AssignmentOperator: T_OR_EQ ;
+/.
+case $rule_number: {
+  sym(1).ival = QSOperator::InplaceOr;
+} break;
+./
+
+Expression: AssignmentExpression ;
+
+Expression: Expression T_COMMA AssignmentExpression ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::Expression> (driver->nodePool(), sym(1).Expression, sym(3).Expression);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+./
+
+ExpressionOpt: ;
+/.
+case $rule_number: {
+  sym(1).Node = 0;
+} break;
+./
+
+ExpressionOpt: Expression ;
+
+ExpressionNotIn: AssignmentExpressionNotIn ;
+
+ExpressionNotIn: ExpressionNotIn T_COMMA AssignmentExpressionNotIn ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::Expression> (driver->nodePool(), sym(1).Expression, sym(3).Expression);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+./
+
+ExpressionNotInOpt: ;
+/.
+case $rule_number: {
+  sym(1).Node = 0;
+} break;
+./
+
+ExpressionNotInOpt: ExpressionNotIn ;
+
+Statement: Block ;
+Statement: VariableStatement ;
+Statement: EmptyStatement ;
+Statement: ExpressionStatement ;
+Statement: IfStatement ;
+Statement: IterationStatement ;
+Statement: ContinueStatement ;
+Statement: BreakStatement ;
+Statement: ReturnStatement ;
+Statement: WithStatement ;
+Statement: LabelledStatement ;
+Statement: SwitchStatement ;
+Statement: ThrowStatement ;
+Statement: TryStatement ;
+Statement: DebuggerStatement ;
+
+
+Block: T_LBRACE StatementListOpt T_RBRACE ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::Block> (driver->nodePool(), sym(2).StatementList);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+./
+
+StatementList: Statement ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::StatementList> (driver->nodePool(), sym(1).Statement);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
+} break;
+./
+
+StatementList: StatementList Statement ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::StatementList> (driver->nodePool(), sym(1).StatementList, sym(2).Statement);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
+} break;
+./
+
+StatementListOpt: ;
+/.
+case $rule_number: {
+  sym(1).Node = 0;
+} break;
+./
+
+StatementListOpt: StatementList ;
+/.
+case $rule_number: {
+  sym(1).Node = sym(1).StatementList->finish ();
+} break;
+./
+
+VariableStatement: VariableDeclarationKind VariableDeclarationList T_AUTOMATIC_SEMICOLON ;  -- automatic semicolon
+VariableStatement: VariableDeclarationKind VariableDeclarationList T_SEMICOLON ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::VariableStatement> (driver->nodePool(), sym(2).VariableDeclarationList->finish (/*readOnly=*/sym(1).ival == T_CONST));
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+./
+
+VariableDeclarationKind: T_CONST ;
+/.
+case $rule_number: {
+  sym(1).ival = T_CONST;
+} break;
+./
+
+VariableDeclarationKind: T_VAR ;
+/.
+case $rule_number: {
+  sym(1).ival = T_VAR;
+} break;
+./
+
+VariableDeclarationList: VariableDeclaration ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::VariableDeclarationList> (driver->nodePool(), sym(1).VariableDeclaration);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
+} break;
+./
+
+VariableDeclarationList: VariableDeclarationList T_COMMA VariableDeclaration ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::VariableDeclarationList> (driver->nodePool(), sym(1).VariableDeclarationList, sym(3).VariableDeclaration);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+./
+
+VariableDeclarationListNotIn: VariableDeclarationNotIn ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::VariableDeclarationList> (driver->nodePool(), sym(1).VariableDeclaration);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
+} break;
+./
+
+VariableDeclarationListNotIn: VariableDeclarationListNotIn T_COMMA VariableDeclarationNotIn ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::VariableDeclarationList> (driver->nodePool(), sym(1).VariableDeclarationList, sym(3).VariableDeclaration);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+./
+
+VariableDeclaration: T_IDENTIFIER InitialiserOpt ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::VariableDeclaration> (driver->nodePool(), sym(1).sval, sym(2).Expression);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
+} break;
+./
+
+VariableDeclarationNotIn: T_IDENTIFIER InitialiserNotInOpt ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::VariableDeclaration> (driver->nodePool(), sym(1).sval, sym(2).Expression);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
+} break;
+./
+
+Initialiser: T_EQ AssignmentExpression ;
+/.
+case $rule_number: {
+  sym(1) = sym(2);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
+} break;
+./
+
+InitialiserOpt: ;
+/.
+case $rule_number: {
+  sym(1).Node = 0;
+} break;
+./
+
+InitialiserOpt: Initialiser ;
+
+InitialiserNotIn: T_EQ AssignmentExpressionNotIn ;
+/.
+case $rule_number: {
+  sym(1) = sym(2);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
+} break;
+./
+
+InitialiserNotInOpt: ;
+/.
+case $rule_number: {
+  sym(1).Node = 0;
+} break;
+./
+
+InitialiserNotInOpt: InitialiserNotIn ;
+
+EmptyStatement: T_SEMICOLON ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::EmptyStatement> (driver->nodePool());
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
+} break;
+./
+
+ExpressionStatement: Expression T_AUTOMATIC_SEMICOLON ;  -- automatic semicolon
+ExpressionStatement: Expression T_SEMICOLON ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::ExpressionStatement> (driver->nodePool(), sym(1).Expression);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
+} break;
+./
+
+IfStatement: T_IF T_LPAREN Expression T_RPAREN Statement T_ELSE Statement ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::IfStatement> (driver->nodePool(), sym(3).Expression, sym(5).Statement, sym(7).Statement);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(7));
+} break;
+./
+
+IfStatement: T_IF T_LPAREN Expression T_RPAREN Statement ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::IfStatement> (driver->nodePool(), sym(3).Expression, sym(5).Statement);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(5));
+} break;
+./
+
+
+IterationStatement: T_DO Statement T_WHILE T_LPAREN Expression T_RPAREN T_AUTOMATIC_SEMICOLON ;  -- automatic semicolon
+IterationStatement: T_DO Statement T_WHILE T_LPAREN Expression T_RPAREN T_SEMICOLON ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::DoWhileStatement> (driver->nodePool(), sym(2).Statement, sym(5).Expression);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(7));
+} break;
+./
+
+IterationStatement: T_WHILE T_LPAREN Expression T_RPAREN Statement ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::WhileStatement> (driver->nodePool(), sym(3).Expression, sym(5).Statement);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(5));
+} break;
+./
+
+IterationStatement: T_FOR T_LPAREN ExpressionNotInOpt T_SEMICOLON ExpressionOpt T_SEMICOLON ExpressionOpt T_RPAREN Statement ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::ForStatement> (driver->nodePool(), sym(3).Expression, sym(5).Expression, sym(7).Expression, sym(9).Statement);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(9));
+} break;
+./
+
+IterationStatement: T_FOR T_LPAREN T_VAR VariableDeclarationListNotIn T_SEMICOLON ExpressionOpt T_SEMICOLON ExpressionOpt T_RPAREN Statement ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::LocalForStatement> (driver->nodePool(), sym(4).VariableDeclarationList->finish (/*readOnly=*/false), sym(6).Expression, sym(8).Expression, sym(10).Statement);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(10));
+} break;
+./
+
+IterationStatement: T_FOR T_LPAREN LeftHandSideExpression T_IN Expression T_RPAREN Statement ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::ForEachStatement> (driver->nodePool(), sym(3).Expression, sym(5).Expression, sym(7).Statement);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(7));
+} break;
+./
+
+IterationStatement: T_FOR T_LPAREN T_VAR VariableDeclarationNotIn T_IN Expression T_RPAREN Statement ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::LocalForEachStatement> (driver->nodePool(), sym(4).VariableDeclaration, sym(6).Expression, sym(8).Statement);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(8));
+} break;
+./
+
+ContinueStatement: T_CONTINUE T_AUTOMATIC_SEMICOLON ;  -- automatic semicolon
+ContinueStatement: T_CONTINUE T_SEMICOLON ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::ContinueStatement> (driver->nodePool());
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
+} break;
+./
+
+ContinueStatement: T_CONTINUE T_IDENTIFIER T_AUTOMATIC_SEMICOLON ;  -- automatic semicolon
+ContinueStatement: T_CONTINUE T_IDENTIFIER T_SEMICOLON ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::ContinueStatement> (driver->nodePool(), sym(2).sval);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+./
+
+BreakStatement: T_BREAK T_AUTOMATIC_SEMICOLON ;  -- automatic semicolon
+BreakStatement: T_BREAK T_SEMICOLON ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::BreakStatement> (driver->nodePool());
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
+} break;
+./
+
+BreakStatement: T_BREAK T_IDENTIFIER T_AUTOMATIC_SEMICOLON ;  -- automatic semicolon
+BreakStatement: T_BREAK T_IDENTIFIER T_SEMICOLON ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::BreakStatement> (driver->nodePool(), sym(2).sval);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+./
+
+ReturnStatement: T_RETURN ExpressionOpt T_AUTOMATIC_SEMICOLON ;  -- automatic semicolon
+ReturnStatement: T_RETURN ExpressionOpt T_SEMICOLON ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::ReturnStatement> (driver->nodePool(), sym(2).Expression);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+./
+
+WithStatement: T_WITH T_LPAREN Expression T_RPAREN Statement ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::WithStatement> (driver->nodePool(), sym(3).Expression, sym(5).Statement);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(5));
+} break;
+./
+
+SwitchStatement: T_SWITCH T_LPAREN Expression T_RPAREN CaseBlock ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::SwitchStatement> (driver->nodePool(), sym(3).Expression, sym(5).CaseBlock);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(5));
+} break;
+./
+
+CaseBlock: T_LBRACE CaseClausesOpt T_RBRACE ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::CaseBlock> (driver->nodePool(), sym(2).CaseClauses);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+./
+
+CaseBlock: T_LBRACE CaseClausesOpt DefaultClause CaseClausesOpt T_RBRACE ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::CaseBlock> (driver->nodePool(), sym(2).CaseClauses, sym(3).DefaultClause, sym(4).CaseClauses);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(5));
+} break;
+./
+
+CaseClauses: CaseClause ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::CaseClauses> (driver->nodePool(), sym(1).CaseClause);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
+} break;
+./
+
+CaseClauses: CaseClauses CaseClause ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::CaseClauses> (driver->nodePool(), sym(1).CaseClauses, sym(2).CaseClause);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
+} break;
+./
+
+CaseClausesOpt: ;
+/.
+case $rule_number: {
+  sym(1).Node = 0;
+} break;
+./
+
+CaseClausesOpt: CaseClauses ;
+/.
+case $rule_number: {
+  sym(1).Node = sym(1).CaseClauses->finish ();
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
+} break;
+./
+
+CaseClause: T_CASE Expression T_COLON StatementListOpt ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::CaseClause> (driver->nodePool(), sym(2).Expression, sym(4).StatementList);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(4));
+} break;
+./
+
+DefaultClause: T_DEFAULT T_COLON StatementListOpt ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::DefaultClause> (driver->nodePool(), sym(3).StatementList);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+./
+
+LabelledStatement: T_IDENTIFIER T_COLON Statement ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::LabelledStatement> (driver->nodePool(), sym(1).sval, sym(3).Statement);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+./
+
+ThrowStatement: T_THROW Expression T_AUTOMATIC_SEMICOLON ;  -- automatic semicolon
+ThrowStatement: T_THROW Expression T_SEMICOLON ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::ThrowStatement> (driver->nodePool(), sym(2).Expression);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+./
+
+TryStatement: T_TRY Block Catch ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::TryStatement> (driver->nodePool(), sym(2).Statement, sym(3).Catch);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+./
+
+TryStatement: T_TRY Block Finally ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::TryStatement> (driver->nodePool(), sym(2).Statement, sym(3).Finally);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+./
+
+TryStatement: T_TRY Block Catch Finally ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::TryStatement> (driver->nodePool(), sym(2).Statement, sym(3).Catch, sym(4).Finally);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(4));
+} break;
+./
+
+Catch: T_CATCH T_LPAREN T_IDENTIFIER T_RPAREN Block ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::Catch> (driver->nodePool(), sym(3).sval, sym(5).Statement);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(5));
+} break;
+./
+
+Finally: T_FINALLY Block ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::Finally> (driver->nodePool(), sym(2).Statement);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
+} break;
+./
+
+DebuggerStatement: T_DEBUGGER T_AUTOMATIC_SEMICOLON ; -- automatic semicolon
+DebuggerStatement: T_DEBUGGER T_SEMICOLON ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::DebuggerStatement> (driver->nodePool());
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
+} break;
+./
+
+FunctionDeclaration: T_FUNCTION T_IDENTIFIER T_LPAREN FormalParameterListOpt T_RPAREN T_LBRACE FunctionBodyOpt T_RBRACE ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::FunctionDeclaration> (driver->nodePool(), sym(2).sval, sym(4).FormalParameterList, sym(7).FunctionBody);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(8));
+} break;
+./
+
+FunctionExpression: T_FUNCTION IdentifierOpt T_LPAREN FormalParameterListOpt T_RPAREN T_LBRACE FunctionBodyOpt T_RBRACE ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::FunctionExpression> (driver->nodePool(), sym(2).sval, sym(4).FormalParameterList, sym(7).FunctionBody);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(8));
+} break;
+./
+
+FormalParameterList: T_IDENTIFIER ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::FormalParameterList> (driver->nodePool(), sym(1).sval);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
+} break;
+./
+
+FormalParameterList: FormalParameterList T_COMMA T_IDENTIFIER ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::FormalParameterList> (driver->nodePool(), sym(1).FormalParameterList, sym(3).sval);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+./
+
+FormalParameterListOpt: ;
+/.
+case $rule_number: {
+  sym(1).Node = 0;
+} break;
+./
+
+FormalParameterListOpt: FormalParameterList ;
+/.
+case $rule_number: {
+  sym(1).Node = sym(1).FormalParameterList->finish ();
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
+} break;
+./
+
+FunctionBodyOpt: ;
+/.
+case $rule_number: {
+  sym(1).Node = 0;
+} break;
+./
+
+FunctionBodyOpt: FunctionBody ;
+
+FunctionBody: SourceElements ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::FunctionBody> (driver->nodePool(), sym(1).SourceElements->finish ());
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
+} break;
+./
+
+Program: SourceElements ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::Program> (driver->nodePool(), sym(1).SourceElements->finish ());
+  driver->changeAbstractSyntaxTree(sym(1).Node);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
+} break;
+./
+
+SourceElements: SourceElement ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::SourceElements> (driver->nodePool(), sym(1).SourceElement);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
+} break;
+./
+
+SourceElements: SourceElements SourceElement ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::SourceElements> (driver->nodePool(), sym(1).SourceElements, sym(2).SourceElement);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
+} break;
+./
+
+SourceElement: Statement ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::StatementSourceElement> (driver->nodePool(), sym(1).Statement);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
+} break;
+./
+
+SourceElement: FunctionDeclaration ;
+/.
+case $rule_number: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::FunctionSourceElement> (driver->nodePool(), sym(1).FunctionDeclaration);
+  J_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
+} break;
+./
+
+IdentifierOpt: ;
+/.
+case $rule_number: {
+  sym(1).sval = 0;
+} break;
+./
+
+IdentifierOpt: T_IDENTIFIER ;
+
+PropertyNameAndValueListOpt: ;
+/.
+case $rule_number: {
+  sym(1).Node = 0;
+} break;
+./
+
+PropertyNameAndValueListOpt: PropertyNameAndValueList ;
+
+/.
+          } // switch
+
+          state_stack [tos] = nt_action (act, lhs [r] - TERMINAL_COUNT);
+
+          if (rhs[r] > 1) {
+              location_stack[tos - 1].endLine = location_stack[tos + rhs[r] - 2].endLine;
+              location_stack[tos - 1].endColumn = location_stack[tos + rhs[r] - 2].endColumn;
+              location_stack[tos] = location_stack[tos + rhs[r] - 1];
+          }
+        }
+
+      else
+        {
+          if (saved_yytoken == -1 && automatic (driver, yytoken) && t_action (state, T_AUTOMATIC_SEMICOLON) > 0)
+            {
+              saved_yytoken = yytoken;
+              yytoken = T_SEMICOLON;
+              continue;
+            }
+
+          else if ((state == INITIAL_STATE) && (yytoken == 0)) {
+              // accept empty input
+              yytoken = T_SEMICOLON;
+              continue;
+          }
+
+          int ers = state;
+          int shifts = 0;
+          int reduces = 0;
+          int expected_tokens [3];
+          for (int tk = 0; tk < TERMINAL_COUNT; ++tk)
+            {
+              int k = t_action (ers, tk);
+
+              if (! k)
+                continue;
+              else if (k < 0)
+                ++reduces;
+              else if (spell [tk])
+                {
+                  if (shifts < 3)
+                    expected_tokens [shifts] = tk;
+                  ++shifts;
+                }
+            }
+
+          error_message.clear ();
+          if (shifts && shifts < 3)
+            {
+              bool first = true;
+
+              for (int s = 0; s < shifts; ++s)
+                {
+                  if (first)
+                    error_message += QLatin1String ("Expected ");
+                  else
+                    error_message += QLatin1String (", ");
+
+                  first = false;
+                  error_message += QLatin1String("`");
+                  error_message += QLatin1String (spell [expected_tokens [s]]);
+                  error_message += QLatin1String("'");
+                }
+            }
+
+          if (error_message.isEmpty())
+              error_message = lexer->errorMessage();
+
+          error_lineno = lexer->startLineNo();
+          error_column = lexer->startColumnNo();
+
+          return false;
+        }
+    }
+
+    return false;
+}
+
+QT_END_NAMESPACE
+
+
+./
+/:
+QT_END_NAMESPACE
+
+
+
+#endif // JAVASCRIPTPARSER_P_H
+:/
diff --git a/src/plugins/qtscripteditor/parser/javascriptast.cpp b/src/plugins/qtscripteditor/parser/javascriptast.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..388f6e2385da1600c56a73812076420a4c358e33
--- /dev/null
+++ b/src/plugins/qtscripteditor/parser/javascriptast.cpp
@@ -0,0 +1,789 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the QtScript module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain
+** additional rights. These rights are described in the Nokia Qt LGPL
+** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "javascriptast_p.h"
+
+
+
+#include "javascriptastvisitor_p.h"
+
+QT_BEGIN_NAMESPACE
+
+namespace JavaScript { namespace AST {
+
+ExpressionNode *Node::expressionCast()
+{
+    return 0;
+}
+
+BinaryExpression *Node::binaryExpressionCast()
+{
+    return 0;
+}
+
+Statement *Node::statementCast()
+{
+    return 0;
+}
+
+ExpressionNode *ExpressionNode::expressionCast()
+{
+    return this;
+}
+
+BinaryExpression *BinaryExpression::binaryExpressionCast()
+{
+    return this;
+}
+
+Statement *Statement::statementCast()
+{
+    return this;
+}
+
+void ThisExpression::accept0(Visitor *visitor)
+{
+    if (visitor->visit(this)) {
+    }
+
+    visitor->endVisit(this);
+}
+
+void IdentifierExpression::accept0(Visitor *visitor)
+{
+    if (visitor->visit(this)) {
+    }
+
+    visitor->endVisit(this);
+}
+
+void NullExpression::accept0(Visitor *visitor)
+{
+    if (visitor->visit(this)) {
+    }
+
+    visitor->endVisit(this);
+}
+
+void TrueLiteral::accept0(Visitor *visitor)
+{
+    if (visitor->visit(this)) {
+    }
+
+    visitor->endVisit(this);
+}
+
+void FalseLiteral::accept0(Visitor *visitor)
+{
+    if (visitor->visit(this)) {
+    }
+
+    visitor->endVisit(this);
+}
+
+void StringLiteral::accept0(Visitor *visitor)
+{
+    if (visitor->visit(this)) {
+    }
+
+    visitor->endVisit(this);
+}
+
+void NumericLiteral::accept0(Visitor *visitor)
+{
+    if (visitor->visit(this)) {
+    }
+
+    visitor->endVisit(this);
+}
+
+void RegExpLiteral::accept0(Visitor *visitor)
+{
+    if (visitor->visit(this)) {
+    }
+
+    visitor->endVisit(this);
+}
+
+void ArrayLiteral::accept0(Visitor *visitor)
+{
+    if (visitor->visit(this)) {
+        acceptChild(elements, visitor);
+        acceptChild(elision, visitor);
+    }
+
+    visitor->endVisit(this);
+}
+
+void ObjectLiteral::accept0(Visitor *visitor)
+{
+    if (visitor->visit(this)) {
+        acceptChild(properties, visitor);
+    }
+
+    visitor->endVisit(this);
+}
+
+void ElementList::accept0(Visitor *visitor)
+{
+    if (visitor->visit(this)) {
+        ElementList *it = this;
+        do {
+            acceptChild(it->elision, visitor);
+            acceptChild(it->expression, visitor);
+            it = it->next;
+        } while (it);
+    }
+
+    visitor->endVisit(this);
+}
+
+void Elision::accept0(Visitor *visitor)
+{
+    if (visitor->visit(this)) {
+        // ###
+    }
+
+    visitor->endVisit(this);
+}
+
+void PropertyNameAndValueList::accept0(Visitor *visitor)
+{
+    if (visitor->visit(this)) {
+        PropertyNameAndValueList *it = this;
+        do {
+            acceptChild(it->name, visitor);
+            acceptChild(it->value, visitor);
+            it = it->next;
+        } while (it);
+    }
+
+    visitor->endVisit(this);
+}
+
+void IdentifierPropertyName::accept0(Visitor *visitor)
+{
+    if (visitor->visit(this)) {
+    }
+
+    visitor->endVisit(this);
+}
+
+void StringLiteralPropertyName::accept0(Visitor *visitor)
+{
+    if (visitor->visit(this)) {
+    }
+
+    visitor->endVisit(this);
+}
+
+void NumericLiteralPropertyName::accept0(Visitor *visitor)
+{
+    if (visitor->visit(this)) {
+    }
+
+    visitor->endVisit(this);
+}
+
+void ArrayMemberExpression::accept0(Visitor *visitor)
+{
+    if (visitor->visit(this)) {
+        acceptChild(base, visitor);
+        acceptChild(expression, visitor);
+    }
+
+    visitor->endVisit(this);
+}
+
+void FieldMemberExpression::accept0(Visitor *visitor)
+{
+    if (visitor->visit(this)) {
+        acceptChild(base, visitor);
+    }
+
+    visitor->endVisit(this);
+}
+
+void NewMemberExpression::accept0(Visitor *visitor)
+{
+    if (visitor->visit(this)) {
+        acceptChild(base, visitor);
+        acceptChild(arguments, visitor);
+    }
+
+    visitor->endVisit(this);
+}
+
+void NewExpression::accept0(Visitor *visitor)
+{
+    if (visitor->visit(this)) {
+        acceptChild(expression, visitor);
+    }
+
+    visitor->endVisit(this);
+}
+
+void CallExpression::accept0(Visitor *visitor)
+{
+    if (visitor->visit(this)) {
+        acceptChild(base, visitor);
+        acceptChild(arguments, visitor);
+    }
+
+    visitor->endVisit(this);
+}
+
+void ArgumentList::accept0(Visitor *visitor)
+{
+    if (visitor->visit(this)) {
+        ArgumentList *it = this;
+        do {
+            acceptChild(it->expression, visitor);
+            it = it->next;
+        } while (it);
+    }
+
+    visitor->endVisit(this);
+}
+
+void PostIncrementExpression::accept0(Visitor *visitor)
+{
+    if (visitor->visit(this)) {
+        acceptChild(base, visitor);
+    }
+
+    visitor->endVisit(this);
+}
+
+void PostDecrementExpression::accept0(Visitor *visitor)
+{
+    if (visitor->visit(this)) {
+        acceptChild(base, visitor);
+    }
+
+    visitor->endVisit(this);
+}
+
+void DeleteExpression::accept0(Visitor *visitor)
+{
+    if (visitor->visit(this)) {
+        acceptChild(expression, visitor);
+    }
+
+    visitor->endVisit(this);
+}
+
+void VoidExpression::accept0(Visitor *visitor)
+{
+    if (visitor->visit(this)) {
+        acceptChild(expression, visitor);
+    }
+
+    visitor->endVisit(this);
+}
+
+void TypeOfExpression::accept0(Visitor *visitor)
+{
+    if (visitor->visit(this)) {
+        acceptChild(expression, visitor);
+    }
+
+    visitor->endVisit(this);
+}
+
+void PreIncrementExpression::accept0(Visitor *visitor)
+{
+    if (visitor->visit(this)) {
+        acceptChild(expression, visitor);
+    }
+
+    visitor->endVisit(this);
+}
+
+void PreDecrementExpression::accept0(Visitor *visitor)
+{
+    if (visitor->visit(this)) {
+        acceptChild(expression, visitor);
+    }
+
+    visitor->endVisit(this);
+}
+
+void UnaryPlusExpression::accept0(Visitor *visitor)
+{
+    if (visitor->visit(this)) {
+        acceptChild(expression, visitor);
+    }
+
+    visitor->endVisit(this);
+}
+
+void UnaryMinusExpression::accept0(Visitor *visitor)
+{
+    if (visitor->visit(this)) {
+        acceptChild(expression, visitor);
+    }
+
+    visitor->endVisit(this);
+}
+
+void TildeExpression::accept0(Visitor *visitor)
+{
+    if (visitor->visit(this)) {
+        acceptChild(expression, visitor);
+    }
+
+    visitor->endVisit(this);
+}
+
+void NotExpression::accept0(Visitor *visitor)
+{
+    if (visitor->visit(this)) {
+        acceptChild(expression, visitor);
+    }
+
+    visitor->endVisit(this);
+}
+
+void BinaryExpression::accept0(Visitor *visitor)
+{
+    if (visitor->visit(this)) {
+        acceptChild(left, visitor);
+        acceptChild(right, visitor);
+    }
+
+    visitor->endVisit(this);
+}
+
+void ConditionalExpression::accept0(Visitor *visitor)
+{
+    if (visitor->visit(this)) {
+        acceptChild(expression, visitor);
+        acceptChild(ok, visitor);
+        acceptChild(ko, visitor);
+    }
+
+    visitor->endVisit(this);
+}
+
+void Expression::accept0(Visitor *visitor)
+{
+    if (visitor->visit(this)) {
+        acceptChild(left, visitor);
+        acceptChild(right, visitor);
+    }
+
+    visitor->endVisit(this);
+}
+
+void Block::accept0(Visitor *visitor)
+{
+    if (visitor->visit(this)) {
+        acceptChild(statements, visitor);
+    }
+
+    visitor->endVisit(this);
+}
+
+void StatementList::accept0(Visitor *visitor)
+{
+    if (visitor->visit(this)) {
+        StatementList *it = this;
+        do {
+            acceptChild(it->statement, visitor);
+            it = it->next;
+        } while (it);
+    }
+
+    visitor->endVisit(this);
+}
+
+void VariableStatement::accept0(Visitor *visitor)
+{
+    if (visitor->visit(this)) {
+        acceptChild(declarations, visitor);
+    }
+
+    visitor->endVisit(this);
+}
+
+void VariableDeclarationList::accept0(Visitor *visitor)
+{
+    if (visitor->visit(this)) {
+        VariableDeclarationList *it = this;
+        do {
+            acceptChild(it->declaration, visitor);
+            it = it->next;
+        } while (it);
+    }
+
+    visitor->endVisit(this);
+}
+
+void VariableDeclaration::accept0(Visitor *visitor)
+{
+    if (visitor->visit(this)) {
+        acceptChild(expression, visitor);
+    }
+
+    visitor->endVisit(this);
+}
+
+void EmptyStatement::accept0(Visitor *visitor)
+{
+    if (visitor->visit(this)) {
+    }
+
+    visitor->endVisit(this);
+}
+
+void ExpressionStatement::accept0(Visitor *visitor)
+{
+    if (visitor->visit(this)) {
+        acceptChild(expression, visitor);
+    }
+
+    visitor->endVisit(this);
+}
+
+void IfStatement::accept0(Visitor *visitor)
+{
+    if (visitor->visit(this)) {
+        acceptChild(expression, visitor);
+        acceptChild(ok, visitor);
+        acceptChild(ko, visitor);
+    }
+
+    visitor->endVisit(this);
+}
+
+void DoWhileStatement::accept0(Visitor *visitor)
+{
+    if (visitor->visit(this)) {
+        acceptChild(statement, visitor);
+        acceptChild(expression, visitor);
+    }
+
+    visitor->endVisit(this);
+}
+
+void WhileStatement::accept0(Visitor *visitor)
+{
+    if (visitor->visit(this)) {
+        acceptChild(expression, visitor);
+        acceptChild(statement, visitor);
+    }
+
+    visitor->endVisit(this);
+}
+
+void ForStatement::accept0(Visitor *visitor)
+{
+    if (visitor->visit(this)) {
+        acceptChild(initialiser, visitor);
+        acceptChild(condition, visitor);
+        acceptChild(expression, visitor);
+        acceptChild(statement, visitor);
+    }
+
+    visitor->endVisit(this);
+}
+
+void LocalForStatement::accept0(Visitor *visitor)
+{
+    if (visitor->visit(this)) {
+        acceptChild(declarations, visitor);
+        acceptChild(condition, visitor);
+        acceptChild(expression, visitor);
+        acceptChild(statement, visitor);
+    }
+
+    visitor->endVisit(this);
+}
+
+void ForEachStatement::accept0(Visitor *visitor)
+{
+    if (visitor->visit(this)) {
+        acceptChild(initialiser, visitor);
+        acceptChild(expression, visitor);
+        acceptChild(statement, visitor);
+    }
+
+    visitor->endVisit(this);
+}
+
+void LocalForEachStatement::accept0(Visitor *visitor)
+{
+    if (visitor->visit(this)) {
+        acceptChild(declaration, visitor);
+        acceptChild(expression, visitor);
+        acceptChild(statement, visitor);
+    }
+
+    visitor->endVisit(this);
+}
+
+void ContinueStatement::accept0(Visitor *visitor)
+{
+    if (visitor->visit(this)) {
+    }
+
+    visitor->endVisit(this);
+}
+
+void BreakStatement::accept0(Visitor *visitor)
+{
+    if (visitor->visit(this)) {
+    }
+
+    visitor->endVisit(this);
+}
+
+void ReturnStatement::accept0(Visitor *visitor)
+{
+    if (visitor->visit(this)) {
+        acceptChild(expression, visitor);
+    }
+
+    visitor->endVisit(this);
+}
+
+void WithStatement::accept0(Visitor *visitor)
+{
+    if (visitor->visit(this)) {
+        acceptChild(expression, visitor);
+        acceptChild(statement, visitor);
+    }
+
+    visitor->endVisit(this);
+}
+
+void SwitchStatement::accept0(Visitor *visitor)
+{
+    if (visitor->visit(this)) {
+        acceptChild(expression, visitor);
+        acceptChild(block, visitor);
+    }
+
+    visitor->endVisit(this);
+}
+
+void CaseBlock::accept0(Visitor *visitor)
+{
+    if (visitor->visit(this)) {
+        acceptChild(clauses, visitor);
+        acceptChild(defaultClause, visitor);
+        acceptChild(moreClauses, visitor);
+    }
+
+    visitor->endVisit(this);
+}
+
+void CaseClauses::accept0(Visitor *visitor)
+{
+    if (visitor->visit(this)) {
+        CaseClauses *it = this;
+        do {
+            acceptChild(it->clause, visitor);
+            it = it->next;
+        } while (it);
+    }
+
+    visitor->endVisit(this);
+}
+
+void CaseClause::accept0(Visitor *visitor)
+{
+    if (visitor->visit(this)) {
+        acceptChild(expression, visitor);
+        acceptChild(statements, visitor);
+    }
+
+    visitor->endVisit(this);
+}
+
+void DefaultClause::accept0(Visitor *visitor)
+{
+    if (visitor->visit(this)) {
+        acceptChild(statements, visitor);
+    }
+
+    visitor->endVisit(this);
+}
+
+void LabelledStatement::accept0(Visitor *visitor)
+{
+    if (visitor->visit(this)) {
+        acceptChild(statement, visitor);
+    }
+
+    visitor->endVisit(this);
+}
+
+void ThrowStatement::accept0(Visitor *visitor)
+{
+    if (visitor->visit(this)) {
+        acceptChild(expression, visitor);
+    }
+
+    visitor->endVisit(this);
+}
+
+void TryStatement::accept0(Visitor *visitor)
+{
+    if (visitor->visit(this)) {
+        acceptChild(statement, visitor);
+        acceptChild(catchExpression, visitor);
+        acceptChild(finallyExpression, visitor);
+    }
+
+    visitor->endVisit(this);
+}
+
+void Catch::accept0(Visitor *visitor)
+{
+    if (visitor->visit(this)) {
+        acceptChild(statement, visitor);
+    }
+
+    visitor->endVisit(this);
+}
+
+void Finally::accept0(Visitor *visitor)
+{
+    if (visitor->visit(this)) {
+        acceptChild(statement, visitor);
+    }
+
+    visitor->endVisit(this);
+}
+
+void FunctionDeclaration::accept0(Visitor *visitor)
+{
+    if (visitor->visit(this)) {
+        acceptChild(formals, visitor);
+        acceptChild(body, visitor);
+    }
+
+    visitor->endVisit(this);
+}
+
+void FunctionExpression::accept0(Visitor *visitor)
+{
+    if (visitor->visit(this)) {
+        acceptChild(formals, visitor);
+        acceptChild(body, visitor);
+    }
+
+    visitor->endVisit(this);
+}
+
+void FormalParameterList::accept0(Visitor *visitor)
+{
+    if (visitor->visit(this)) {
+        // ###
+    }
+
+    visitor->endVisit(this);
+}
+
+void FunctionBody::accept0(Visitor *visitor)
+{
+    if (visitor->visit(this)) {
+        acceptChild(elements, visitor);
+    }
+
+    visitor->endVisit(this);
+}
+
+void Program::accept0(Visitor *visitor)
+{
+    if (visitor->visit(this)) {
+        acceptChild(elements, visitor);
+    }
+
+    visitor->endVisit(this);
+}
+
+void SourceElements::accept0(Visitor *visitor)
+{
+    if (visitor->visit(this)) {
+        SourceElements *it = this;
+        do {
+            acceptChild(it->element, visitor);
+            it = it->next;
+        } while (it);
+    }
+
+    visitor->endVisit(this);
+}
+
+void FunctionSourceElement::accept0(Visitor *visitor)
+{
+    if (visitor->visit(this)) {
+        acceptChild(declaration, visitor);
+    }
+
+    visitor->endVisit(this);
+}
+
+void StatementSourceElement::accept0(Visitor *visitor)
+{
+    if (visitor->visit(this)) {
+        acceptChild(statement, visitor);
+    }
+
+    visitor->endVisit(this);
+}
+
+void DebuggerStatement::accept0(Visitor *visitor)
+{
+    if (visitor->visit(this)) {
+    }
+
+    visitor->endVisit(this);
+}
+
+} } // namespace JavaScript::AST
+
+QT_END_NAMESPACE
+
+
diff --git a/src/plugins/qtscripteditor/parser/javascriptast_p.h b/src/plugins/qtscripteditor/parser/javascriptast_p.h
new file mode 100644
index 0000000000000000000000000000000000000000..42b81c4ebe920de9b3bad6cd473f01e957078b21
--- /dev/null
+++ b/src/plugins/qtscripteditor/parser/javascriptast_p.h
@@ -0,0 +1,1502 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the QtScript module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain
+** additional rights. These rights are described in the Nokia Qt LGPL
+** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef JAVASCRIPTAST_P_H
+#define JAVASCRIPTAST_P_H
+
+//
+//  W A R N I N G
+//  -------------
+//
+// This file is not part of the Qt API.  It exists purely as an
+// implementation detail.  This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtCore/QString>
+
+
+
+#include "javascriptastvisitor_p.h"
+
+QT_BEGIN_NAMESPACE
+
+class JavaScriptNameIdImpl;
+
+namespace QSOperator // ### rename
+{
+
+enum Op {
+    Add,
+    And,
+    InplaceAnd,
+    Assign,
+    BitAnd,
+    BitOr,
+    BitXor,
+    InplaceSub,
+    Div,
+    InplaceDiv,
+    Equal,
+    Ge,
+    Gt,
+    In,
+    InplaceAdd,
+    InstanceOf,
+    Le,
+    LShift,
+    InplaceLeftShift,
+    Lt,
+    Mod,
+    InplaceMod,
+    Mul,
+    InplaceMul,
+    NotEqual,
+    Or,
+    InplaceOr,
+    RShift,
+    InplaceRightShift,
+    StrictEqual,
+    StrictNotEqual,
+    Sub,
+    URShift,
+    InplaceURightShift,
+    InplaceXor
+};
+
+} // namespace QSOperator
+
+namespace JavaScript { namespace AST {
+
+class Node
+{
+public:
+    enum Kind {
+        Kind_Node,
+        Kind_ExpressionNode,
+        Kind_Statement,
+        Kind_ThisExpression,
+        Kind_IdentifierExpression,
+        Kind_NullExpression,
+        Kind_TrueLiteral,
+        Kind_FalseLiteral,
+        Kind_NumericLiteral,
+        Kind_StringLiteral,
+        Kind_RegExpLiteral,
+        Kind_ArrayLiteral,
+        Kind_ObjectLiteral,
+        Kind_ElementList,
+        Kind_Elision,
+        Kind_PropertyNameAndValueList,
+        Kind_PropertyName,
+        Kind_IdentifierPropertyName,
+        Kind_StringLiteralPropertyName,
+        Kind_NumericLiteralPropertyName,
+        Kind_ArrayMemberExpression,
+        Kind_FieldMemberExpression,
+        Kind_NewMemberExpression,
+        Kind_NewExpression,
+        Kind_CallExpression,
+        Kind_ArgumentList,
+        Kind_PostIncrementExpression,
+        Kind_PostDecrementExpression,
+        Kind_DeleteExpression,
+        Kind_VoidExpression,
+        Kind_TypeOfExpression,
+        Kind_PreIncrementExpression,
+        Kind_PreDecrementExpression,
+        Kind_UnaryPlusExpression,
+        Kind_UnaryMinusExpression,
+        Kind_TildeExpression,
+        Kind_NotExpression,
+        Kind_BinaryExpression,
+        Kind_ConditionalExpression,
+        Kind_Expression,
+        Kind_Block,
+        Kind_StatementList,
+        Kind_VariableStatement,
+        Kind_VariableDeclarationList,
+        Kind_VariableDeclaration,
+        Kind_EmptyStatement,
+        Kind_ExpressionStatement,
+        Kind_IfStatement,
+        Kind_DoWhileStatement,
+        Kind_WhileStatement,
+        Kind_ForStatement,
+        Kind_LocalForStatement,
+        Kind_ForEachStatement,
+        Kind_LocalForEachStatement,
+        Kind_ContinueStatement,
+        Kind_BreakStatement,
+        Kind_ReturnStatement,
+        Kind_WithStatement,
+        Kind_SwitchStatement,
+        Kind_CaseBlock,
+        Kind_CaseClauses,
+        Kind_CaseClause,
+        Kind_DefaultClause,
+        Kind_LabelledStatement,
+        Kind_ThrowStatement,
+        Kind_TryStatement,
+        Kind_Catch,
+        Kind_Finally,
+        Kind_FunctionDeclaration,
+        Kind_FunctionExpression,
+        Kind_FormalParameterList,
+        Kind_FunctionBody,
+        Kind_Program,
+        Kind_SourceElements,
+        Kind_SourceElement,
+        Kind_FunctionSourceElement,
+        Kind_StatementSourceElement,
+        Kind_DebuggerStatement
+    };
+
+    inline Node():
+        startLine(0), startColumn(0),
+        endLine(0), endColumn(0), kind(Kind_Node) {}
+
+    virtual ~Node() {}
+
+    virtual ExpressionNode *expressionCast();
+    virtual BinaryExpression *binaryExpressionCast();
+    virtual Statement *statementCast();
+
+    inline void accept(Visitor *visitor)
+    {
+        if (visitor->preVisit(this)) {
+            accept0(visitor);
+            visitor->postVisit(this);
+        }
+    }
+
+    static void acceptChild(Node *node, Visitor *visitor)
+    {
+        if (node)
+            node->accept(visitor);
+    }
+
+    virtual void accept0(Visitor *visitor) = 0;
+
+    int startLine;
+    int startColumn;
+    int endLine;
+    int endColumn;
+    Kind kind;
+};
+
+class ExpressionNode: public Node
+{
+public:
+    ExpressionNode() { kind = Kind_ExpressionNode; }
+    virtual ~ExpressionNode() {}
+
+    virtual ExpressionNode *expressionCast();
+};
+
+class Statement: public Node
+{
+public:
+    Statement() { kind = Kind_Statement; }
+    virtual ~Statement() {}
+
+    virtual Statement *statementCast();
+};
+
+class ThisExpression: public ExpressionNode
+{
+public:
+    ThisExpression() { kind = Kind_ThisExpression; }
+    virtual ~ThisExpression() {}
+
+    virtual void accept0(Visitor *visitor);
+};
+
+class IdentifierExpression: public ExpressionNode
+{
+public:
+    IdentifierExpression(JavaScriptNameIdImpl *n):
+        name (n) { kind = Kind_IdentifierExpression; }
+
+    virtual ~IdentifierExpression() {}
+
+    virtual void accept0(Visitor *visitor);
+
+// attributes
+    JavaScriptNameIdImpl *name;
+};
+
+class NullExpression: public ExpressionNode
+{
+public:
+    NullExpression() { kind = Kind_NullExpression; }
+    virtual ~NullExpression() {}
+
+    virtual void accept0(Visitor *visitor);
+};
+
+class TrueLiteral: public ExpressionNode
+{
+public:
+    TrueLiteral() { kind = Kind_TrueLiteral; }
+    virtual ~TrueLiteral() {}
+
+    virtual void accept0(Visitor *visitor);
+};
+
+class FalseLiteral: public ExpressionNode
+{
+public:
+    FalseLiteral() { kind = Kind_FalseLiteral; }
+    virtual ~FalseLiteral() {}
+
+    virtual void accept0(Visitor *visitor);
+};
+
+class NumericLiteral: public ExpressionNode
+{
+public:
+    NumericLiteral(double v):
+        value (v) { kind = Kind_NumericLiteral; }
+    virtual ~NumericLiteral() {}
+
+    virtual void accept0(Visitor *visitor);
+
+// attributes:
+    double value;
+};
+
+class StringLiteral: public ExpressionNode
+{
+public:
+    StringLiteral(JavaScriptNameIdImpl *v):
+        value (v) { kind = Kind_StringLiteral; }
+
+    virtual ~StringLiteral() {}
+
+    virtual void accept0(Visitor *visitor);
+
+// attributes:
+    JavaScriptNameIdImpl *value;
+};
+
+class RegExpLiteral: public ExpressionNode
+{
+public:
+    RegExpLiteral(JavaScriptNameIdImpl *p, int f):
+        pattern (p), flags (f) { kind = Kind_RegExpLiteral; }
+
+    virtual ~RegExpLiteral() {}
+
+    virtual void accept0(Visitor *visitor);
+
+// attributes:
+    JavaScriptNameIdImpl *pattern;
+    int flags;
+};
+
+class ArrayLiteral: public ExpressionNode
+{
+public:
+    ArrayLiteral(Elision *e):
+        elements (0), elision (e)
+        { kind = Kind_ArrayLiteral; }
+
+    ArrayLiteral(ElementList *elts):
+        elements (elts), elision (0)
+        { kind = Kind_ArrayLiteral; }
+
+    ArrayLiteral(ElementList *elts, Elision *e):
+        elements (elts), elision (e)
+        { kind = Kind_ArrayLiteral; }
+
+    virtual ~ArrayLiteral() {}
+
+    virtual void accept0(Visitor *visitor);
+
+// attributes
+    ElementList *elements;
+    Elision *elision;
+};
+
+class ObjectLiteral: public ExpressionNode
+{
+public:
+    ObjectLiteral():
+        properties (0) { kind = Kind_ObjectLiteral; }
+
+    ObjectLiteral(PropertyNameAndValueList *plist):
+        properties (plist) { kind = Kind_ObjectLiteral; }
+
+    virtual ~ObjectLiteral() {}
+
+    virtual void accept0(Visitor *visitor);
+
+// attributes
+    PropertyNameAndValueList *properties;
+};
+
+class ElementList: public Node
+{
+public:
+    ElementList(Elision *e, ExpressionNode *expr):
+        elision (e), expression (expr), next (this)
+        { kind = Kind_ElementList; }
+
+    ElementList(ElementList *previous, Elision *e, ExpressionNode *expr):
+        elision (e), expression (expr)
+    {
+        kind = Kind_ElementList;
+        next = previous->next;
+        previous->next = this;
+    }
+
+    virtual ~ElementList() {}
+
+    inline ElementList *finish ()
+    {
+        ElementList *front = next;
+        next = 0;
+        return front;
+    }
+
+    virtual void accept0(Visitor *visitor);
+
+// attributes
+    Elision *elision;
+    ExpressionNode *expression;
+    ElementList *next;
+};
+
+class Elision: public Node
+{
+public:
+    Elision():
+        next (this) { kind = Kind_Elision; }
+
+    Elision(Elision *previous)
+    {
+        kind = Kind_Elision;
+        next = previous->next;
+        previous->next = this;
+    }
+
+    virtual ~Elision() {}
+
+    virtual void accept0(Visitor *visitor);
+
+    inline Elision *finish ()
+    {
+        Elision *front = next;
+        next = 0;
+        return front;
+    }
+
+// attributes
+    Elision *next;
+};
+
+class PropertyNameAndValueList: public Node
+{
+public:
+    PropertyNameAndValueList(PropertyName *n, ExpressionNode *v):
+        name (n), value (v), next (this)
+        { kind = Kind_PropertyNameAndValueList; }
+
+    PropertyNameAndValueList(PropertyNameAndValueList *previous, PropertyName *n, ExpressionNode *v):
+        name (n), value (v)
+    {
+        kind = Kind_PropertyNameAndValueList;
+        next = previous->next;
+        previous->next = this;
+    }
+
+    virtual ~PropertyNameAndValueList() {}
+
+    virtual void accept0(Visitor *visitor);
+
+    inline PropertyNameAndValueList *finish ()
+    {
+        PropertyNameAndValueList *front = next;
+        next = 0;
+        return front;
+    }
+
+// attributes
+    PropertyName *name;
+    ExpressionNode *value;
+    PropertyNameAndValueList *next;
+};
+
+class PropertyName: public Node
+{
+public:
+    PropertyName() { kind = Kind_PropertyName; }
+    virtual ~PropertyName() {}
+};
+
+class IdentifierPropertyName: public PropertyName
+{
+public:
+    IdentifierPropertyName(JavaScriptNameIdImpl *n):
+        id (n) { kind = Kind_IdentifierPropertyName; }
+
+    virtual ~IdentifierPropertyName() {}
+
+    virtual void accept0(Visitor *visitor);
+
+// attributes
+    JavaScriptNameIdImpl *id;
+};
+
+class StringLiteralPropertyName: public PropertyName
+{
+public:
+    StringLiteralPropertyName(JavaScriptNameIdImpl *n):
+        id (n) { kind = Kind_StringLiteralPropertyName; }
+    virtual ~StringLiteralPropertyName() {}
+
+    virtual void accept0(Visitor *visitor);
+
+// attributes
+    JavaScriptNameIdImpl *id;
+};
+
+class NumericLiteralPropertyName: public PropertyName
+{
+public:
+    NumericLiteralPropertyName(double n):
+        id (n) { kind = Kind_NumericLiteralPropertyName; }
+    virtual ~NumericLiteralPropertyName() {}
+
+    virtual void accept0(Visitor *visitor);
+
+// attributes
+    double id;
+};
+
+class ArrayMemberExpression: public ExpressionNode
+{
+public:
+    ArrayMemberExpression(ExpressionNode *b, ExpressionNode *e):
+        base (b), expression (e)
+        { kind = Kind_ArrayMemberExpression; }
+
+    virtual ~ArrayMemberExpression() {}
+
+    virtual void accept0(Visitor *visitor);
+
+// attributes
+    ExpressionNode *base;
+    ExpressionNode *expression;
+};
+
+class FieldMemberExpression: public ExpressionNode
+{
+public:
+    FieldMemberExpression(ExpressionNode *b, JavaScriptNameIdImpl *n):
+        base (b), name (n)
+        { kind = Kind_FieldMemberExpression; }
+
+    virtual ~FieldMemberExpression() {}
+
+    virtual void accept0(Visitor *visitor);
+
+// attributes
+    ExpressionNode *base;
+    JavaScriptNameIdImpl *name;
+};
+
+class NewMemberExpression: public ExpressionNode
+{
+public:
+    NewMemberExpression(ExpressionNode *b, ArgumentList *a):
+        base (b), arguments (a)
+        { kind = Kind_NewMemberExpression; }
+
+    virtual ~NewMemberExpression() {}
+
+    virtual void accept0(Visitor *visitor);
+
+// attributes
+    ExpressionNode *base;
+    ArgumentList *arguments;
+};
+
+class NewExpression: public ExpressionNode
+{
+public:
+    NewExpression(ExpressionNode *e):
+        expression (e) { kind = Kind_NewExpression; }
+
+    virtual ~NewExpression() {}
+
+    virtual void accept0(Visitor *visitor);
+
+// attributes
+    ExpressionNode *expression;
+};
+
+class CallExpression: public ExpressionNode
+{
+public:
+    CallExpression(ExpressionNode *b, ArgumentList *a):
+        base (b), arguments (a)
+        { kind = Kind_CallExpression; }
+
+    virtual ~CallExpression() {}
+
+    virtual void accept0(Visitor *visitor);
+
+// attributes
+    ExpressionNode *base;
+    ArgumentList *arguments;
+};
+
+class ArgumentList: public Node
+{
+public:
+    ArgumentList(ExpressionNode *e):
+        expression (e), next (this)
+        { kind = Kind_ArgumentList; }
+
+    ArgumentList(ArgumentList *previous, ExpressionNode *e):
+        expression (e)
+    {
+        kind = Kind_ArgumentList;
+        next = previous->next;
+        previous->next = this;
+    }
+
+    virtual ~ArgumentList() {}
+
+    virtual void accept0(Visitor *visitor);
+
+    inline ArgumentList *finish ()
+    {
+        ArgumentList *front = next;
+        next = 0;
+        return front;
+    }
+
+// attributes
+    ExpressionNode *expression;
+    ArgumentList *next;
+};
+
+class PostIncrementExpression: public ExpressionNode
+{
+public:
+    PostIncrementExpression(ExpressionNode *b):
+        base (b) { kind = Kind_PostIncrementExpression; }
+
+    virtual ~PostIncrementExpression() {}
+
+    virtual void accept0(Visitor *visitor);
+
+// attributes
+    ExpressionNode *base;
+};
+
+class PostDecrementExpression: public ExpressionNode
+{
+public:
+    PostDecrementExpression(ExpressionNode *b):
+        base (b) { kind = Kind_PostDecrementExpression; }
+
+    virtual ~PostDecrementExpression() {}
+
+    virtual void accept0(Visitor *visitor);
+
+// attributes
+    ExpressionNode *base;
+};
+
+class DeleteExpression: public ExpressionNode
+{
+public:
+    DeleteExpression(ExpressionNode *e):
+        expression (e) { kind = Kind_DeleteExpression; }
+    virtual ~DeleteExpression() {}
+
+    virtual void accept0(Visitor *visitor);
+
+// attributes
+    ExpressionNode *expression;
+};
+
+class VoidExpression: public ExpressionNode
+{
+public:
+    VoidExpression(ExpressionNode *e):
+        expression (e) { kind = Kind_VoidExpression; }
+
+    virtual ~VoidExpression() {}
+
+    virtual void accept0(Visitor *visitor);
+
+// attributes
+    ExpressionNode *expression;
+};
+
+class TypeOfExpression: public ExpressionNode
+{
+public:
+    TypeOfExpression(ExpressionNode *e):
+        expression (e) { kind = Kind_TypeOfExpression; }
+
+    virtual ~TypeOfExpression() {}
+
+    virtual void accept0(Visitor *visitor);
+
+// attributes
+    ExpressionNode *expression;
+};
+
+class PreIncrementExpression: public ExpressionNode
+{
+public:
+    PreIncrementExpression(ExpressionNode *e):
+        expression (e) { kind = Kind_PreIncrementExpression; }
+
+    virtual ~PreIncrementExpression() {}
+
+    virtual void accept0(Visitor *visitor);
+
+// attributes
+    ExpressionNode *expression;
+};
+
+class PreDecrementExpression: public ExpressionNode
+{
+public:
+    PreDecrementExpression(ExpressionNode *e):
+        expression (e) { kind = Kind_PreDecrementExpression; }
+
+    virtual ~PreDecrementExpression() {}
+
+    virtual void accept0(Visitor *visitor);
+
+// attributes
+    ExpressionNode *expression;
+};
+
+class UnaryPlusExpression: public ExpressionNode
+{
+public:
+    UnaryPlusExpression(ExpressionNode *e):
+        expression (e) { kind = Kind_UnaryPlusExpression; }
+
+    virtual ~UnaryPlusExpression() {}
+
+    virtual void accept0(Visitor *visitor);
+
+// attributes
+    ExpressionNode *expression;
+};
+
+class UnaryMinusExpression: public ExpressionNode
+{
+public:
+    UnaryMinusExpression(ExpressionNode *e):
+        expression (e) { kind = Kind_UnaryMinusExpression; }
+
+    virtual ~UnaryMinusExpression() {}
+
+    virtual void accept0(Visitor *visitor);
+
+// attributes
+    ExpressionNode *expression;
+};
+
+class TildeExpression: public ExpressionNode
+{
+public:
+    TildeExpression(ExpressionNode *e):
+        expression (e) { kind = Kind_TildeExpression; }
+
+    virtual ~TildeExpression() {}
+
+    virtual void accept0(Visitor *visitor);
+
+// attributes
+    ExpressionNode *expression;
+};
+
+class NotExpression: public ExpressionNode
+{
+public:
+    NotExpression(ExpressionNode *e):
+        expression (e) { kind = Kind_NotExpression; }
+
+    virtual ~NotExpression() {}
+
+    virtual void accept0(Visitor *visitor);
+
+// attributes
+    ExpressionNode *expression;
+};
+
+class BinaryExpression: public ExpressionNode
+{
+public:
+    BinaryExpression(ExpressionNode *l, int o, ExpressionNode *r):
+        left (l), op (o), right (r)
+        { kind = Kind_BinaryExpression; }
+
+    virtual ~BinaryExpression() {}
+
+    virtual BinaryExpression *binaryExpressionCast();
+
+    virtual void accept0(Visitor *visitor);
+
+// attributes
+    ExpressionNode *left;
+    int op;
+    ExpressionNode *right;
+};
+
+class ConditionalExpression: public ExpressionNode
+{
+public:
+    ConditionalExpression(ExpressionNode *e, ExpressionNode *t, ExpressionNode *f):
+        expression (e), ok (t), ko (f)
+        { kind = Kind_ConditionalExpression; }
+
+    virtual ~ConditionalExpression() {}
+
+    virtual void accept0(Visitor *visitor);
+
+// attributes
+    ExpressionNode *expression;
+    ExpressionNode *ok;
+    ExpressionNode *ko;
+};
+
+class Expression: public ExpressionNode // ### rename
+{
+public:
+    Expression(ExpressionNode *l, ExpressionNode *r):
+        left (l), right (r) { kind = Kind_Expression; }
+
+    virtual ~Expression() {}
+
+    virtual void accept0(Visitor *visitor);
+
+// attributes
+    ExpressionNode *left;
+    ExpressionNode *right;
+};
+
+class Block: public Statement
+{
+public:
+    Block(StatementList *slist):
+        statements (slist) { kind = Kind_Block; }
+
+    virtual ~Block() {}
+
+    virtual void accept0(Visitor *visitor);
+
+// attributes
+    StatementList *statements;
+};
+
+class StatementList: public Node
+{
+public:
+    StatementList(Statement *stmt):
+        statement (stmt), next (this)
+        { kind = Kind_StatementList; }
+
+    StatementList(StatementList *previous, Statement *stmt):
+        statement (stmt)
+    {
+        kind = Kind_StatementList;
+        next = previous->next;
+        previous->next = this;
+    }
+
+    virtual ~StatementList() {}
+
+    virtual void accept0(Visitor *visitor);
+
+    inline StatementList *finish ()
+    {
+        StatementList *front = next;
+        next = 0;
+        return front;
+    }
+
+// attributes
+    Statement *statement;
+    StatementList *next;
+};
+
+class VariableStatement: public Statement
+{
+public:
+    VariableStatement(VariableDeclarationList *vlist):
+        declarations (vlist)
+        { kind = Kind_VariableStatement; }
+
+    virtual ~VariableStatement() {}
+
+    virtual void accept0(Visitor *visitor);
+
+// attributes
+    VariableDeclarationList *declarations;
+};
+
+class VariableDeclaration: public Node
+{
+public:
+    VariableDeclaration(JavaScriptNameIdImpl *n, ExpressionNode *e):
+        name (n), expression (e), readOnly(false)
+        { kind = Kind_VariableDeclaration; }
+
+    virtual ~VariableDeclaration() {}
+
+    virtual void accept0(Visitor *visitor);
+
+// attributes
+    JavaScriptNameIdImpl *name;
+    ExpressionNode *expression;
+    bool readOnly;
+};
+
+class VariableDeclarationList: public Node
+{
+public:
+    VariableDeclarationList(VariableDeclaration *decl):
+        declaration (decl), next (this)
+        { kind = Kind_VariableDeclarationList; }
+
+    VariableDeclarationList(VariableDeclarationList *previous, VariableDeclaration *decl):
+        declaration (decl)
+    {
+        kind = Kind_VariableDeclarationList;
+        next = previous->next;
+        previous->next = this;
+    }
+
+    virtual ~VariableDeclarationList() {}
+
+    virtual void accept0(Visitor *visitor);
+
+    inline VariableDeclarationList *finish (bool readOnly)
+    {
+        VariableDeclarationList *front = next;
+        next = 0;
+        if (readOnly) {
+            VariableDeclarationList *vdl;
+            for (vdl = front; vdl != 0; vdl = vdl->next)
+                vdl->declaration->readOnly = true;
+        }
+        return front;
+    }
+
+// attributes
+    VariableDeclaration *declaration;
+    VariableDeclarationList *next;
+};
+
+class EmptyStatement: public Statement
+{
+public:
+    EmptyStatement() { kind = Kind_EmptyStatement; }
+    virtual ~EmptyStatement() {}
+
+    virtual void accept0(Visitor *visitor);
+};
+
+class ExpressionStatement: public Statement
+{
+public:
+    ExpressionStatement(ExpressionNode *e):
+        expression (e) { kind = Kind_ExpressionStatement; }
+
+    virtual ~ExpressionStatement() {}
+
+    virtual void accept0(Visitor *visitor);
+
+// attributes
+    ExpressionNode *expression;
+};
+
+class IfStatement: public Statement
+{
+public:
+    IfStatement(ExpressionNode *e, Statement *t, Statement *f = 0):
+        expression (e), ok (t), ko (f)
+        { kind = Kind_IfStatement; }
+
+    virtual ~IfStatement() {}
+
+    virtual void accept0(Visitor *visitor);
+
+// attributes
+    ExpressionNode *expression;
+    Statement *ok;
+    Statement *ko;
+};
+
+class DoWhileStatement: public Statement
+{
+public:
+    DoWhileStatement(Statement *stmt, ExpressionNode *e):
+        statement (stmt), expression (e)
+        { kind = Kind_DoWhileStatement; }
+
+    virtual ~DoWhileStatement() {}
+
+    virtual void accept0(Visitor *visitor);
+
+// attributes
+    Statement *statement;
+    ExpressionNode *expression;
+};
+
+class WhileStatement: public Statement
+{
+public:
+    WhileStatement(ExpressionNode *e, Statement *stmt):
+        expression (e), statement (stmt)
+        { kind = Kind_WhileStatement; }
+
+    virtual ~WhileStatement() {}
+
+    virtual void accept0(Visitor *visitor);
+
+// attributes
+    ExpressionNode *expression;
+    Statement *statement;
+};
+
+class ForStatement: public Statement
+{
+public:
+    ForStatement(ExpressionNode *i, ExpressionNode *c, ExpressionNode *e, Statement *stmt):
+        initialiser (i), condition (c), expression (e), statement (stmt)
+        { kind = Kind_ForStatement; }
+
+    virtual ~ForStatement() {}
+
+    virtual void accept0(Visitor *visitor);
+
+// attributes
+    ExpressionNode *initialiser;
+    ExpressionNode *condition;
+    ExpressionNode *expression;
+    Statement *statement;
+};
+
+class LocalForStatement: public Statement
+{
+public:
+    LocalForStatement(VariableDeclarationList *vlist, ExpressionNode *c, ExpressionNode *e, Statement *stmt):
+        declarations (vlist), condition (c), expression (e), statement (stmt)
+        { kind = Kind_LocalForStatement; }
+
+    virtual ~LocalForStatement() {}
+
+    virtual void accept0(Visitor *visitor);
+
+// attributes
+    VariableDeclarationList *declarations;
+    ExpressionNode *condition;
+    ExpressionNode *expression;
+    Statement *statement;
+};
+
+class ForEachStatement: public Statement
+{
+public:
+    ForEachStatement(ExpressionNode *i, ExpressionNode *e, Statement *stmt):
+        initialiser (i), expression (e), statement (stmt)
+        { kind = Kind_ForEachStatement; }
+
+    virtual ~ForEachStatement() {}
+
+    virtual void accept0(Visitor *visitor);
+
+// attributes
+    ExpressionNode *initialiser;
+    ExpressionNode *expression;
+    Statement *statement;
+};
+
+class LocalForEachStatement: public Statement
+{
+public:
+    LocalForEachStatement(VariableDeclaration *v, ExpressionNode *e, Statement *stmt):
+        declaration (v), expression (e), statement (stmt)
+        { kind = Kind_LocalForEachStatement; }
+
+    virtual ~LocalForEachStatement() {}
+
+    virtual void accept0(Visitor *visitor);
+
+// attributes
+    VariableDeclaration *declaration;
+    ExpressionNode *expression;
+    Statement *statement;
+};
+
+class ContinueStatement: public Statement
+{
+public:
+    ContinueStatement(JavaScriptNameIdImpl *l = 0):
+        label (l) { kind = Kind_ContinueStatement; }
+
+    virtual ~ContinueStatement() {}
+
+    virtual void accept0(Visitor *visitor);
+
+// attributes
+    JavaScriptNameIdImpl *label;
+};
+
+class BreakStatement: public Statement
+{
+public:
+    BreakStatement(JavaScriptNameIdImpl *l = 0):
+        label (l) { kind = Kind_BreakStatement; }
+
+    virtual ~BreakStatement() {}
+
+    virtual void accept0(Visitor *visitor);
+
+// attributes
+    JavaScriptNameIdImpl *label;
+};
+
+class ReturnStatement: public Statement
+{
+public:
+    ReturnStatement(ExpressionNode *e):
+        expression (e) { kind = Kind_ReturnStatement; }
+
+    virtual ~ReturnStatement() {}
+
+    virtual void accept0(Visitor *visitor);
+
+// attributes
+    ExpressionNode *expression;
+};
+
+class WithStatement: public Statement
+{
+public:
+    WithStatement(ExpressionNode *e, Statement *stmt):
+        expression (e), statement (stmt)
+        { kind = Kind_WithStatement; }
+
+    virtual ~WithStatement() {}
+
+    virtual void accept0(Visitor *visitor);
+
+// attributes
+    ExpressionNode *expression;
+    Statement *statement;
+};
+
+class SwitchStatement: public Statement
+{
+public:
+    SwitchStatement(ExpressionNode *e, CaseBlock *b):
+        expression (e), block (b)
+        { kind = Kind_SwitchStatement; }
+
+    virtual ~SwitchStatement() {}
+
+    virtual void accept0(Visitor *visitor);
+
+// attributes
+    ExpressionNode *expression;
+    CaseBlock *block;
+};
+
+class CaseBlock: public Node
+{
+public:
+    CaseBlock(CaseClauses *c, DefaultClause *d = 0, CaseClauses *r = 0):
+        clauses (c), defaultClause (d), moreClauses (r)
+        { kind = Kind_CaseBlock; }
+
+    virtual ~CaseBlock() {}
+
+    virtual void accept0(Visitor *visitor);
+
+// attributes
+    CaseClauses *clauses;
+    DefaultClause *defaultClause;
+    CaseClauses *moreClauses;
+};
+
+class CaseClauses: public Node
+{
+public:
+    CaseClauses(CaseClause *c):
+        clause (c), next (this)
+        { kind = Kind_CaseClauses; }
+
+    CaseClauses(CaseClauses *previous, CaseClause *c):
+        clause (c)
+    {
+        kind = Kind_CaseClauses;
+        next = previous->next;
+        previous->next = this;
+    }
+
+    virtual ~CaseClauses() {}
+
+    virtual void accept0(Visitor *visitor);
+
+    inline CaseClauses *finish ()
+    {
+        CaseClauses *front = next;
+        next = 0;
+        return front;
+    }
+
+//attributes
+    CaseClause *clause;
+    CaseClauses *next;
+};
+
+class CaseClause: public Node
+{
+public:
+    CaseClause(ExpressionNode *e, StatementList *slist):
+        expression (e), statements (slist)
+        { kind = Kind_CaseClause; }
+
+    virtual ~CaseClause() {}
+
+    virtual void accept0(Visitor *visitor);
+
+// attributes
+    ExpressionNode *expression;
+    StatementList *statements;
+};
+
+class DefaultClause: public Node
+{
+public:
+    DefaultClause(StatementList *slist):
+        statements (slist)
+        { kind = Kind_DefaultClause; }
+
+    virtual ~DefaultClause() {}
+
+    virtual void accept0(Visitor *visitor);
+
+// attributes
+    StatementList *statements;
+};
+
+class LabelledStatement: public Statement
+{
+public:
+    LabelledStatement(JavaScriptNameIdImpl *l, Statement *stmt):
+        label (l), statement (stmt)
+        { kind = Kind_LabelledStatement; }
+
+    virtual ~LabelledStatement() {}
+
+    virtual void accept0(Visitor *visitor);
+
+// attributes
+    JavaScriptNameIdImpl *label;
+    Statement *statement;
+};
+
+class ThrowStatement: public Statement
+{
+public:
+    ThrowStatement(ExpressionNode *e):
+        expression (e) { kind = Kind_ThrowStatement; }
+
+    virtual ~ThrowStatement() {}
+
+    virtual void accept0(Visitor *visitor);
+
+// attributes
+    ExpressionNode *expression;
+};
+
+class TryStatement: public Statement
+{
+public:
+    TryStatement(Statement *stmt, Catch *c, Finally *f):
+        statement (stmt), catchExpression (c), finallyExpression (f)
+        { kind = Kind_TryStatement; }
+
+    TryStatement(Statement *stmt, Finally *f):
+        statement (stmt), catchExpression (0), finallyExpression (f)
+        { kind = Kind_TryStatement; }
+
+    TryStatement(Statement *stmt, Catch *c):
+        statement (stmt), catchExpression (c), finallyExpression (0)
+        { kind = Kind_TryStatement; }
+
+    virtual ~TryStatement() {}
+
+    virtual void accept0(Visitor *visitor);
+
+// attributes
+    Statement *statement;
+    Catch *catchExpression;
+    Finally *finallyExpression;
+};
+
+class Catch: public Node
+{
+public:
+    Catch(JavaScriptNameIdImpl *n, Statement *stmt):
+        name (n), statement (stmt)
+        { kind = Kind_Catch; }
+
+    virtual ~Catch() {}
+
+    virtual void accept0(Visitor *visitor);
+
+// attributes
+    JavaScriptNameIdImpl *name;
+    Statement *statement;
+};
+
+class Finally: public Node
+{
+public:
+    Finally(Statement *stmt):
+        statement (stmt)
+        { kind = Kind_Finally; }
+
+    virtual ~Finally() {}
+
+    virtual void accept0(Visitor *visitor);
+
+// attributes
+    Statement *statement;
+};
+
+class FunctionExpression: public ExpressionNode
+{
+public:
+    FunctionExpression(JavaScriptNameIdImpl *n, FormalParameterList *f, FunctionBody *b):
+        name (n), formals (f), body (b)
+        { kind = Kind_FunctionExpression; }
+
+    virtual ~FunctionExpression() {}
+
+    virtual void accept0(Visitor *visitor);
+
+// attributes
+    JavaScriptNameIdImpl *name;
+    FormalParameterList *formals;
+    FunctionBody *body;
+};
+
+class FunctionDeclaration: public FunctionExpression
+{
+public:
+    FunctionDeclaration(JavaScriptNameIdImpl *n, FormalParameterList *f, FunctionBody *b):
+        FunctionExpression(n, f, b)
+        { kind = Kind_FunctionDeclaration; }
+
+    virtual ~FunctionDeclaration() {}
+
+    virtual void accept0(Visitor *visitor);
+};
+
+class FormalParameterList: public Node
+{
+public:
+    FormalParameterList(JavaScriptNameIdImpl *n):
+        name (n), next (this)
+        { kind = Kind_FormalParameterList; }
+
+    FormalParameterList(FormalParameterList *previous, JavaScriptNameIdImpl *n):
+        name (n)
+    {
+        kind = Kind_FormalParameterList;
+        next = previous->next;
+        previous->next = this;
+    }
+
+    virtual ~FormalParameterList() {}
+
+    virtual void accept0(Visitor *visitor);
+
+    inline FormalParameterList *finish ()
+    {
+        FormalParameterList *front = next;
+        next = 0;
+        return front;
+    }
+
+// attributes
+    JavaScriptNameIdImpl *name;
+    FormalParameterList *next;
+};
+
+class FunctionBody: public Node
+{
+public:
+    FunctionBody(SourceElements *elts):
+        elements (elts)
+        { kind = Kind_FunctionBody; }
+
+    virtual ~FunctionBody() {}
+
+    virtual void accept0(Visitor *visitor);
+
+// attributes
+    SourceElements *elements;
+};
+
+class Program: public Node
+{
+public:
+    Program(SourceElements *elts):
+        elements (elts)
+        { kind = Kind_Program; }
+
+    virtual ~Program() {}
+
+    virtual void accept0(Visitor *visitor);
+
+// attributes
+    SourceElements *elements;
+};
+
+class SourceElements: public Node
+{
+public:
+    SourceElements(SourceElement *elt):
+        element (elt), next (this)
+        { kind = Kind_SourceElements; }
+
+    SourceElements(SourceElements *previous, SourceElement *elt):
+        element (elt)
+    {
+        kind = Kind_SourceElements;
+        next = previous->next;
+        previous->next = this;
+    }
+
+    virtual ~SourceElements() {}
+
+    virtual void accept0(Visitor *visitor);
+
+    inline SourceElements *finish ()
+    {
+        SourceElements *front = next;
+        next = 0;
+        return front;
+    }
+
+// attributes
+    SourceElement *element;
+    SourceElements *next;
+};
+
+class SourceElement: public Node
+{
+public:
+    inline SourceElement()
+        { kind = Kind_SourceElement; }
+
+    virtual ~SourceElement() {}
+};
+
+class FunctionSourceElement: public SourceElement
+{
+public:
+    FunctionSourceElement(FunctionDeclaration *f):
+        declaration (f)
+        { kind = Kind_FunctionSourceElement; }
+
+    virtual ~FunctionSourceElement() {}
+
+    virtual void accept0(Visitor *visitor);
+
+// attributes
+    FunctionDeclaration *declaration;
+};
+
+class StatementSourceElement: public SourceElement
+{
+public:
+    StatementSourceElement(Statement *stmt):
+        statement (stmt)
+        { kind = Kind_StatementSourceElement; }
+
+    virtual ~StatementSourceElement() {}
+
+    virtual void accept0(Visitor *visitor);
+
+// attributes
+    Statement *statement;
+};
+
+class DebuggerStatement: public Statement
+{
+public:
+    DebuggerStatement()
+        { kind = Kind_DebuggerStatement; }
+
+    virtual ~DebuggerStatement() {}
+
+    virtual void accept0(Visitor *visitor);
+};
+
+} } // namespace AST
+
+
+
+QT_END_NAMESPACE
+
+#endif
diff --git a/src/plugins/qtscripteditor/parser/javascriptastfwd_p.h b/src/plugins/qtscripteditor/parser/javascriptastfwd_p.h
new file mode 100644
index 0000000000000000000000000000000000000000..43a4adbd6cd1f04f2301e19f18215a31739bd2e3
--- /dev/null
+++ b/src/plugins/qtscripteditor/parser/javascriptastfwd_p.h
@@ -0,0 +1,146 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the QtScript module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain
+** additional rights. These rights are described in the Nokia Qt LGPL
+** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef JAVASCRIPTAST_FWD_P_H
+#define JAVASCRIPTAST_FWD_P_H
+
+#include <QtCore/qglobal.h>
+
+//
+//  W A R N I N G
+//  -------------
+//
+// This file is not part of the Qt API.  It exists purely as an
+// implementation detail.  This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+QT_BEGIN_NAMESPACE
+
+namespace JavaScript { namespace AST {
+
+class Visitor;
+class Node;
+class ExpressionNode;
+class Statement;
+class ThisExpression;
+class IdentifierExpression;
+class NullExpression;
+class TrueLiteral;
+class FalseLiteral;
+class NumericLiteral;
+class StringLiteral;
+class RegExpLiteral;
+class ArrayLiteral;
+class ObjectLiteral;
+class ElementList;
+class Elision;
+class PropertyNameAndValueList;
+class PropertyName;
+class IdentifierPropertyName;
+class StringLiteralPropertyName;
+class NumericLiteralPropertyName;
+class ArrayMemberExpression;
+class FieldMemberExpression;
+class NewMemberExpression;
+class NewExpression;
+class CallExpression;
+class ArgumentList;
+class PostIncrementExpression;
+class PostDecrementExpression;
+class DeleteExpression;
+class VoidExpression;
+class TypeOfExpression;
+class PreIncrementExpression;
+class PreDecrementExpression;
+class UnaryPlusExpression;
+class UnaryMinusExpression;
+class TildeExpression;
+class NotExpression;
+class BinaryExpression;
+class ConditionalExpression;
+class Expression; // ### rename
+class Block;
+class StatementList;
+class VariableStatement;
+class VariableDeclarationList;
+class VariableDeclaration;
+class EmptyStatement;
+class ExpressionStatement;
+class IfStatement;
+class DoWhileStatement;
+class WhileStatement;
+class ForStatement;
+class LocalForStatement;
+class ForEachStatement;
+class LocalForEachStatement;
+class ContinueStatement;
+class BreakStatement;
+class ReturnStatement;
+class WithStatement;
+class SwitchStatement;
+class CaseBlock;
+class CaseClauses;
+class CaseClause;
+class DefaultClause;
+class LabelledStatement;
+class ThrowStatement;
+class TryStatement;
+class Catch;
+class Finally;
+class FunctionDeclaration;
+class FunctionExpression;
+class FormalParameterList;
+class FunctionBody;
+class Program;
+class SourceElements;
+class SourceElement;
+class FunctionSourceElement;
+class StatementSourceElement;
+class DebuggerStatement;
+
+} } // namespace AST
+
+QT_END_NAMESPACE
+
+#endif
diff --git a/src/plugins/qtscripteditor/parser/javascriptastvisitor.cpp b/src/plugins/qtscripteditor/parser/javascriptastvisitor.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..eac291dfc2ba0cf5fd14e9b9cd39b804816f6d61
--- /dev/null
+++ b/src/plugins/qtscripteditor/parser/javascriptastvisitor.cpp
@@ -0,0 +1,58 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the QtScript module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain
+** additional rights. These rights are described in the Nokia Qt LGPL
+** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "javascriptastvisitor_p.h"
+
+QT_BEGIN_NAMESPACE
+
+namespace JavaScript { namespace AST {
+
+Visitor::Visitor()
+{
+}
+
+Visitor::~Visitor()
+{
+}
+
+} } // namespace JavaScript::AST
+
+QT_END_NAMESPACE
diff --git a/src/plugins/qtscripteditor/parser/javascriptastvisitor_p.h b/src/plugins/qtscripteditor/parser/javascriptastvisitor_p.h
new file mode 100644
index 0000000000000000000000000000000000000000..5290d139076d47407340a20ffa6905a930a44ec1
--- /dev/null
+++ b/src/plugins/qtscripteditor/parser/javascriptastvisitor_p.h
@@ -0,0 +1,295 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the QtScript module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain
+** additional rights. These rights are described in the Nokia Qt LGPL
+** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef JAVASCRIPTASTVISITOR_P_H
+#define JAVASCRIPTASTVISITOR_P_H
+
+//
+//  W A R N I N G
+//  -------------
+//
+// This file is not part of the Qt API.  It exists purely as an
+// implementation detail.  This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "javascriptastfwd_p.h"
+
+QT_BEGIN_NAMESPACE
+
+namespace JavaScript { namespace AST {
+
+class Visitor
+{
+public:
+    Visitor();
+    virtual ~Visitor();
+
+    virtual bool preVisit(Node *) { return true; }
+    virtual void postVisit(Node *) {}
+
+    virtual bool visit(ThisExpression *) { return true; }
+    virtual void endVisit(ThisExpression *) {}
+
+    virtual bool visit(IdentifierExpression *) { return true; }
+    virtual void endVisit(IdentifierExpression *) {}
+
+    virtual bool visit(NullExpression *) { return true; }
+    virtual void endVisit(NullExpression *) {}
+
+    virtual bool visit(TrueLiteral *) { return true; }
+    virtual void endVisit(TrueLiteral *) {}
+
+    virtual bool visit(FalseLiteral *) { return true; }
+    virtual void endVisit(FalseLiteral *) {}
+
+    virtual bool visit(StringLiteral *) { return true; }
+    virtual void endVisit(StringLiteral *) {}
+
+    virtual bool visit(NumericLiteral *) { return true; }
+    virtual void endVisit(NumericLiteral *) {}
+
+    virtual bool visit(RegExpLiteral *) { return true; }
+    virtual void endVisit(RegExpLiteral *) {}
+
+    virtual bool visit(ArrayLiteral *) { return true; }
+    virtual void endVisit(ArrayLiteral *) {}
+
+    virtual bool visit(ObjectLiteral *) { return true; }
+    virtual void endVisit(ObjectLiteral *) {}
+
+    virtual bool visit(ElementList *) { return true; }
+    virtual void endVisit(ElementList *) {}
+
+    virtual bool visit(Elision *) { return true; }
+    virtual void endVisit(Elision *) {}
+
+    virtual bool visit(PropertyNameAndValueList *) { return true; }
+    virtual void endVisit(PropertyNameAndValueList *) {}
+
+    virtual bool visit(IdentifierPropertyName *) { return true; }
+    virtual void endVisit(IdentifierPropertyName *) {}
+
+    virtual bool visit(StringLiteralPropertyName *) { return true; }
+    virtual void endVisit(StringLiteralPropertyName *) {}
+
+    virtual bool visit(NumericLiteralPropertyName *) { return true; }
+    virtual void endVisit(NumericLiteralPropertyName *) {}
+
+    virtual bool visit(ArrayMemberExpression *) { return true; }
+    virtual void endVisit(ArrayMemberExpression *) {}
+
+    virtual bool visit(FieldMemberExpression *) { return true; }
+    virtual void endVisit(FieldMemberExpression *) {}
+
+    virtual bool visit(NewMemberExpression *) { return true; }
+    virtual void endVisit(NewMemberExpression *) {}
+
+    virtual bool visit(NewExpression *) { return true; }
+    virtual void endVisit(NewExpression *) {}
+
+    virtual bool visit(CallExpression *) { return true; }
+    virtual void endVisit(CallExpression *) {}
+
+    virtual bool visit(ArgumentList *) { return true; }
+    virtual void endVisit(ArgumentList *) {}
+
+    virtual bool visit(PostIncrementExpression *) { return true; }
+    virtual void endVisit(PostIncrementExpression *) {}
+
+    virtual bool visit(PostDecrementExpression *) { return true; }
+    virtual void endVisit(PostDecrementExpression *) {}
+
+    virtual bool visit(DeleteExpression *) { return true; }
+    virtual void endVisit(DeleteExpression *) {}
+
+    virtual bool visit(VoidExpression *) { return true; }
+    virtual void endVisit(VoidExpression *) {}
+
+    virtual bool visit(TypeOfExpression *) { return true; }
+    virtual void endVisit(TypeOfExpression *) {}
+
+    virtual bool visit(PreIncrementExpression *) { return true; }
+    virtual void endVisit(PreIncrementExpression *) {}
+
+    virtual bool visit(PreDecrementExpression *) { return true; }
+    virtual void endVisit(PreDecrementExpression *) {}
+
+    virtual bool visit(UnaryPlusExpression *) { return true; }
+    virtual void endVisit(UnaryPlusExpression *) {}
+
+    virtual bool visit(UnaryMinusExpression *) { return true; }
+    virtual void endVisit(UnaryMinusExpression *) {}
+
+    virtual bool visit(TildeExpression *) { return true; }
+    virtual void endVisit(TildeExpression *) {}
+
+    virtual bool visit(NotExpression *) { return true; }
+    virtual void endVisit(NotExpression *) {}
+
+    virtual bool visit(BinaryExpression *) { return true; }
+    virtual void endVisit(BinaryExpression *) {}
+
+    virtual bool visit(ConditionalExpression *) { return true; }
+    virtual void endVisit(ConditionalExpression *) {}
+
+    virtual bool visit(Expression *) { return true; }
+    virtual void endVisit(Expression *) {}
+
+    virtual bool visit(Block *) { return true; }
+    virtual void endVisit(Block *) {}
+
+    virtual bool visit(StatementList *) { return true; }
+    virtual void endVisit(StatementList *) {}
+
+    virtual bool visit(VariableStatement *) { return true; }
+    virtual void endVisit(VariableStatement *) {}
+
+    virtual bool visit(VariableDeclarationList *) { return true; }
+    virtual void endVisit(VariableDeclarationList *) {}
+
+    virtual bool visit(VariableDeclaration *) { return true; }
+    virtual void endVisit(VariableDeclaration *) {}
+
+    virtual bool visit(EmptyStatement *) { return true; }
+    virtual void endVisit(EmptyStatement *) {}
+
+    virtual bool visit(ExpressionStatement *) { return true; }
+    virtual void endVisit(ExpressionStatement *) {}
+
+    virtual bool visit(IfStatement *) { return true; }
+    virtual void endVisit(IfStatement *) {}
+
+    virtual bool visit(DoWhileStatement *) { return true; }
+    virtual void endVisit(DoWhileStatement *) {}
+
+    virtual bool visit(WhileStatement *) { return true; }
+    virtual void endVisit(WhileStatement *) {}
+
+    virtual bool visit(ForStatement *) { return true; }
+    virtual void endVisit(ForStatement *) {}
+
+    virtual bool visit(LocalForStatement *) { return true; }
+    virtual void endVisit(LocalForStatement *) {}
+
+    virtual bool visit(ForEachStatement *) { return true; }
+    virtual void endVisit(ForEachStatement *) {}
+
+    virtual bool visit(LocalForEachStatement *) { return true; }
+    virtual void endVisit(LocalForEachStatement *) {}
+
+    virtual bool visit(ContinueStatement *) { return true; }
+    virtual void endVisit(ContinueStatement *) {}
+
+    virtual bool visit(BreakStatement *) { return true; }
+    virtual void endVisit(BreakStatement *) {}
+
+    virtual bool visit(ReturnStatement *) { return true; }
+    virtual void endVisit(ReturnStatement *) {}
+
+    virtual bool visit(WithStatement *) { return true; }
+    virtual void endVisit(WithStatement *) {}
+
+    virtual bool visit(SwitchStatement *) { return true; }
+    virtual void endVisit(SwitchStatement *) {}
+
+    virtual bool visit(CaseBlock *) { return true; }
+    virtual void endVisit(CaseBlock *) {}
+
+    virtual bool visit(CaseClauses *) { return true; }
+    virtual void endVisit(CaseClauses *) {}
+
+    virtual bool visit(CaseClause *) { return true; }
+    virtual void endVisit(CaseClause *) {}
+
+    virtual bool visit(DefaultClause *) { return true; }
+    virtual void endVisit(DefaultClause *) {}
+
+    virtual bool visit(LabelledStatement *) { return true; }
+    virtual void endVisit(LabelledStatement *) {}
+
+    virtual bool visit(ThrowStatement *) { return true; }
+    virtual void endVisit(ThrowStatement *) {}
+
+    virtual bool visit(TryStatement *) { return true; }
+    virtual void endVisit(TryStatement *) {}
+
+    virtual bool visit(Catch *) { return true; }
+    virtual void endVisit(Catch *) {}
+
+    virtual bool visit(Finally *) { return true; }
+    virtual void endVisit(Finally *) {}
+
+    virtual bool visit(FunctionDeclaration *) { return true; }
+    virtual void endVisit(FunctionDeclaration *) {}
+
+    virtual bool visit(FunctionExpression *) { return true; }
+    virtual void endVisit(FunctionExpression *) {}
+
+    virtual bool visit(FormalParameterList *) { return true; }
+    virtual void endVisit(FormalParameterList *) {}
+
+    virtual bool visit(FunctionBody *) { return true; }
+    virtual void endVisit(FunctionBody *) {}
+
+    virtual bool visit(Program *) { return true; }
+    virtual void endVisit(Program *) {}
+
+    virtual bool visit(SourceElements *) { return true; }
+    virtual void endVisit(SourceElements *) {}
+
+    virtual bool visit(FunctionSourceElement *) { return true; }
+    virtual void endVisit(FunctionSourceElement *) {}
+
+    virtual bool visit(StatementSourceElement *) { return true; }
+    virtual void endVisit(StatementSourceElement *) {}
+
+    virtual bool visit(DebuggerStatement *) { return true; }
+    virtual void endVisit(DebuggerStatement *) {}
+};
+
+} } // namespace AST
+
+QT_END_NAMESPACE
+
+#endif // JAVASCRIPTASTVISITOR_P_H
diff --git a/src/plugins/qtscripteditor/parser/javascriptengine_p.cpp b/src/plugins/qtscripteditor/parser/javascriptengine_p.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..e2939b43b2b2d3ff6444ab0eca2e432e4f810cae
--- /dev/null
+++ b/src/plugins/qtscripteditor/parser/javascriptengine_p.cpp
@@ -0,0 +1,111 @@
+#include "javascriptengine_p.h"
+#include "javascriptnodepool_p.h"
+#include "javascriptvalue.h"
+#include <qnumeric.h>
+#include <QHash>
+
+namespace JavaScript {
+
+int Ecma::RegExp::flagFromChar(const QChar &ch)
+{
+  static QHash<QChar, int> flagsHash;
+  if (flagsHash.isEmpty()) {
+      flagsHash[QLatin1Char('g')] = Global;
+      flagsHash[QLatin1Char('i')] = IgnoreCase;
+      flagsHash[QLatin1Char('m')] = Multiline;
+  }
+  QHash<QChar, int>::const_iterator it;
+  it = flagsHash.constFind(ch);
+  if (it == flagsHash.constEnd())
+      return 0;
+  return it.value();
+}
+
+
+NodePool::NodePool(const QString &fileName, JavaScriptEnginePrivate *engine)
+    : m_fileName(fileName), m_engine(engine)
+{
+}
+
+NodePool::~NodePool()
+{
+}
+
+Code *NodePool::createCompiledCode(AST::Node *, CompilationUnit &)
+{
+  Q_ASSERT(0);
+  return 0;
+}
+
+static int toDigit(char c)
+{
+    if ((c >= '0') && (c <= '9'))
+        return c - '0';
+    else if ((c >= 'a') && (c <= 'z'))
+        return 10 + c - 'a';
+    else if ((c >= 'A') && (c <= 'Z'))
+        return 10 + c - 'A';
+    return -1;
+}
+
+qjsreal integerFromString(const char *buf, int size, int radix)
+{
+    if (size == 0)
+        return qSNaN();
+
+    qjsreal sign = 1.0;
+    int i = 0;
+    if (buf[0] == '+') {
+        ++i;
+    } else if (buf[0] == '-') {
+        sign = -1.0;
+        ++i;
+    }
+
+    if (((size-i) >= 2) && (buf[i] == '0')) {
+        if (((buf[i+1] == 'x') || (buf[i+1] == 'X'))
+            && (radix < 34)) {
+            if ((radix != 0) && (radix != 16))
+                return 0;
+            radix = 16;
+            i += 2;
+        } else {
+            if (radix == 0) {
+                radix = 8;
+                ++i;
+            }
+        }
+    } else if (radix == 0) {
+        radix = 10;
+    }
+
+    int j = i;
+    for ( ; i < size; ++i) {
+        int d = toDigit(buf[i]);
+        if ((d == -1) || (d >= radix))
+            break;
+    }
+    qjsreal result;
+    if (j == i) {
+        if (!qstrcmp(buf, "Infinity"))
+            result = qInf();
+        else
+            result = qSNaN();
+    } else {
+        result = 0;
+        qjsreal multiplier = 1;
+        for (--i ; i >= j; --i, multiplier *= radix)
+            result += toDigit(buf[i]) * multiplier;
+    }
+    result *= sign;
+    return result;
+}
+
+qjsreal integerFromString(const QString &str, int radix)
+{
+    QByteArray ba = str.trimmed().toUtf8();
+    return integerFromString(ba.constData(), ba.size(), radix);
+}
+
+} // end of namespace JavaScript
+
diff --git a/src/plugins/qtscripteditor/parser/javascriptengine_p.h b/src/plugins/qtscripteditor/parser/javascriptengine_p.h
new file mode 100644
index 0000000000000000000000000000000000000000..80d133871e014a808b8fdc221106eaa27d25610d
--- /dev/null
+++ b/src/plugins/qtscripteditor/parser/javascriptengine_p.h
@@ -0,0 +1,105 @@
+#ifndef JAVASCRIPTENGINE_P_H
+#define JAVASCRIPTENGINE_P_H
+
+#include "javascriptvalue.h"
+#include <QString>
+#include <QSet>
+
+namespace JavaScript {
+
+class Node;
+class Lexer;
+class NodePool;
+
+namespace AST {
+
+class Node;
+
+} // end of namespace AST
+
+namespace Ecma {
+
+class RegExp
+{
+public:
+    enum RegExpFlag {
+        Global     = 0x01,
+        IgnoreCase = 0x02,
+        Multiline  = 0x04
+    };
+
+public:
+  static int flagFromChar(const QChar &);
+};
+
+} // end of namespace Ecma
+
+} // end of namespace JavaScript
+
+
+
+class JavaScriptNameIdImpl
+{
+  QString _text;
+
+public:
+  JavaScriptNameIdImpl(const QChar *u, int s)
+    : _text(u, s)
+  { }
+
+  const QString asString() const
+  { return _text; }
+
+  bool operator == (const JavaScriptNameIdImpl &other) const
+  { return _text == other._text; }
+
+  bool operator != (const JavaScriptNameIdImpl &other) const
+  { return _text != other._text; }
+
+  bool operator < (const JavaScriptNameIdImpl &other) const
+  { return _text < other._text; }
+};
+
+inline uint qHash(const JavaScriptNameIdImpl &id)
+{ return qHash(id.asString()); }
+
+class JavaScriptEnginePrivate
+{
+  JavaScript::Lexer *_lexer;
+  JavaScript::NodePool *_nodePool;
+  JavaScript::AST::Node *_ast;
+  QSet<JavaScriptNameIdImpl> _literals;
+
+public:
+  JavaScriptEnginePrivate()
+    : _lexer(0), _nodePool(0), _ast(0)
+  { }
+
+  JavaScriptNameIdImpl *JavaScriptEnginePrivate::intern(const QChar *u, int s)
+  { return const_cast<JavaScriptNameIdImpl *>(&*_literals.insert(JavaScriptNameIdImpl(u, s))); }
+
+  JavaScript::Lexer *lexer() const
+  { return _lexer; }
+
+  void setLexer(JavaScript::Lexer *lexer)
+  { _lexer = lexer; }
+
+  JavaScript::NodePool *nodePool() const
+  { return _nodePool; }
+
+  void setNodePool(JavaScript::NodePool *nodePool)
+  { _nodePool = nodePool; }
+
+  JavaScript::AST::Node *ast() const
+  { return _ast; }
+
+  JavaScript::AST::Node *changeAbstractSyntaxTree(JavaScript::AST::Node *node)
+  {
+    JavaScript::AST::Node *previousAST = _ast;
+    _ast = node;
+    return previousAST;
+  }
+};
+
+
+#endif // JAVASCRIPTENGINE_P_H
diff --git a/src/plugins/qtscripteditor/parser/javascriptgrammar.cpp b/src/plugins/qtscripteditor/parser/javascriptgrammar.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..a86c20d271303c0deda0546cd9bb865fc35457c9
--- /dev/null
+++ b/src/plugins/qtscripteditor/parser/javascriptgrammar.cpp
@@ -0,0 +1,927 @@
+// This file was generated by qlalr - DO NOT EDIT!
+#include "javascriptgrammar_p.h"
+
+const char *const JavaScriptGrammar::spell [] = {
+  "end of file", "&", "&&", "&=", "break", "case", "catch", ":", ";", "continue", 
+  "default", "delete", "/", "/=", "do", ".", "else", "=", "==", "===", 
+  "finally", "for", "function", ">=", ">", ">>", ">>=", ">>>", ">>>=", "identifier", 
+  "if", "in", "instanceof", "{", "[", "<=", "(", "<", "<<", "<<=", 
+  "-", "-=", "--", "new", "!", "!=", "!==", "numeric literal", "|", "|=", 
+  "||", "+", "+=", "++", "?", "}", "]", "%", "%=", "return", 
+  ")", ";", 0, "*", "*=", "string literal", "switch", "this", "throw", "~", 
+  "try", "typeof", "var", "void", "while", "with", "^", "^=", "null", "true", 
+  "false", "const", "debugger", "reserved word", 
+#ifndef QLALR_NO_JAVASCRIPTGRAMMAR_DEBUG_INFO
+"Program", "PrimaryExpression", "ElisionOpt", "ElementList", "PropertyNameAndValueListOpt", "PropertyNameAndValueList", 
+  "Expression", "AssignmentExpression", "Elision", "PropertyName", "ReservedIdentifier", "PropertyIdentifier", "MemberExpression", "FunctionExpression", "Arguments", "NewExpression", 
+  "CallExpression", "ArgumentList", "LeftHandSideExpression", "PostfixExpression", "UnaryExpression", "MultiplicativeExpression", "AdditiveExpression", "ShiftExpression", "RelationalExpression", "RelationalExpressionNotIn", 
+  "EqualityExpression", "EqualityExpressionNotIn", "BitwiseANDExpression", "BitwiseANDExpressionNotIn", "BitwiseXORExpression", "BitwiseXORExpressionNotIn", "BitwiseORExpression", "BitwiseORExpressionNotIn", "LogicalANDExpression", "LogicalANDExpressionNotIn", 
+  "LogicalORExpression", "LogicalORExpressionNotIn", "ConditionalExpression", "ConditionalExpressionNotIn", "AssignmentExpressionNotIn", "AssignmentOperator", "ExpressionOpt", "ExpressionNotIn", "ExpressionNotInOpt", "Statement", 
+  "Block", "VariableStatement", "EmptyStatement", "ExpressionStatement", "IfStatement", "IterationStatement", "ContinueStatement", "BreakStatement", "ReturnStatement", "WithStatement", 
+  "LabelledStatement", "SwitchStatement", "ThrowStatement", "TryStatement", "DebuggerStatement", "StatementListOpt", "StatementList", "VariableDeclarationKind", "VariableDeclarationList", "VariableDeclaration", 
+  "VariableDeclarationListNotIn", "VariableDeclarationNotIn", "InitialiserOpt", "InitialiserNotInOpt", "Initialiser", "InitialiserNotIn", "CaseBlock", "CaseClausesOpt", "DefaultClause", "CaseClauses", 
+  "CaseClause", "Catch", "Finally", "FunctionDeclaration", "FormalParameterListOpt", "FunctionBodyOpt", "IdentifierOpt", "FormalParameterList", "FunctionBody", "SourceElements", 
+  "SourceElement", "$accept"
+#endif // QLALR_NO_JAVASCRIPTGRAMMAR_DEBUG_INFO
+};
+
+const int JavaScriptGrammar::lhs [] = {
+  85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 
+  85, 85, 85, 85, 85, 87, 87, 92, 92, 86, 
+  86, 89, 89, 93, 93, 93, 93, 94, 94, 94, 
+  94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 
+  94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 
+  94, 94, 94, 94, 94, 94, 94, 94, 95, 95, 
+  96, 96, 96, 96, 96, 99, 99, 100, 100, 100, 
+  100, 98, 98, 101, 101, 102, 102, 103, 103, 103, 
+  104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 
+  105, 105, 105, 105, 106, 106, 106, 107, 107, 107, 
+  107, 108, 108, 108, 108, 108, 108, 108, 109, 109, 
+  109, 109, 109, 109, 110, 110, 110, 110, 110, 111, 
+  111, 111, 111, 111, 112, 112, 113, 113, 114, 114, 
+  115, 115, 116, 116, 117, 117, 118, 118, 119, 119, 
+  120, 120, 121, 121, 122, 122, 123, 123, 91, 91, 
+  124, 124, 125, 125, 125, 125, 125, 125, 125, 125, 
+  125, 125, 125, 125, 90, 90, 126, 126, 127, 127, 
+  128, 128, 129, 129, 129, 129, 129, 129, 129, 129, 
+  129, 129, 129, 129, 129, 129, 129, 130, 146, 146, 
+  145, 145, 131, 131, 147, 147, 148, 148, 150, 150, 
+  149, 151, 154, 152, 152, 155, 153, 153, 132, 133, 
+  133, 134, 134, 135, 135, 135, 135, 135, 135, 135, 
+  136, 136, 136, 136, 137, 137, 137, 137, 138, 138, 
+  139, 141, 156, 156, 159, 159, 157, 157, 160, 158, 
+  140, 142, 142, 143, 143, 143, 161, 162, 144, 144, 
+  163, 97, 167, 167, 164, 164, 165, 165, 168, 84, 
+  169, 169, 170, 170, 166, 166, 88, 88, 171};
+
+const int JavaScriptGrammar:: rhs[] = {
+  1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 
+  3, 5, 3, 4, 3, 2, 4, 1, 2, 0, 
+  1, 3, 5, 1, 1, 1, 1, 1, 1, 1, 
+  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
+  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
+  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
+  1, 1, 4, 3, 3, 1, 2, 2, 2, 4, 
+  3, 2, 3, 1, 3, 1, 1, 1, 2, 2, 
+  1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 
+  1, 3, 3, 3, 1, 3, 3, 1, 3, 3, 
+  3, 1, 3, 3, 3, 3, 3, 3, 1, 3, 
+  3, 3, 3, 3, 1, 3, 3, 3, 3, 1, 
+  3, 3, 3, 3, 1, 3, 1, 3, 1, 3, 
+  1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 
+  1, 3, 1, 3, 1, 5, 1, 5, 1, 3, 
+  1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 
+  1, 1, 1, 1, 1, 3, 0, 1, 1, 3, 
+  0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
+  1, 1, 1, 1, 1, 1, 1, 3, 1, 2, 
+  0, 1, 3, 3, 1, 1, 1, 3, 1, 3, 
+  2, 2, 2, 0, 1, 2, 0, 1, 1, 2, 
+  2, 7, 5, 7, 7, 5, 9, 10, 7, 8, 
+  2, 2, 3, 3, 2, 2, 3, 3, 3, 3, 
+  5, 5, 3, 5, 1, 2, 0, 1, 4, 3, 
+  3, 3, 3, 3, 3, 4, 5, 2, 2, 2, 
+  8, 8, 1, 3, 0, 1, 0, 1, 1, 1, 
+  1, 2, 1, 1, 0, 1, 0, 1, 2};
+
+
+#ifndef QLALR_NO_JAVASCRIPTGRAMMAR_DEBUG_INFO
+const int JavaScriptGrammar::rule_info [] = {
+    85, 67
+  , 85, 29
+  , 85, 78
+  , 85, 79
+  , 85, 80
+  , 85, 47
+  , 85, 65
+  , 85, 12
+  , 85, 13
+  , 85, 34, 86, 56
+  , 85, 34, 87, 56
+  , 85, 34, 87, 8, 86, 56
+  , 85, 33, 88, 55
+  , 85, 33, 89, 8, 55
+  , 85, 36, 90, 60
+  , 87, 86, 91
+  , 87, 87, 8, 86, 91
+  , 92, 8
+  , 92, 92, 8
+  , 86
+  , 86, 92
+  , 89, 93, 7, 91
+  , 89, 89, 8, 93, 7, 91
+  , 93, 29
+  , 93, 65
+  , 93, 47
+  , 93, 94
+  , 94, 4
+  , 94, 5
+  , 94, 6
+  , 94, 9
+  , 94, 10
+  , 94, 11
+  , 94, 14
+  , 94, 16
+  , 94, 80
+  , 94, 20
+  , 94, 21
+  , 94, 22
+  , 94, 30
+  , 94, 31
+  , 94, 32
+  , 94, 43
+  , 94, 78
+  , 94, 59
+  , 94, 66
+  , 94, 67
+  , 94, 68
+  , 94, 79
+  , 94, 70
+  , 94, 71
+  , 94, 72
+  , 94, 73
+  , 94, 74
+  , 94, 81
+  , 94, 82
+  , 94, 83
+  , 94, 75
+  , 95, 29
+  , 95, 94
+  , 96, 85
+  , 96, 97
+  , 96, 96, 34, 90, 56
+  , 96, 96, 15, 95
+  , 96, 43, 96, 98
+  , 99, 96
+  , 99, 43, 99
+  , 100, 96, 98
+  , 100, 100, 98
+  , 100, 100, 34, 90, 56
+  , 100, 100, 15, 95
+  , 98, 36, 60
+  , 98, 36, 101, 60
+  , 101, 91
+  , 101, 101, 8, 91
+  , 102, 99
+  , 102, 100
+  , 103, 102
+  , 103, 102, 53
+  , 103, 102, 42
+  , 104, 103
+  , 104, 11, 104
+  , 104, 73, 104
+  , 104, 71, 104
+  , 104, 53, 104
+  , 104, 42, 104
+  , 104, 51, 104
+  , 104, 40, 104
+  , 104, 69, 104
+  , 104, 44, 104
+  , 105, 104
+  , 105, 105, 63, 104
+  , 105, 105, 12, 104
+  , 105, 105, 57, 104
+  , 106, 105
+  , 106, 106, 51, 105
+  , 106, 106, 40, 105
+  , 107, 106
+  , 107, 107, 38, 106
+  , 107, 107, 25, 106
+  , 107, 107, 27, 106
+  , 108, 107
+  , 108, 108, 37, 107
+  , 108, 108, 24, 107
+  , 108, 108, 35, 107
+  , 108, 108, 23, 107
+  , 108, 108, 32, 107
+  , 108, 108, 31, 107
+  , 109, 107
+  , 109, 109, 37, 107
+  , 109, 109, 24, 107
+  , 109, 109, 35, 107
+  , 109, 109, 23, 107
+  , 109, 109, 32, 107
+  , 110, 108
+  , 110, 110, 18, 108
+  , 110, 110, 45, 108
+  , 110, 110, 19, 108
+  , 110, 110, 46, 108
+  , 111, 109
+  , 111, 111, 18, 109
+  , 111, 111, 45, 109
+  , 111, 111, 19, 109
+  , 111, 111, 46, 109
+  , 112, 110
+  , 112, 112, 1, 110
+  , 113, 111
+  , 113, 113, 1, 111
+  , 114, 112
+  , 114, 114, 76, 112
+  , 115, 113
+  , 115, 115, 76, 113
+  , 116, 114
+  , 116, 116, 48, 114
+  , 117, 115
+  , 117, 117, 48, 115
+  , 118, 116
+  , 118, 118, 2, 116
+  , 119, 117
+  , 119, 119, 2, 117
+  , 120, 118
+  , 120, 120, 50, 118
+  , 121, 119
+  , 121, 121, 50, 119
+  , 122, 120
+  , 122, 120, 54, 91, 7, 91
+  , 123, 121
+  , 123, 121, 54, 124, 7, 124
+  , 91, 122
+  , 91, 102, 125, 91
+  , 124, 123
+  , 124, 102, 125, 124
+  , 125, 17
+  , 125, 64
+  , 125, 13
+  , 125, 58
+  , 125, 52
+  , 125, 41
+  , 125, 39
+  , 125, 26
+  , 125, 28
+  , 125, 3
+  , 125, 77
+  , 125, 49
+  , 90, 91
+  , 90, 90, 8, 91
+  , 126
+  , 126, 90
+  , 127, 124
+  , 127, 127, 8, 124
+  , 128
+  , 128, 127
+  , 129, 130
+  , 129, 131
+  , 129, 132
+  , 129, 133
+  , 129, 134
+  , 129, 135
+  , 129, 136
+  , 129, 137
+  , 129, 138
+  , 129, 139
+  , 129, 140
+  , 129, 141
+  , 129, 142
+  , 129, 143
+  , 129, 144
+  , 130, 33, 145, 55
+  , 146, 129
+  , 146, 146, 129
+  , 145
+  , 145, 146
+  , 131, 147, 148, 62
+  , 131, 147, 148, 61
+  , 147, 81
+  , 147, 72
+  , 148, 149
+  , 148, 148, 8, 149
+  , 150, 151
+  , 150, 150, 8, 151
+  , 149, 29, 152
+  , 151, 29, 153
+  , 154, 17, 91
+  , 152
+  , 152, 154
+  , 155, 17, 124
+  , 153
+  , 153, 155
+  , 132, 61
+  , 133, 90, 62
+  , 133, 90, 61
+  , 134, 30, 36, 90, 60, 129, 16, 129
+  , 134, 30, 36, 90, 60, 129
+  , 135, 14, 129, 74, 36, 90, 60, 62
+  , 135, 14, 129, 74, 36, 90, 60, 61
+  , 135, 74, 36, 90, 60, 129
+  , 135, 21, 36, 128, 61, 126, 61, 126, 60, 129
+  , 135, 21, 36, 72, 150, 61, 126, 61, 126, 60, 129
+  , 135, 21, 36, 102, 31, 90, 60, 129
+  , 135, 21, 36, 72, 151, 31, 90, 60, 129
+  , 136, 9, 62
+  , 136, 9, 61
+  , 136, 9, 29, 62
+  , 136, 9, 29, 61
+  , 137, 4, 62
+  , 137, 4, 61
+  , 137, 4, 29, 62
+  , 137, 4, 29, 61
+  , 138, 59, 126, 62
+  , 138, 59, 126, 61
+  , 139, 75, 36, 90, 60, 129
+  , 141, 66, 36, 90, 60, 156
+  , 156, 33, 157, 55
+  , 156, 33, 157, 158, 157, 55
+  , 159, 160
+  , 159, 159, 160
+  , 157
+  , 157, 159
+  , 160, 5, 90, 7, 145
+  , 158, 10, 7, 145
+  , 140, 29, 7, 129
+  , 142, 68, 90, 62
+  , 142, 68, 90, 61
+  , 143, 70, 130, 161
+  , 143, 70, 130, 162
+  , 143, 70, 130, 161, 162
+  , 161, 6, 36, 29, 60, 130
+  , 162, 20, 130
+  , 144, 82, 62
+  , 144, 82, 61
+  , 163, 22, 29, 36, 164, 60, 33, 165, 55
+  , 97, 22, 166, 36, 164, 60, 33, 165, 55
+  , 167, 29
+  , 167, 167, 8, 29
+  , 164
+  , 164, 167
+  , 165
+  , 165, 168
+  , 168, 169
+  , 84, 169
+  , 169, 170
+  , 169, 169, 170
+  , 170, 129
+  , 170, 163
+  , 166
+  , 166, 29
+  , 88
+  , 88, 89
+  , 171, 84, 0};
+
+const int JavaScriptGrammar::rule_index [] = {
+  0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 
+  22, 26, 32, 36, 41, 45, 48, 53, 55, 58, 
+  59, 61, 65, 71, 73, 75, 77, 79, 81, 83, 
+  85, 87, 89, 91, 93, 95, 97, 99, 101, 103, 
+  105, 107, 109, 111, 113, 115, 117, 119, 121, 123, 
+  125, 127, 129, 131, 133, 135, 137, 139, 141, 143, 
+  145, 147, 149, 154, 158, 162, 164, 167, 170, 173, 
+  178, 182, 185, 189, 191, 195, 197, 199, 201, 204, 
+  207, 209, 212, 215, 218, 221, 224, 227, 230, 233, 
+  236, 238, 242, 246, 250, 252, 256, 260, 262, 266, 
+  270, 274, 276, 280, 284, 288, 292, 296, 300, 302, 
+  306, 310, 314, 318, 322, 324, 328, 332, 336, 340, 
+  342, 346, 350, 354, 358, 360, 364, 366, 370, 372, 
+  376, 378, 382, 384, 388, 390, 394, 396, 400, 402, 
+  406, 408, 412, 414, 418, 420, 426, 428, 434, 436, 
+  440, 442, 446, 448, 450, 452, 454, 456, 458, 460, 
+  462, 464, 466, 468, 470, 472, 476, 477, 479, 481, 
+  485, 486, 488, 490, 492, 494, 496, 498, 500, 502, 
+  504, 506, 508, 510, 512, 514, 516, 518, 522, 524, 
+  527, 528, 530, 534, 538, 540, 542, 544, 548, 550, 
+  554, 557, 560, 563, 564, 566, 569, 570, 572, 574, 
+  577, 580, 588, 594, 602, 610, 616, 626, 637, 645, 
+  654, 657, 660, 664, 668, 671, 674, 678, 682, 686, 
+  690, 696, 702, 706, 712, 714, 717, 718, 720, 725, 
+  729, 733, 737, 741, 745, 749, 754, 760, 763, 766, 
+  769, 778, 787, 789, 793, 794, 796, 797, 799, 801, 
+  803, 805, 808, 810, 812, 813, 815, 816, 818};
+#endif // QLALR_NO_JAVASCRIPTGRAMMAR_DEBUG_INFO
+
+const int JavaScriptGrammar::action_default [] = {
+  0, 98, 165, 129, 137, 133, 173, 180, 77, 149, 
+  179, 187, 175, 125, 0, 176, 264, 62, 177, 178, 
+  183, 78, 141, 145, 66, 95, 76, 81, 61, 0, 
+  115, 181, 102, 261, 260, 263, 184, 0, 195, 0, 
+  0, 0, 8, 9, 0, 5, 0, 265, 2, 0, 
+  267, 20, 0, 0, 0, 0, 0, 3, 6, 0, 
+  0, 167, 209, 7, 0, 1, 0, 0, 4, 0, 
+  0, 196, 0, 0, 0, 185, 186, 91, 0, 174, 
+  182, 0, 0, 78, 97, 265, 2, 267, 80, 79, 
+  0, 0, 0, 93, 94, 92, 0, 266, 255, 256, 
+  0, 253, 0, 254, 0, 257, 258, 0, 259, 252, 
+  262, 0, 268, 0, 27, 28, 29, 30, 55, 31, 
+  56, 32, 33, 34, 35, 36, 37, 38, 39, 24, 
+  40, 41, 42, 43, 44, 26, 57, 45, 25, 46, 
+  47, 48, 49, 50, 51, 52, 53, 54, 58, 0, 
+  22, 0, 0, 14, 0, 23, 13, 96, 0, 126, 
+  0, 0, 0, 0, 116, 0, 0, 0, 0, 0, 
+  0, 106, 0, 0, 0, 100, 101, 99, 104, 108, 
+  107, 105, 103, 118, 117, 119, 0, 134, 0, 130, 
+  69, 0, 0, 0, 71, 60, 59, 0, 0, 70, 
+  166, 0, 74, 72, 0, 73, 75, 210, 211, 0, 
+  162, 155, 153, 160, 161, 159, 158, 164, 157, 156, 
+  154, 163, 150, 0, 138, 0, 0, 142, 0, 0, 
+  146, 68, 0, 0, 64, 0, 63, 269, 225, 0, 
+  226, 227, 228, 221, 0, 222, 223, 224, 249, 250, 
+  82, 0, 0, 0, 0, 0, 214, 215, 171, 169, 
+  131, 139, 135, 151, 127, 172, 0, 78, 143, 147, 
+  120, 109, 0, 0, 128, 0, 0, 0, 0, 121, 
+  0, 0, 0, 0, 0, 113, 111, 114, 112, 110, 
+  123, 122, 124, 0, 136, 0, 132, 0, 170, 78, 
+  0, 152, 167, 168, 0, 167, 0, 0, 217, 0, 
+  0, 0, 219, 0, 140, 0, 0, 144, 0, 0, 
+  148, 207, 0, 199, 208, 202, 0, 206, 0, 167, 
+  200, 0, 167, 0, 0, 218, 0, 0, 0, 220, 
+  266, 255, 0, 0, 257, 0, 251, 0, 241, 0, 
+  0, 0, 213, 0, 212, 189, 192, 0, 28, 55, 
+  31, 56, 33, 34, 5, 38, 39, 2, 40, 43, 
+  3, 6, 167, 7, 46, 1, 48, 4, 50, 51, 
+  52, 53, 54, 58, 190, 188, 66, 67, 65, 0, 
+  229, 230, 0, 0, 0, 232, 237, 235, 238, 0, 
+  0, 236, 237, 0, 233, 0, 234, 191, 240, 0, 
+  191, 239, 0, 242, 243, 0, 191, 244, 245, 0, 
+  0, 246, 0, 0, 0, 247, 248, 84, 83, 0, 
+  0, 0, 216, 0, 0, 0, 231, 0, 21, 0, 
+  18, 20, 11, 0, 17, 12, 19, 16, 10, 0, 
+  15, 88, 86, 90, 87, 85, 89, 204, 197, 0, 
+  205, 201, 0, 203, 193, 0, 194, 198};
+
+const int JavaScriptGrammar::goto_default [] = {
+  29, 28, 439, 437, 113, 112, 14, 2, 438, 111, 
+  114, 194, 24, 17, 190, 26, 8, 201, 21, 27, 
+  77, 25, 1, 32, 30, 270, 13, 264, 3, 260, 
+  5, 262, 4, 261, 22, 268, 23, 269, 9, 263, 
+  259, 300, 389, 265, 266, 35, 6, 79, 12, 15, 
+  18, 19, 10, 7, 31, 80, 20, 36, 75, 76, 
+  11, 357, 356, 78, 459, 458, 322, 323, 461, 325, 
+  460, 324, 395, 399, 402, 398, 397, 417, 418, 16, 
+  100, 107, 96, 99, 106, 108, 33, 0};
+
+const int JavaScriptGrammar::action_index [] = {
+  1318, 79, -84, 56, 39, -17, -84, -84, 169, -84, 
+  -84, -84, -84, 216, 149, -84, -84, -84, -84, -84, 
+  -84, 475, 68, 100, 180, 184, -84, -84, -84, 99, 
+  303, -84, 193, -84, 1318, -84, -84, 160, -84, 194, 
+  85, 629, -84, -84, 1398, -84, -5, 32, 42, 26, 
+  1478, 37, 629, 629, 629, 366, 629, -84, -84, 629, 
+  629, 629, -84, -84, 55, -84, 629, 629, -84, 61, 
+  629, -84, 629, 52, 38, -84, -84, -84, 49, -84, 
+  -84, 629, 629, 64, 182, 48, -84, 1158, -84, -84, 
+  629, 629, 629, -84, -84, -84, 36, -84, 44, 50, 
+  40, -84, 57, -84, -26, 1318, -84, -53, 1318, -84, 
+  -84, 18, 7, 43, -84, -84, -84, -84, -84, -84, 
+  -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, 
+  -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, 
+  -84, -84, -84, -84, -84, -84, -84, -84, -84, 629, 
+  -84, 1238, 23, -84, 629, -84, -84, 189, 629, 214, 
+  629, 629, 629, 629, 293, 629, 629, 629, 629, 629, 
+  629, 143, 629, 629, 629, 65, 83, 69, 153, 152, 
+  144, 161, 175, 273, 283, 318, 629, 62, 629, 74, 
+  -84, 1078, 629, 702, -84, -84, -84, 84, 629, -84, 
+  -84, 88, -84, -84, 629, -84, -84, -84, -84, 629, 
+  -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, 
+  -84, -84, -84, 629, 45, 629, 629, 63, 53, 629, 
+  -84, -84, 1078, 629, -84, 102, -84, -84, -84, 90, 
+  -84, -84, -84, -84, 101, -84, -84, -84, -84, -84, 
+  -84, 51, 59, 629, 89, 94, -84, -84, 775, -84, 
+  13, -36, -65, -84, 230, 2, -52, 556, 14, 133, 
+  248, 147, -12, 629, 224, 629, 629, 629, 629, 258, 
+  629, 629, 629, 629, 629, 199, 261, 261, 261, 181, 
+  242, 322, 322, 629, -55, 629, 5, 629, -84, 334, 
+  629, -84, 629, 15, -61, 629, -59, 1398, -84, 629, 
+  73, 1398, -84, 629, 20, 629, 629, 24, 41, 629, 
+  -84, 54, 82, 19, -84, -84, 629, -84, 17, 629, 
+  -84, -10, 629, -7, 1398, -84, 629, 77, 1398, -84, 
+  31, 27, -13, 10, 1318, -22, -84, 1398, -84, 629, 
+  76, 1398, 11, 1398, -84, -84, 1398, -15, 136, 9, 
+  131, 80, 629, 1398, 28, 6, 78, 47, 8, 394, 
+  34, 30, 925, 29, 3, 21, 629, 25, 1, 629, 
+  35, 629, 33, 16, -84, -84, 202, -84, -84, 67, 
+  -84, -84, 629, 72, -4, -84, -2, -84, -1, 66, 
+  629, -84, 0, 12, -84, -37, -84, 1398, -84, 95, 
+  1398, -84, 105, -84, -84, 98, 1398, 4, -84, -14, 
+  -25, -84, -16, -40, 22, -84, -84, -84, -84, 629, 
+  93, 1398, -84, 629, 104, 1398, -84, 103, 71, 848, 
+  -84, 58, -84, 998, -84, -84, -84, -84, -84, 75, 
+  -84, -84, -84, -84, -84, -84, -84, 46, -84, 114, 
+  -84, -84, 629, -84, -84, 60, -84, -84, 
+
+  -50, -88, -88, -88, -88, -88, -88, -88, -88, -88, 
+  -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, 
+  -88, -28, -88, -88, -10, -88, -88, -88, -88, -88, 
+  -88, -88, -88, -88, -64, -88, -88, -88, -88, -88, 
+  -88, 131, -88, -88, -22, -88, -88, -88, -88, -88, 
+  -27, -88, 13, 94, 88, 98, 89, -88, -88, 106, 
+  107, -4, -88, -88, -88, -88, 68, 111, -88, -31, 
+  85, -88, 110, -88, -88, -88, -88, -88, -88, -88, 
+  -88, 127, 122, -88, -88, -88, -88, -88, -88, -88, 
+  97, 100, 101, -88, -88, -88, -88, -88, -88, -88, 
+  -88, -88, -88, -88, -88, -88, -88, -88, -48, -88, 
+  -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, 
+  -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, 
+  -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, 
+  -88, -88, -88, -88, -88, -88, -88, -88, -88, 32, 
+  -88, 33, -88, -88, 34, -88, -88, -88, 46, -88, 
+  60, 74, 76, 77, -88, 73, 67, 70, 81, 58, 
+  79, -88, 37, 51, 65, -88, -88, -88, -88, -88, 
+  -88, -88, -88, -88, -88, -88, 59, -88, 43, -88, 
+  -88, 42, 48, 20, -88, -88, -88, -88, 41, -88, 
+  -88, -88, -88, -88, 40, -88, -88, -88, -88, 49, 
+  -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, 
+  -88, -88, -88, 50, -88, 45, 26, -88, -88, 24, 
+  -88, -88, 56, 22, -88, -88, -88, -88, -88, -88, 
+  -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, 
+  -88, -88, -88, 31, -88, -88, -88, -88, 57, -88, 
+  -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, 
+  -88, -88, -88, 158, -88, 146, 142, 150, 154, -88, 
+  47, 138, 115, 135, 132, -88, -88, -88, -88, -88, 
+  -88, -88, -88, 168, -88, 172, -88, 160, -88, -88, 
+  180, -88, 220, -88, -88, 117, -88, -2, -88, 38, 
+  -88, -5, -88, 174, -88, 170, 166, -88, -88, 164, 
+  -88, -88, -88, -88, -88, -88, 190, -88, -37, 80, 
+  -88, -88, 105, -88, -13, -88, 28, -88, 0, -88, 
+  -88, -44, -88, -88, -52, -88, -88, 12, -88, 52, 
+  -88, 1, -88, 4, -88, -88, 6, -88, -88, -88, 
+  -88, -88, 119, 8, -88, -88, -88, -88, -88, 120, 
+  -88, -88, 44, -88, -88, -88, 68, -88, -45, 116, 
+  -88, 124, -88, -88, -88, -88, -14, -88, -88, -88, 
+  -88, -88, -1, -88, -88, -88, -88, -88, -55, -88, 
+  11, -88, -53, -88, -88, -88, -88, 109, -88, -88, 
+  96, -88, -88, -88, -88, -88, -19, -54, -88, -88, 
+  -21, -88, -88, -88, -43, -88, -88, -88, -88, 10, 
+  -88, -38, -88, 2, -88, -39, -88, -88, -88, 3, 
+  -88, 9, -88, 7, -88, -88, -88, -88, -88, -88, 
+  -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, 
+  -88, -88, 5, -88, -88, -56, -88, -88};
+
+const int JavaScriptGrammar::action_info [] = {
+  305, 307, 109, 400, 400, 400, 273, 105, 416, 302, 
+  297, 295, 293, 423, 273, 151, 313, 321, 406, 407, 
+  424, 295, 422, 198, 420, 149, 313, 353, -47, 396, 
+  154, 258, -49, 346, 416, -36, -25, -26, -195, 392, 
+  385, -44, 258, 344, 349, 440, 321, 343, 319, 347, 
+  336, 332, 433, 334, 347, 416, 101, 158, 102, 188, 
+  229, 340, 349, 462, -196, 223, 440, 341, 293, 429, 
+  223, 326, 98, 101, 433, 158, 403, 97, 457, 446, 
+  198, 198, 0, 198, 198, 198, 103, 186, 429, 457, 
+  328, 392, 198, 186, 416, 253, 204, 198, 156, 237, 
+  104, 198, 410, 198, 419, 81, 88, 97, 0, 81, 
+  198, 441, 198, 198, -265, 0, 82, 89, 420, 81, 
+  82, 404, 465, 81, 0, 252, 0, 0, 391, 390, 
+  82, 0, 394, 311, 82, 450, 351, 338, 188, 0, 
+  199, 249, 248, 329, 0, 0, 249, 248, 205, 255, 
+  225, 242, 241, 431, 226, 257, 256, 198, 236, 442, 
+  244, 0, 247, 246, 435, 239, 414, 413, 172, 172, 
+  173, 173, 172, 0, 173, 466, 464, 172, 172, 173, 
+  173, 174, 174, 315, 191, 174, 172, 316, 173, 239, 
+  174, 174, 245, 243, 90, 232, 90, 240, 238, 174, 
+  172, 90, 173, 192, 0, 193, 172, 0, 173, 0, 
+  208, 207, 0, 174, 233, 0, 193, 232, 172, 174, 
+  173, 240, 238, 244, 172, 0, 173, 0, 0, 0, 
+  0, 174, 160, 161, 160, 161, 233, 174, 193, 91, 
+  0, 91, 275, 276, 0, 92, 91, 92, 275, 276, 
+  0, 0, 92, 0, 0, 245, 243, 0, 0, 162, 
+  163, 162, 163, 0, 0, 280, 281, 0, 0, 277, 
+  278, 280, 281, 0, 282, 277, 278, 283, 0, 284, 
+  282, 280, 281, 283, 0, 284, 172, 0, 173, 0, 
+  282, 0, 0, 283, 0, 284, 165, 166, 0, 174, 
+  0, 0, 0, 0, 167, 168, 165, 166, 169, 0, 
+  170, 0, 0, 0, 167, 168, 165, 166, 169, 0, 
+  170, 0, 0, 0, 167, 168, 165, 166, 169, 0, 
+  170, 0, 0, 0, 167, 168, 0, 210, 169, 0, 
+  170, 165, 166, 0, 0, 280, 281, 211, 0, 167, 
+  168, 212, 0, 169, 282, 170, 0, 283, 0, 284, 
+  213, 0, 214, 0, 0, 0, 0, 0, 0, 0, 
+  0, 0, 0, 215, 0, 216, 88, 0, 42, 43, 
+  0, 0, 0, 217, 0, 0, 218, 89, 85, 0, 
+  0, 0, 219, 0, 0, 86, 0, 0, 220, 87, 
+  51, 0, 52, 0, 0, 0, 42, 43, 0, 55, 
+  0, 221, 0, 58, 0, 0, 85, 0, 0, 0, 
+  0, 0, 0, 86, 0, 0, 0, 87, 51, 0, 
+  52, 63, 0, 65, 0, 0, 0, 55, 0, 0, 
+  0, 58, 0, 0, 57, 68, 45, 0, 0, 0, 
+  0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 
+  0, 65, 0, 0, 0, 0, 0, 0, 0, 0, 
+  0, 0, 57, 68, 45, 0, 0, 0, 210, 0, 
+  0, 0, 0, 0, 0, 0, 0, 0, 211, 0, 
+  0, 0, 212, 0, 0, 0, 0, 0, 0, 0, 
+  0, 213, 0, 214, 0, 0, 0, 0, 0, 0, 
+  0, 0, 0, 0, 215, 0, 216, 88, 0, 0, 
+  0, 0, 0, 0, 217, 0, 0, 218, 89, 0, 
+  0, 0, 0, 219, 0, 0, 0, 0, 0, 220, 
+  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+  0, 0, 221, 0, 0, 0, 0, 0, 0, 210, 
+  0, 0, 0, 0, 0, 0, 0, 0, 0, 211, 
+  0, 0, 0, 212, 0, 0, 0, 0, 0, 0, 
+  0, 0, 213, 0, 214, 0, 0, 309, 0, 0, 
+  0, 0, 0, 0, 0, 215, 0, 216, 88, 0, 
+  0, 0, 0, 0, 0, 217, 0, 0, 218, 89, 
+  0, 0, 0, 0, 219, 0, 0, 0, 0, 0, 
+  220, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+  0, 0, 0, 221, 0, 0, 0, 0, 0, 0, 
+  41, 42, 43, 0, 0, 0, 0, 0, 0, 0, 
+  0, 85, 0, 0, 0, 0, 0, 0, 86, 0, 
+  0, 0, 87, 51, 0, 52, 0, 0, 0, 53, 
+  0, 54, 55, 56, 0, 0, 58, 0, 0, 0, 
+  59, 0, 60, 0, 0, 0, 0, 0, 0, 0, 
+  0, 0, 0, 0, 63, 0, 65, 0, 67, 0, 
+  70, 0, 72, 0, 0, 0, 0, 57, 68, 45, 
+  0, 0, 0, 41, 42, 43, 0, 0, 0, 0, 
+  0, 0, 0, 0, 85, 0, 0, 0, 0, 0, 
+  0, 86, 0, 0, 0, 87, 51, 0, 52, 0, 
+  0, 0, 53, 0, 54, 55, 56, 0, 0, 58, 
+  0, 0, 0, 59, 0, 60, 0, 0, 0, 0, 
+  0, 0, 203, 0, 0, 0, 0, 63, 0, 65, 
+  0, 67, 0, 70, 0, 72, 0, 0, 0, 0, 
+  57, 68, 45, 0, 0, 0, 41, 42, 43, 0, 
+  0, 0, 0, 0, 0, 0, 0, 85, 0, 0, 
+  0, 0, 0, 0, 86, 0, 0, 0, 87, 51, 
+  0, 52, 0, 0, 0, 53, 0, 54, 55, 56, 
+  0, 0, 58, 0, 0, 0, 59, 0, 60, 0, 
+  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+  63, 0, 65, 0, 67, 0, 70, 272, 72, 0, 
+  0, 0, 0, 57, 68, 45, 0, 0, 0, 41, 
+  42, 43, 0, 0, 0, 0, 0, 0, 0, 0, 
+  85, 0, 0, 0, 0, 0, 0, 86, 0, 0, 
+  0, 87, 51, 0, 52, 0, 0, 0, 53, 0, 
+  54, 55, 56, 0, 0, 58, 0, 0, 0, 59, 
+  0, 60, 0, 0, 448, 0, 0, 0, 0, 0, 
+  0, 0, 0, 63, 0, 65, 0, 67, 0, 70, 
+  0, 72, 0, 0, 0, 0, 57, 68, 45, 0, 
+  0, 0, -45, 0, 0, 0, 41, 42, 43, 0, 
+  0, 0, 0, 0, 0, 0, 0, 85, 0, 0, 
+  0, 0, 0, 0, 86, 0, 0, 0, 87, 51, 
+  0, 52, 0, 0, 0, 53, 0, 54, 55, 56, 
+  0, 0, 58, 0, 0, 0, 59, 0, 60, 0, 
+  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+  63, 0, 65, 0, 67, 0, 70, 0, 72, 0, 
+  0, 0, 0, 57, 68, 45, 0, 0, 0, 41, 
+  42, 43, 0, 0, 0, 0, 0, 0, 0, 0, 
+  85, 0, 0, 0, 0, 0, 0, 86, 0, 0, 
+  0, 87, 51, 0, 52, 0, 0, 0, 53, 0, 
+  54, 55, 56, 0, 0, 58, 0, 0, 0, 59, 
+  0, 60, 0, 0, 445, 0, 0, 0, 0, 0, 
+  0, 0, 0, 63, 0, 65, 0, 67, 0, 70, 
+  0, 72, 0, 0, 0, 0, 57, 68, 45, 0, 
+  0, 0, 115, 116, 117, 0, 0, 119, 121, 122, 
+  0, 0, 123, 0, 124, 0, 0, 0, 126, 127, 
+  128, 0, 0, 0, 0, 0, 0, 196, 130, 131, 
+  132, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+  0, 133, 0, 0, 0, 0, 0, 0, 0, 0, 
+  0, 0, 0, 0, 0, 0, 0, 137, 0, 0, 
+  0, 0, 0, 0, 139, 140, 141, 0, 143, 144, 
+  145, 146, 147, 148, 0, 0, 134, 142, 125, 118, 
+  120, 136, 115, 116, 117, 0, 0, 119, 121, 122, 
+  0, 0, 123, 0, 124, 0, 0, 0, 126, 127, 
+  128, 0, 0, 0, 0, 0, 0, 129, 130, 131, 
+  132, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+  0, 133, 0, 0, 0, 135, 0, 0, 0, 0, 
+  0, 0, 0, 0, 0, 0, 0, 137, 0, 0, 
+  0, 0, 0, 138, 139, 140, 141, 0, 143, 144, 
+  145, 146, 147, 148, 0, 0, 134, 142, 125, 118, 
+  120, 136, 115, 116, 117, 0, 0, 119, 121, 122, 
+  0, 0, 123, 0, 124, 0, 0, 0, 126, 127, 
+  128, 0, 0, 0, 0, 0, 0, 129, 130, 131, 
+  132, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+  0, 133, 0, 0, 0, 135, 0, 0, 0, 0, 
+  0, 0, 0, 153, 0, 0, 0, 137, 0, 0, 
+  0, 0, 0, 138, 139, 140, 141, 0, 143, 144, 
+  145, 146, 147, 148, 0, 0, 134, 142, 125, 118, 
+  120, 136, 37, 0, 0, 0, 0, 39, 0, 41, 
+  42, 43, 44, 0, 0, 0, 0, 0, 0, 46, 
+  47, 0, 0, 0, 0, 0, 0, 48, 49, 0, 
+  0, 50, 51, 0, 52, 0, 0, 0, 53, 0, 
+  54, 55, 56, 0, 0, 58, 0, 0, 0, 59, 
+  0, 60, 0, 0, 0, 0, 0, 61, 0, 62, 
+  0, 0, 0, 63, 64, 65, 66, 67, 69, 70, 
+  71, 72, 73, 74, 0, 0, 57, 68, 45, 38, 
+  40, 0, 37, 0, 0, 0, 0, 39, 0, 41, 
+  42, 43, 44, 0, 0, 0, 0, 0, 0, 46, 
+  85, 0, 0, 0, 0, 0, 0, 48, 49, 0, 
+  0, 50, 51, 0, 52, 0, 0, 0, 53, 0, 
+  54, 55, 56, 0, 0, 58, 0, 0, 0, 59, 
+  0, 60, 0, 0, 0, 0, 0, 61, 0, 62, 
+  0, 0, 0, 63, 64, 65, 66, 67, 69, 70, 
+  71, 72, 73, 74, 0, 0, 57, 68, 45, 38, 
+  40, 0, 358, 116, 117, 0, 0, 360, 121, 362, 
+  42, 43, 363, 0, 124, 0, 0, 0, 126, 365, 
+  366, 0, 0, 0, 0, 0, 0, 367, 368, 131, 
+  132, 50, 51, 0, 52, 0, 0, 0, 53, 0, 
+  54, 369, 56, 0, 0, 371, 0, 0, 0, 59, 
+  0, 60, 0, -191, 0, 0, 0, 372, 0, 62, 
+  0, 0, 0, 373, 374, 375, 376, 67, 378, 379, 
+  380, 381, 382, 383, 0, 0, 370, 377, 364, 359, 
+  361, 136, 
+
+  388, 415, 303, 425, 231, 393, 436, 432, 434, 467, 
+  447, 443, 463, 209, 444, 415, 430, 409, 355, 449, 
+  405, 401, 110, 251, 421, 426, 355, 202, 235, 345, 
+  330, 230, 335, 228, 337, 34, 342, 254, 110, 150, 
+  312, 155, 152, 308, 310, 339, 352, 206, 200, 354, 
+  303, 384, 195, 251, 197, 83, 222, 348, 350, 175, 
+  0, 83, 0, 83, 83, 83, 195, 234, 83, 83, 
+  285, 189, 159, 176, 412, 267, 83, 83, 83, 227, 
+  271, 181, 224, 83, 164, 83, 303, 177, 83, 187, 
+  178, 83, 83, 179, 83, 83, 171, 83, 183, 83, 
+  184, 185, 182, 83, 180, 427, 83, 83, 452, 453, 
+  386, 303, 83, 387, 451, 83, 0, 93, 83, 83, 
+  94, 95, 331, 303, 83, 83, 454, 455, 83, 83, 
+  428, 456, 386, 83, 83, 387, 427, 83, 287, 250, 
+  83, 355, 83, 157, 428, 83, 0, 333, 84, 83, 
+  83, 250, 0, 83, 355, 289, 83, 411, 288, 306, 
+  83, 286, 0, 0, 83, 271, 0, 290, 83, 271, 
+  408, 279, 83, 271, 0, 291, 83, 271, 299, 292, 
+  0, 271, 299, 271, 299, 274, 83, 271, 83, 271, 
+  83, 271, 83, 271, 0, 271, 0, 271, 299, 294, 
+  298, 296, 0, 271, 320, 317, 318, 314, 299, 0, 
+  0, 0, 0, 271, 0, 0, 0, 0, 0, 0, 
+  301, 0, 0, 0, 0, 0, 303, 0, 0, 0, 
+  327, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+  0, 0, 304, 0, 0, 0, 0, 0, 0, 0, 
+  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+  0, 0, 0, 0, 0, 0, 0, 0};
+
+const int JavaScriptGrammar::action_check [] = {
+  61, 60, 55, 5, 5, 5, 1, 33, 33, 61, 
+  8, 76, 48, 29, 1, 8, 2, 29, 55, 7, 
+  60, 76, 36, 8, 20, 7, 2, 16, 7, 33, 
+  7, 36, 7, 55, 33, 7, 7, 7, 29, 36, 
+  55, 7, 36, 33, 36, 8, 29, 60, 7, 7, 
+  31, 61, 36, 60, 7, 33, 29, 1, 8, 76, 
+  7, 29, 36, 17, 29, 2, 8, 36, 48, 36, 
+  2, 17, 36, 29, 36, 1, 10, 29, 29, 8, 
+  8, 8, -1, 8, 8, 8, 29, 48, 36, 29, 
+  8, 36, 8, 48, 33, 36, 8, 8, 55, 0, 
+  60, 8, 7, 8, 6, 40, 42, 29, -1, 40, 
+  8, 8, 8, 8, 36, -1, 51, 53, 20, 40, 
+  51, 55, 8, 40, -1, 74, -1, -1, 61, 62, 
+  51, -1, 60, 60, 51, 60, 60, 60, 76, -1, 
+  56, 61, 62, 61, -1, -1, 61, 62, 60, 60, 
+  50, 61, 62, 60, 54, 61, 62, 8, 56, 56, 
+  29, -1, 61, 62, 60, 29, 61, 62, 25, 25, 
+  27, 27, 25, -1, 27, 61, 62, 25, 25, 27, 
+  27, 38, 38, 50, 15, 38, 25, 54, 27, 29, 
+  38, 38, 61, 62, 12, 15, 12, 61, 62, 38, 
+  25, 12, 27, 34, -1, 36, 25, -1, 27, -1, 
+  61, 62, -1, 38, 34, -1, 36, 15, 25, 38, 
+  27, 61, 62, 29, 25, -1, 27, -1, -1, -1, 
+  -1, 38, 18, 19, 18, 19, 34, 38, 36, 57, 
+  -1, 57, 18, 19, -1, 63, 57, 63, 18, 19, 
+  -1, -1, 63, -1, -1, 61, 62, -1, -1, 45, 
+  46, 45, 46, -1, -1, 23, 24, -1, -1, 45, 
+  46, 23, 24, -1, 32, 45, 46, 35, -1, 37, 
+  32, 23, 24, 35, -1, 37, 25, -1, 27, -1, 
+  32, -1, -1, 35, -1, 37, 23, 24, -1, 38, 
+  -1, -1, -1, -1, 31, 32, 23, 24, 35, -1, 
+  37, -1, -1, -1, 31, 32, 23, 24, 35, -1, 
+  37, -1, -1, -1, 31, 32, 23, 24, 35, -1, 
+  37, -1, -1, -1, 31, 32, -1, 3, 35, -1, 
+  37, 23, 24, -1, -1, 23, 24, 13, -1, 31, 
+  32, 17, -1, 35, 32, 37, -1, 35, -1, 37, 
+  26, -1, 28, -1, -1, -1, -1, -1, -1, -1, 
+  -1, -1, -1, 39, -1, 41, 42, -1, 12, 13, 
+  -1, -1, -1, 49, -1, -1, 52, 53, 22, -1, 
+  -1, -1, 58, -1, -1, 29, -1, -1, 64, 33, 
+  34, -1, 36, -1, -1, -1, 12, 13, -1, 43, 
+  -1, 77, -1, 47, -1, -1, 22, -1, -1, -1, 
+  -1, -1, -1, 29, -1, -1, -1, 33, 34, -1, 
+  36, 65, -1, 67, -1, -1, -1, 43, -1, -1, 
+  -1, 47, -1, -1, 78, 79, 80, -1, -1, -1, 
+  -1, -1, -1, -1, -1, -1, -1, -1, -1, 65, 
+  -1, 67, -1, -1, -1, -1, -1, -1, -1, -1, 
+  -1, -1, 78, 79, 80, -1, -1, -1, 3, -1, 
+  -1, -1, -1, -1, -1, -1, -1, -1, 13, -1, 
+  -1, -1, 17, -1, -1, -1, -1, -1, -1, -1, 
+  -1, 26, -1, 28, -1, -1, -1, -1, -1, -1, 
+  -1, -1, -1, -1, 39, -1, 41, 42, -1, -1, 
+  -1, -1, -1, -1, 49, -1, -1, 52, 53, -1, 
+  -1, -1, -1, 58, -1, -1, -1, -1, -1, 64, 
+  -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 
+  -1, -1, 77, -1, -1, -1, -1, -1, -1, 3, 
+  -1, -1, -1, -1, -1, -1, -1, -1, -1, 13, 
+  -1, -1, -1, 17, -1, -1, -1, -1, -1, -1, 
+  -1, -1, 26, -1, 28, -1, -1, 31, -1, -1, 
+  -1, -1, -1, -1, -1, 39, -1, 41, 42, -1, 
+  -1, -1, -1, -1, -1, 49, -1, -1, 52, 53, 
+  -1, -1, -1, -1, 58, -1, -1, -1, -1, -1, 
+  64, -1, -1, -1, -1, -1, -1, -1, -1, -1, 
+  -1, -1, -1, 77, -1, -1, -1, -1, -1, -1, 
+  11, 12, 13, -1, -1, -1, -1, -1, -1, -1, 
+  -1, 22, -1, -1, -1, -1, -1, -1, 29, -1, 
+  -1, -1, 33, 34, -1, 36, -1, -1, -1, 40, 
+  -1, 42, 43, 44, -1, -1, 47, -1, -1, -1, 
+  51, -1, 53, -1, -1, -1, -1, -1, -1, -1, 
+  -1, -1, -1, -1, 65, -1, 67, -1, 69, -1, 
+  71, -1, 73, -1, -1, -1, -1, 78, 79, 80, 
+  -1, -1, -1, 11, 12, 13, -1, -1, -1, -1, 
+  -1, -1, -1, -1, 22, -1, -1, -1, -1, -1, 
+  -1, 29, -1, -1, -1, 33, 34, -1, 36, -1, 
+  -1, -1, 40, -1, 42, 43, 44, -1, -1, 47, 
+  -1, -1, -1, 51, -1, 53, -1, -1, -1, -1, 
+  -1, -1, 60, -1, -1, -1, -1, 65, -1, 67, 
+  -1, 69, -1, 71, -1, 73, -1, -1, -1, -1, 
+  78, 79, 80, -1, -1, -1, 11, 12, 13, -1, 
+  -1, -1, -1, -1, -1, -1, -1, 22, -1, -1, 
+  -1, -1, -1, -1, 29, -1, -1, -1, 33, 34, 
+  -1, 36, -1, -1, -1, 40, -1, 42, 43, 44, 
+  -1, -1, 47, -1, -1, -1, 51, -1, 53, -1, 
+  -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 
+  65, -1, 67, -1, 69, -1, 71, 72, 73, -1, 
+  -1, -1, -1, 78, 79, 80, -1, -1, -1, 11, 
+  12, 13, -1, -1, -1, -1, -1, -1, -1, -1, 
+  22, -1, -1, -1, -1, -1, -1, 29, -1, -1, 
+  -1, 33, 34, -1, 36, -1, -1, -1, 40, -1, 
+  42, 43, 44, -1, -1, 47, -1, -1, -1, 51, 
+  -1, 53, -1, -1, 56, -1, -1, -1, -1, -1, 
+  -1, -1, -1, 65, -1, 67, -1, 69, -1, 71, 
+  -1, 73, -1, -1, -1, -1, 78, 79, 80, -1, 
+  -1, -1, 7, -1, -1, -1, 11, 12, 13, -1, 
+  -1, -1, -1, -1, -1, -1, -1, 22, -1, -1, 
+  -1, -1, -1, -1, 29, -1, -1, -1, 33, 34, 
+  -1, 36, -1, -1, -1, 40, -1, 42, 43, 44, 
+  -1, -1, 47, -1, -1, -1, 51, -1, 53, -1, 
+  -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 
+  65, -1, 67, -1, 69, -1, 71, -1, 73, -1, 
+  -1, -1, -1, 78, 79, 80, -1, -1, -1, 11, 
+  12, 13, -1, -1, -1, -1, -1, -1, -1, -1, 
+  22, -1, -1, -1, -1, -1, -1, 29, -1, -1, 
+  -1, 33, 34, -1, 36, -1, -1, -1, 40, -1, 
+  42, 43, 44, -1, -1, 47, -1, -1, -1, 51, 
+  -1, 53, -1, -1, 56, -1, -1, -1, -1, -1, 
+  -1, -1, -1, 65, -1, 67, -1, 69, -1, 71, 
+  -1, 73, -1, -1, -1, -1, 78, 79, 80, -1, 
+  -1, -1, 4, 5, 6, -1, -1, 9, 10, 11, 
+  -1, -1, 14, -1, 16, -1, -1, -1, 20, 21, 
+  22, -1, -1, -1, -1, -1, -1, 29, 30, 31, 
+  32, -1, -1, -1, -1, -1, -1, -1, -1, -1, 
+  -1, 43, -1, -1, -1, -1, -1, -1, -1, -1, 
+  -1, -1, -1, -1, -1, -1, -1, 59, -1, -1, 
+  -1, -1, -1, -1, 66, 67, 68, -1, 70, 71, 
+  72, 73, 74, 75, -1, -1, 78, 79, 80, 81, 
+  82, 83, 4, 5, 6, -1, -1, 9, 10, 11, 
+  -1, -1, 14, -1, 16, -1, -1, -1, 20, 21, 
+  22, -1, -1, -1, -1, -1, -1, 29, 30, 31, 
+  32, -1, -1, -1, -1, -1, -1, -1, -1, -1, 
+  -1, 43, -1, -1, -1, 47, -1, -1, -1, -1, 
+  -1, -1, -1, -1, -1, -1, -1, 59, -1, -1, 
+  -1, -1, -1, 65, 66, 67, 68, -1, 70, 71, 
+  72, 73, 74, 75, -1, -1, 78, 79, 80, 81, 
+  82, 83, 4, 5, 6, -1, -1, 9, 10, 11, 
+  -1, -1, 14, -1, 16, -1, -1, -1, 20, 21, 
+  22, -1, -1, -1, -1, -1, -1, 29, 30, 31, 
+  32, -1, -1, -1, -1, -1, -1, -1, -1, -1, 
+  -1, 43, -1, -1, -1, 47, -1, -1, -1, -1, 
+  -1, -1, -1, 55, -1, -1, -1, 59, -1, -1, 
+  -1, -1, -1, 65, 66, 67, 68, -1, 70, 71, 
+  72, 73, 74, 75, -1, -1, 78, 79, 80, 81, 
+  82, 83, 4, -1, -1, -1, -1, 9, -1, 11, 
+  12, 13, 14, -1, -1, -1, -1, -1, -1, 21, 
+  22, -1, -1, -1, -1, -1, -1, 29, 30, -1, 
+  -1, 33, 34, -1, 36, -1, -1, -1, 40, -1, 
+  42, 43, 44, -1, -1, 47, -1, -1, -1, 51, 
+  -1, 53, -1, -1, -1, -1, -1, 59, -1, 61, 
+  -1, -1, -1, 65, 66, 67, 68, 69, 70, 71, 
+  72, 73, 74, 75, -1, -1, 78, 79, 80, 81, 
+  82, -1, 4, -1, -1, -1, -1, 9, -1, 11, 
+  12, 13, 14, -1, -1, -1, -1, -1, -1, 21, 
+  22, -1, -1, -1, -1, -1, -1, 29, 30, -1, 
+  -1, 33, 34, -1, 36, -1, -1, -1, 40, -1, 
+  42, 43, 44, -1, -1, 47, -1, -1, -1, 51, 
+  -1, 53, -1, -1, -1, -1, -1, 59, -1, 61, 
+  -1, -1, -1, 65, 66, 67, 68, 69, 70, 71, 
+  72, 73, 74, 75, -1, -1, 78, 79, 80, 81, 
+  82, -1, 4, 5, 6, -1, -1, 9, 10, 11, 
+  12, 13, 14, -1, 16, -1, -1, -1, 20, 21, 
+  22, -1, -1, -1, -1, -1, -1, 29, 30, 31, 
+  32, 33, 34, -1, 36, -1, -1, -1, 40, -1, 
+  42, 43, 44, -1, -1, 47, -1, -1, -1, 51, 
+  -1, 53, -1, 55, -1, -1, -1, 59, -1, 61, 
+  -1, -1, -1, 65, 66, 67, 68, 69, 70, 71, 
+  72, 73, 74, 75, -1, -1, 78, 79, 80, 81, 
+  82, 83, 
+
+  14, 46, 6, 46, 14, 6, 45, 45, 6, 65, 
+  7, 2, 7, 41, 7, 46, 6, 6, 45, 6, 
+  73, 76, 86, 45, 78, 46, 45, 7, 6, 81, 
+  67, 7, 45, 7, 6, 85, 80, 6, 86, 7, 
+  45, 7, 9, 45, 6, 45, 45, 7, 7, 45, 
+  6, 45, 10, 45, 6, 18, 7, 45, 6, 22, 
+  -1, 18, -1, 18, 18, 18, 10, 11, 18, 18, 
+  23, 28, 26, 22, 6, 18, 18, 18, 18, 34, 
+  23, 23, 32, 18, 24, 18, 6, 22, 18, 30, 
+  23, 18, 18, 23, 18, 18, 23, 18, 24, 18, 
+  24, 24, 23, 18, 23, 20, 18, 18, 20, 20, 
+  12, 6, 18, 15, 20, 18, -1, 20, 18, 18, 
+  20, 20, 42, 6, 18, 18, 20, 20, 18, 18, 
+  20, 20, 12, 18, 18, 15, 20, 18, 23, 20, 
+  18, 45, 18, 21, 20, 18, -1, 42, 21, 18, 
+  18, 20, -1, 18, 45, 23, 18, 61, 23, 42, 
+  18, 23, -1, -1, 18, 23, -1, 25, 18, 23, 
+  61, 25, 18, 23, -1, 25, 18, 23, 18, 25, 
+  -1, 23, 18, 23, 18, 27, 18, 23, 18, 23, 
+  18, 23, 18, 23, -1, 23, -1, 23, 18, 31, 
+  40, 29, -1, 23, 40, 35, 40, 33, 18, -1, 
+  -1, -1, -1, 23, -1, -1, -1, -1, -1, -1, 
+  40, -1, -1, -1, -1, -1, 6, -1, -1, -1, 
+  40, -1, -1, -1, -1, -1, -1, -1, -1, -1, 
+  -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 
+  -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 
+  -1, -1, 42, -1, -1, -1, -1, -1, -1, -1, 
+  -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 
+  -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 
+  -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 
+  -1, -1, -1, -1, -1, -1, -1, -1};
+
diff --git a/src/plugins/qtscripteditor/parser/javascriptgrammar_p.h b/src/plugins/qtscripteditor/parser/javascriptgrammar_p.h
new file mode 100644
index 0000000000000000000000000000000000000000..2d9e2f92d7d2adea60148b4e426df05ee251ddca
--- /dev/null
+++ b/src/plugins/qtscripteditor/parser/javascriptgrammar_p.h
@@ -0,0 +1,147 @@
+// This file was generated by qlalr - DO NOT EDIT!
+#ifndef JAVASCRIPTGRAMMAR_P_H
+#define JAVASCRIPTGRAMMAR_P_H
+
+class JavaScriptGrammar
+{
+public:
+  enum {
+    EOF_SYMBOL = 0,
+    T_AND = 1,
+    T_AND_AND = 2,
+    T_AND_EQ = 3,
+    T_AUTOMATIC_SEMICOLON = 62,
+    T_BREAK = 4,
+    T_CASE = 5,
+    T_CATCH = 6,
+    T_COLON = 7,
+    T_COMMA = 8,
+    T_CONST = 81,
+    T_CONTINUE = 9,
+    T_DEBUGGER = 82,
+    T_DEFAULT = 10,
+    T_DELETE = 11,
+    T_DIVIDE_ = 12,
+    T_DIVIDE_EQ = 13,
+    T_DO = 14,
+    T_DOT = 15,
+    T_ELSE = 16,
+    T_EQ = 17,
+    T_EQ_EQ = 18,
+    T_EQ_EQ_EQ = 19,
+    T_FALSE = 80,
+    T_FINALLY = 20,
+    T_FOR = 21,
+    T_FUNCTION = 22,
+    T_GE = 23,
+    T_GT = 24,
+    T_GT_GT = 25,
+    T_GT_GT_EQ = 26,
+    T_GT_GT_GT = 27,
+    T_GT_GT_GT_EQ = 28,
+    T_IDENTIFIER = 29,
+    T_IF = 30,
+    T_IN = 31,
+    T_INSTANCEOF = 32,
+    T_LBRACE = 33,
+    T_LBRACKET = 34,
+    T_LE = 35,
+    T_LPAREN = 36,
+    T_LT = 37,
+    T_LT_LT = 38,
+    T_LT_LT_EQ = 39,
+    T_MINUS = 40,
+    T_MINUS_EQ = 41,
+    T_MINUS_MINUS = 42,
+    T_NEW = 43,
+    T_NOT = 44,
+    T_NOT_EQ = 45,
+    T_NOT_EQ_EQ = 46,
+    T_NULL = 78,
+    T_NUMERIC_LITERAL = 47,
+    T_OR = 48,
+    T_OR_EQ = 49,
+    T_OR_OR = 50,
+    T_PLUS = 51,
+    T_PLUS_EQ = 52,
+    T_PLUS_PLUS = 53,
+    T_QUESTION = 54,
+    T_RBRACE = 55,
+    T_RBRACKET = 56,
+    T_REMAINDER = 57,
+    T_REMAINDER_EQ = 58,
+    T_RESERVED_WORD = 83,
+    T_RETURN = 59,
+    T_RPAREN = 60,
+    T_SEMICOLON = 61,
+    T_STAR = 63,
+    T_STAR_EQ = 64,
+    T_STRING_LITERAL = 65,
+    T_SWITCH = 66,
+    T_THIS = 67,
+    T_THROW = 68,
+    T_TILDE = 69,
+    T_TRUE = 79,
+    T_TRY = 70,
+    T_TYPEOF = 71,
+    T_VAR = 72,
+    T_VOID = 73,
+    T_WHILE = 74,
+    T_WITH = 75,
+    T_XOR = 76,
+    T_XOR_EQ = 77,
+
+    ACCEPT_STATE = 237,
+    RULE_COUNT = 269,
+    STATE_COUNT = 468,
+    TERMINAL_COUNT = 84,
+    NON_TERMINAL_COUNT = 88,
+
+    GOTO_INDEX_OFFSET = 468,
+    GOTO_INFO_OFFSET = 1562,
+    GOTO_CHECK_OFFSET = 1562
+  };
+
+  static const char  *const spell [];
+  static const int            lhs [];
+  static const int            rhs [];
+
+#ifndef QLALR_NO_JAVASCRIPTGRAMMAR_DEBUG_INFO
+  static const int     rule_index [];
+  static const int      rule_info [];
+#endif // QLALR_NO_JAVASCRIPTGRAMMAR_DEBUG_INFO
+
+  static const int   goto_default [];
+  static const int action_default [];
+  static const int   action_index [];
+  static const int    action_info [];
+  static const int   action_check [];
+
+  static inline int nt_action (int state, int nt)
+  {
+    const int *const goto_index = &action_index [GOTO_INDEX_OFFSET];
+    const int *const goto_check = &action_check [GOTO_CHECK_OFFSET];
+
+    const int yyn = goto_index [state] + nt;
+
+    if (yyn < 0 || goto_check [yyn] != nt)
+      return goto_default [nt];
+
+    const int *const goto_info = &action_info [GOTO_INFO_OFFSET];
+    return goto_info [yyn];
+  }
+
+  static inline int t_action (int state, int token)
+  {
+    const int yyn = action_index [state] + token;
+
+    if (yyn < 0 || action_check [yyn] != token)
+      return - action_default [state];
+
+    return action_info [yyn];
+  }
+};
+
+
+#endif // JAVASCRIPTGRAMMAR_P_H
+
diff --git a/src/plugins/qtscripteditor/parser/javascriptlexer.cpp b/src/plugins/qtscripteditor/parser/javascriptlexer.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..eac7f58ad4cbda27f7172e57b020b970c4aabc65
--- /dev/null
+++ b/src/plugins/qtscripteditor/parser/javascriptlexer.cpp
@@ -0,0 +1,1122 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the QtScript module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain
+** additional rights. These rights are described in the Nokia Qt LGPL
+** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "javascriptengine_p.h"
+
+
+
+
+
+
+
+#include "javascriptlexer_p.h"
+#include "javascriptgrammar_p.h"
+
+#include <ctype.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+QT_BEGIN_NAMESPACE
+
+extern double qstrtod(const char *s00, char const **se, bool *ok);
+
+#define shiftWindowsLineBreak() \
+    do { \
+        if (((current == '\r') && (next1 == '\n')) \
+            || ((current == '\n') && (next1 == '\r'))) { \
+            shift(1); \
+        } \
+    } \
+    while (0)
+
+namespace JavaScript {
+extern qjsreal integerFromString(const char *buf, int size, int radix);
+}
+
+JavaScript::Lexer::Lexer(JavaScriptEnginePrivate *eng)
+    : driver(eng),
+      yylineno(0),
+      done(false),
+      size8(128), size16(128),
+      pos8(0), pos16(0),
+      terminator(false),
+      restrKeyword(false),
+      delimited(false),
+      stackToken(-1),
+      state(Start),
+      pos(0),
+      code(0), length(0),
+      yycolumn(0),
+      startlineno(0), startcolumn(0),
+      bol(true),
+      current(0), next1(0), next2(0), next3(0),
+      err(NoError),
+      wantRx(false),
+      check_reserved(true),
+      parenthesesState(IgnoreParentheses),
+      parenthesesCount(0),
+      prohibitAutomaticSemicolon(false)
+{
+    // allocate space for read buffers
+    buffer8 = new char[size8];
+    buffer16 = new QChar[size16];
+    pattern = 0;
+    flags = 0;
+
+}
+
+JavaScript::Lexer::~Lexer()
+{
+    delete [] buffer8;
+    delete [] buffer16;
+}
+
+void JavaScript::Lexer::setCode(const QString &c, int lineno)
+{
+    errmsg = QString();
+    yylineno = lineno;
+    yycolumn = 1;
+    restrKeyword = false;
+    delimited = false;
+    stackToken = -1;
+    pos = 0;
+    code = c.unicode();
+    length = c.length();
+    bol = true;
+
+    // read first characters
+    current = (length > 0) ? code[0].unicode() : 0;
+    next1 = (length > 1) ? code[1].unicode() : 0;
+    next2 = (length > 2) ? code[2].unicode() : 0;
+    next3 = (length > 3) ? code[3].unicode() : 0;
+}
+
+void JavaScript::Lexer::shift(uint p)
+{
+    while (p--) {
+        ++pos;
+        ++yycolumn;
+        current = next1;
+        next1 = next2;
+        next2 = next3;
+        next3 = (pos + 3 < length) ? code[pos+3].unicode() : 0;
+    }
+}
+
+void JavaScript::Lexer::setDone(State s)
+{
+    state = s;
+    done = true;
+}
+
+int JavaScript::Lexer::findReservedWord(const QChar *c, int size) const
+{
+    switch (size) {
+    case 2: {
+        if (c[0] == QLatin1Char('d') && c[1] == QLatin1Char('o'))
+            return JavaScriptGrammar::T_DO;
+        else if (c[0] == QLatin1Char('i') && c[1] == QLatin1Char('f'))
+            return JavaScriptGrammar::T_IF;
+        else if (c[0] == QLatin1Char('i') && c[1] == QLatin1Char('n'))
+            return JavaScriptGrammar::T_IN;
+    }   break;
+
+    case 3: {
+        if (c[0] == QLatin1Char('f') && c[1] == QLatin1Char('o') && c[2] == QLatin1Char('r'))
+            return JavaScriptGrammar::T_FOR;
+        else if (c[0] == QLatin1Char('n') && c[1] == QLatin1Char('e') && c[2] == QLatin1Char('w'))
+            return JavaScriptGrammar::T_NEW;
+        else if (c[0] == QLatin1Char('t') && c[1] == QLatin1Char('r') && c[2] == QLatin1Char('y'))
+            return JavaScriptGrammar::T_TRY;
+        else if (c[0] == QLatin1Char('v') && c[1] == QLatin1Char('a') && c[2] == QLatin1Char('r'))
+            return JavaScriptGrammar::T_VAR;
+        else if (check_reserved) {
+            if (c[0] == QLatin1Char('i') && c[1] == QLatin1Char('n') && c[2] == QLatin1Char('t'))
+                return JavaScriptGrammar::T_RESERVED_WORD;
+        }
+    }   break;
+
+    case 4: {
+        if (c[0] == QLatin1Char('c') && c[1] == QLatin1Char('a')
+                && c[2] == QLatin1Char('s') && c[3] == QLatin1Char('e'))
+            return JavaScriptGrammar::T_CASE;
+        else if (c[0] == QLatin1Char('e') && c[1] == QLatin1Char('l')
+                && c[2] == QLatin1Char('s') && c[3] == QLatin1Char('e'))
+            return JavaScriptGrammar::T_ELSE;
+        else if (c[0] == QLatin1Char('t') && c[1] == QLatin1Char('h')
+                && c[2] == QLatin1Char('i') && c[3] == QLatin1Char('s'))
+            return JavaScriptGrammar::T_THIS;
+        else if (c[0] == QLatin1Char('v') && c[1] == QLatin1Char('o')
+                && c[2] == QLatin1Char('i') && c[3] == QLatin1Char('d'))
+            return JavaScriptGrammar::T_VOID;
+        else if (c[0] == QLatin1Char('w') && c[1] == QLatin1Char('i')
+                && c[2] == QLatin1Char('t') && c[3] == QLatin1Char('h'))
+            return JavaScriptGrammar::T_WITH;
+        else if (c[0] == QLatin1Char('t') && c[1] == QLatin1Char('r')
+                && c[2] == QLatin1Char('u') && c[3] == QLatin1Char('e'))
+            return JavaScriptGrammar::T_TRUE;
+        else if (c[0] == QLatin1Char('n') && c[1] == QLatin1Char('u')
+                && c[2] == QLatin1Char('l') && c[3] == QLatin1Char('l'))
+            return JavaScriptGrammar::T_NULL;
+        else if (check_reserved) {
+            if (c[0] == QLatin1Char('e') && c[1] == QLatin1Char('n')
+                    && c[2] == QLatin1Char('u') && c[3] == QLatin1Char('m'))
+                return JavaScriptGrammar::T_RESERVED_WORD;
+            else if (c[0] == QLatin1Char('b') && c[1] == QLatin1Char('y')
+                    && c[2] == QLatin1Char('t') && c[3] == QLatin1Char('e'))
+                return JavaScriptGrammar::T_RESERVED_WORD;
+            else if (c[0] == QLatin1Char('l') && c[1] == QLatin1Char('o')
+                    && c[2] == QLatin1Char('n') && c[3] == QLatin1Char('g'))
+                return JavaScriptGrammar::T_RESERVED_WORD;
+            else if (c[0] == QLatin1Char('c') && c[1] == QLatin1Char('h')
+                    && c[2] == QLatin1Char('a') && c[3] == QLatin1Char('r'))
+                return JavaScriptGrammar::T_RESERVED_WORD;
+            else if (c[0] == QLatin1Char('g') && c[1] == QLatin1Char('o')
+                    && c[2] == QLatin1Char('t') && c[3] == QLatin1Char('o'))
+                return JavaScriptGrammar::T_RESERVED_WORD;
+        }
+    }   break;
+
+    case 5: {
+        if (c[0] == QLatin1Char('b') && c[1] == QLatin1Char('r')
+                && c[2] == QLatin1Char('e') && c[3] == QLatin1Char('a')
+                && c[4] == QLatin1Char('k'))
+            return JavaScriptGrammar::T_BREAK;
+        else if (c[0] == QLatin1Char('c') && c[1] == QLatin1Char('a')
+                && c[2] == QLatin1Char('t') && c[3] == QLatin1Char('c')
+                && c[4] == QLatin1Char('h'))
+            return JavaScriptGrammar::T_CATCH;
+        else if (c[0] == QLatin1Char('t') && c[1] == QLatin1Char('h')
+                && c[2] == QLatin1Char('r') && c[3] == QLatin1Char('o')
+                && c[4] == QLatin1Char('w'))
+            return JavaScriptGrammar::T_THROW;
+        else if (c[0] == QLatin1Char('w') && c[1] == QLatin1Char('h')
+                && c[2] == QLatin1Char('i') && c[3] == QLatin1Char('l')
+                && c[4] == QLatin1Char('e'))
+            return JavaScriptGrammar::T_WHILE;
+        else if (c[0] == QLatin1Char('c') && c[1] == QLatin1Char('o')
+                && c[2] == QLatin1Char('n') && c[3] == QLatin1Char('s')
+                && c[4] == QLatin1Char('t'))
+            return JavaScriptGrammar::T_CONST;
+        else if (c[0] == QLatin1Char('f') && c[1] == QLatin1Char('a')
+                && c[2] == QLatin1Char('l') && c[3] == QLatin1Char('s')
+                && c[4] == QLatin1Char('e'))
+            return JavaScriptGrammar::T_FALSE;
+        else if (check_reserved) {
+            if (c[0] == QLatin1Char('s') && c[1] == QLatin1Char('h')
+                    && c[2] == QLatin1Char('o') && c[3] == QLatin1Char('r')
+                    && c[4] == QLatin1Char('t'))
+                return JavaScriptGrammar::T_RESERVED_WORD;
+            else if (c[0] == QLatin1Char('s') && c[1] == QLatin1Char('u')
+                    && c[2] == QLatin1Char('p') && c[3] == QLatin1Char('e')
+                    && c[4] == QLatin1Char('r'))
+                return JavaScriptGrammar::T_RESERVED_WORD;
+            else if (c[0] == QLatin1Char('f') && c[1] == QLatin1Char('i')
+                    && c[2] == QLatin1Char('n') && c[3] == QLatin1Char('a')
+                    && c[4] == QLatin1Char('l'))
+                return JavaScriptGrammar::T_RESERVED_WORD;
+            else if (c[0] == QLatin1Char('c') && c[1] == QLatin1Char('l')
+                    && c[2] == QLatin1Char('a') && c[3] == QLatin1Char('s')
+                    && c[4] == QLatin1Char('s'))
+                return JavaScriptGrammar::T_RESERVED_WORD;
+            else if (c[0] == QLatin1Char('f') && c[1] == QLatin1Char('l')
+                    && c[2] == QLatin1Char('o') && c[3] == QLatin1Char('a')
+                    && c[4] == QLatin1Char('t'))
+                return JavaScriptGrammar::T_RESERVED_WORD;
+        }
+    }   break;
+
+    case 6: {
+        if (c[0] == QLatin1Char('d') && c[1] == QLatin1Char('e')
+                && c[2] == QLatin1Char('l') && c[3] == QLatin1Char('e')
+                && c[4] == QLatin1Char('t') && c[5] == QLatin1Char('e'))
+            return JavaScriptGrammar::T_DELETE;
+        else if (c[0] == QLatin1Char('r') && c[1] == QLatin1Char('e')
+                && c[2] == QLatin1Char('t') && c[3] == QLatin1Char('u')
+                && c[4] == QLatin1Char('r') && c[5] == QLatin1Char('n'))
+            return JavaScriptGrammar::T_RETURN;
+        else if (c[0] == QLatin1Char('s') && c[1] == QLatin1Char('w')
+                && c[2] == QLatin1Char('i') && c[3] == QLatin1Char('t')
+                && c[4] == QLatin1Char('c') && c[5] == QLatin1Char('h'))
+            return JavaScriptGrammar::T_SWITCH;
+        else if (c[0] == QLatin1Char('t') && c[1] == QLatin1Char('y')
+                && c[2] == QLatin1Char('p') && c[3] == QLatin1Char('e')
+                && c[4] == QLatin1Char('o') && c[5] == QLatin1Char('f'))
+            return JavaScriptGrammar::T_TYPEOF;
+        else if (check_reserved) {
+            if (c[0] == QLatin1Char('e') && c[1] == QLatin1Char('x')
+                    && c[2] == QLatin1Char('p') && c[3] == QLatin1Char('o')
+                    && c[4] == QLatin1Char('r') && c[5] == QLatin1Char('t'))
+                return JavaScriptGrammar::T_RESERVED_WORD;
+            else if (c[0] == QLatin1Char('s') && c[1] == QLatin1Char('t')
+                    && c[2] == QLatin1Char('a') && c[3] == QLatin1Char('t')
+                    && c[4] == QLatin1Char('i') && c[5] == QLatin1Char('c'))
+                return JavaScriptGrammar::T_RESERVED_WORD;
+            else if (c[0] == QLatin1Char('d') && c[1] == QLatin1Char('o')
+                    && c[2] == QLatin1Char('u') && c[3] == QLatin1Char('b')
+                    && c[4] == QLatin1Char('l') && c[5] == QLatin1Char('e'))
+                return JavaScriptGrammar::T_RESERVED_WORD;
+            else if (c[0] == QLatin1Char('i') && c[1] == QLatin1Char('m')
+                    && c[2] == QLatin1Char('p') && c[3] == QLatin1Char('o')
+                    && c[4] == QLatin1Char('r') && c[5] == QLatin1Char('t'))
+                return JavaScriptGrammar::T_RESERVED_WORD;
+            else if (c[0] == QLatin1Char('p') && c[1] == QLatin1Char('u')
+                    && c[2] == QLatin1Char('b') && c[3] == QLatin1Char('l')
+                    && c[4] == QLatin1Char('i') && c[5] == QLatin1Char('c'))
+                return JavaScriptGrammar::T_RESERVED_WORD;
+            else if (c[0] == QLatin1Char('n') && c[1] == QLatin1Char('a')
+                    && c[2] == QLatin1Char('t') && c[3] == QLatin1Char('i')
+                    && c[4] == QLatin1Char('v') && c[5] == QLatin1Char('e'))
+                return JavaScriptGrammar::T_RESERVED_WORD;
+            else if (c[0] == QLatin1Char('t') && c[1] == QLatin1Char('h')
+                    && c[2] == QLatin1Char('r') && c[3] == QLatin1Char('o')
+                    && c[4] == QLatin1Char('w') && c[5] == QLatin1Char('s'))
+                return JavaScriptGrammar::T_RESERVED_WORD;
+        }
+    }   break;
+
+    case 7: {
+        if (c[0] == QLatin1Char('d') && c[1] == QLatin1Char('e')
+                && c[2] == QLatin1Char('f') && c[3] == QLatin1Char('a')
+                && c[4] == QLatin1Char('u') && c[5] == QLatin1Char('l')
+                && c[6] == QLatin1Char('t'))
+            return JavaScriptGrammar::T_DEFAULT;
+        else if (c[0] == QLatin1Char('f') && c[1] == QLatin1Char('i')
+                && c[2] == QLatin1Char('n') && c[3] == QLatin1Char('a')
+                && c[4] == QLatin1Char('l') && c[5] == QLatin1Char('l')
+                && c[6] == QLatin1Char('y'))
+            return JavaScriptGrammar::T_FINALLY;
+        else if (check_reserved) {
+            if (c[0] == QLatin1Char('b') && c[1] == QLatin1Char('o')
+                    && c[2] == QLatin1Char('o') && c[3] == QLatin1Char('l')
+                    && c[4] == QLatin1Char('e') && c[5] == QLatin1Char('a')
+                    && c[6] == QLatin1Char('n'))
+                return JavaScriptGrammar::T_RESERVED_WORD;
+            else if (c[0] == QLatin1Char('e') && c[1] == QLatin1Char('x')
+                    && c[2] == QLatin1Char('t') && c[3] == QLatin1Char('e')
+                    && c[4] == QLatin1Char('n') && c[5] == QLatin1Char('d')
+                    && c[6] == QLatin1Char('s'))
+                return JavaScriptGrammar::T_RESERVED_WORD;
+            else if (c[0] == QLatin1Char('p') && c[1] == QLatin1Char('a')
+                    && c[2] == QLatin1Char('c') && c[3] == QLatin1Char('k')
+                    && c[4] == QLatin1Char('a') && c[5] == QLatin1Char('g')
+                    && c[6] == QLatin1Char('e'))
+                return JavaScriptGrammar::T_RESERVED_WORD;
+            else if (c[0] == QLatin1Char('p') && c[1] == QLatin1Char('r')
+                    && c[2] == QLatin1Char('i') && c[3] == QLatin1Char('v')
+                    && c[4] == QLatin1Char('a') && c[5] == QLatin1Char('t')
+                    && c[6] == QLatin1Char('e'))
+                return JavaScriptGrammar::T_RESERVED_WORD;
+        }
+    }   break;
+
+    case 8: {
+        if (c[0] == QLatin1Char('c') && c[1] == QLatin1Char('o')
+                && c[2] == QLatin1Char('n') && c[3] == QLatin1Char('t')
+                && c[4] == QLatin1Char('i') && c[5] == QLatin1Char('n')
+                && c[6] == QLatin1Char('u') && c[7] == QLatin1Char('e'))
+            return JavaScriptGrammar::T_CONTINUE;
+        else if (c[0] == QLatin1Char('f') && c[1] == QLatin1Char('u')
+                && c[2] == QLatin1Char('n') && c[3] == QLatin1Char('c')
+                && c[4] == QLatin1Char('t') && c[5] == QLatin1Char('i')
+                && c[6] == QLatin1Char('o') && c[7] == QLatin1Char('n'))
+            return JavaScriptGrammar::T_FUNCTION;
+        else if (c[0] == QLatin1Char('d') && c[1] == QLatin1Char('e')
+                && c[2] == QLatin1Char('b') && c[3] == QLatin1Char('u')
+                && c[4] == QLatin1Char('g') && c[5] == QLatin1Char('g')
+                && c[6] == QLatin1Char('e') && c[7] == QLatin1Char('r'))
+            return JavaScriptGrammar::T_DEBUGGER;
+        else if (check_reserved) {
+            if (c[0] == QLatin1Char('a') && c[1] == QLatin1Char('b')
+                    && c[2] == QLatin1Char('s') && c[3] == QLatin1Char('t')
+                    && c[4] == QLatin1Char('r') && c[5] == QLatin1Char('a')
+                    && c[6] == QLatin1Char('c') && c[7] == QLatin1Char('t'))
+                return JavaScriptGrammar::T_RESERVED_WORD;
+            else if (c[0] == QLatin1Char('v') && c[1] == QLatin1Char('o')
+                    && c[2] == QLatin1Char('l') && c[3] == QLatin1Char('a')
+                    && c[4] == QLatin1Char('t') && c[5] == QLatin1Char('i')
+                    && c[6] == QLatin1Char('l') && c[7] == QLatin1Char('e'))
+                return JavaScriptGrammar::T_RESERVED_WORD;
+        }
+    }   break;
+
+    case 9: {
+        if (check_reserved) {
+            if (c[0] == QLatin1Char('i') && c[1] == QLatin1Char('n')
+                    && c[2] == QLatin1Char('t') && c[3] == QLatin1Char('e')
+                    && c[4] == QLatin1Char('r') && c[5] == QLatin1Char('f')
+                    && c[6] == QLatin1Char('a') && c[7] == QLatin1Char('c')
+                    && c[8] == QLatin1Char('e'))
+                return JavaScriptGrammar::T_RESERVED_WORD;
+            else if (c[0] == QLatin1Char('t') && c[1] == QLatin1Char('r')
+                    && c[2] == QLatin1Char('a') && c[3] == QLatin1Char('n')
+                    && c[4] == QLatin1Char('s') && c[5] == QLatin1Char('i')
+                    && c[6] == QLatin1Char('e') && c[7] == QLatin1Char('n')
+                    && c[8] == QLatin1Char('t'))
+                return JavaScriptGrammar::T_RESERVED_WORD;
+            else if (c[0] == QLatin1Char('p') && c[1] == QLatin1Char('r')
+                    && c[2] == QLatin1Char('o') && c[3] == QLatin1Char('t')
+                    && c[4] == QLatin1Char('e') && c[5] == QLatin1Char('c')
+                    && c[6] == QLatin1Char('t') && c[7] == QLatin1Char('e')
+                    && c[8] == QLatin1Char('d'))
+                return JavaScriptGrammar::T_RESERVED_WORD;
+        }
+    }   break;
+
+    case 10: {
+        if (c[0] == QLatin1Char('i') && c[1] == QLatin1Char('n')
+                && c[2] == QLatin1Char('s') && c[3] == QLatin1Char('t')
+                && c[4] == QLatin1Char('a') && c[5] == QLatin1Char('n')
+                && c[6] == QLatin1Char('c') && c[7] == QLatin1Char('e')
+                && c[8] == QLatin1Char('o') && c[9] == QLatin1Char('f'))
+            return JavaScriptGrammar::T_INSTANCEOF;
+        else if (check_reserved) {
+            if (c[0] == QLatin1Char('i') && c[1] == QLatin1Char('m')
+                    && c[2] == QLatin1Char('p') && c[3] == QLatin1Char('l')
+                    && c[4] == QLatin1Char('e') && c[5] == QLatin1Char('m')
+                    && c[6] == QLatin1Char('e') && c[7] == QLatin1Char('n')
+                    && c[8] == QLatin1Char('t') && c[9] == QLatin1Char('s'))
+                return JavaScriptGrammar::T_RESERVED_WORD;
+        }
+    }   break;
+
+    case 12: {
+        if (check_reserved) {
+            if (c[0] == QLatin1Char('s') && c[1] == QLatin1Char('y')
+                    && c[2] == QLatin1Char('n') && c[3] == QLatin1Char('c')
+                    && c[4] == QLatin1Char('h') && c[5] == QLatin1Char('r')
+                    && c[6] == QLatin1Char('o') && c[7] == QLatin1Char('n')
+                    && c[8] == QLatin1Char('i') && c[9] == QLatin1Char('z')
+                    && c[10] == QLatin1Char('e') && c[11] == QLatin1Char('d'))
+                return JavaScriptGrammar::T_RESERVED_WORD;
+        }
+    }   break;
+
+    } // switch
+
+    return -1;
+}
+
+int JavaScript::Lexer::lex()
+{
+    int token = 0;
+    state = Start;
+    ushort stringType = 0; // either single or double quotes
+    pos8 = pos16 = 0;
+    done = false;
+    terminator = false;
+
+    // did we push a token on the stack previously ?
+    // (after an automatic semicolon insertion)
+    if (stackToken >= 0) {
+        setDone(Other);
+        token = stackToken;
+        stackToken = -1;
+    }
+
+    while (!done) {
+        switch (state) {
+        case Start:
+            if (isWhiteSpace()) {
+                // do nothing
+            } else if (current == '/' && next1 == '/') {
+                recordStartPos();
+                shift(1);
+                state = InSingleLineComment;
+            } else if (current == '/' && next1 == '*') {
+                recordStartPos();
+                shift(1);
+                state = InMultiLineComment;
+            } else if (current == 0) {
+                syncProhibitAutomaticSemicolon();
+                if (!terminator && !delimited && !prohibitAutomaticSemicolon) {
+                    // automatic semicolon insertion if program incomplete
+                    token = JavaScriptGrammar::T_SEMICOLON;
+                    stackToken = 0;
+                    setDone(Other);
+                } else {
+                    setDone(Eof);
+                }
+            } else if (isLineTerminator()) {
+                shiftWindowsLineBreak();
+                yylineno++;
+                yycolumn = 0;
+                bol = true;
+                terminator = true;
+                syncProhibitAutomaticSemicolon();
+                if (restrKeyword) {
+                    token = JavaScriptGrammar::T_SEMICOLON;
+                    setDone(Other);
+                }
+            } else if (current == '"' || current == '\'') {
+                recordStartPos();
+                state = InString;
+                stringType = current;
+            } else if (isIdentLetter(current)) {
+                recordStartPos();
+                record16(current);
+                state = InIdentifier;
+            } else if (current == '0') {
+                recordStartPos();
+                record8(current);
+                state = InNum0;
+            } else if (isDecimalDigit(current)) {
+                recordStartPos();
+                record8(current);
+                state = InNum;
+            } else if (current == '.' && isDecimalDigit(next1)) {
+                recordStartPos();
+                record8(current);
+                state = InDecimal;
+            } else {
+                recordStartPos();
+                token = matchPunctuator(current, next1, next2, next3);
+                if (token != -1) {
+                    if (terminator && !delimited && !prohibitAutomaticSemicolon
+                        && (token == JavaScriptGrammar::T_PLUS_PLUS
+                            || token == JavaScriptGrammar::T_MINUS_MINUS)) {
+                        // automatic semicolon insertion
+                        stackToken = token;
+                        token = JavaScriptGrammar::T_SEMICOLON;
+                    }
+                    setDone(Other);
+                }
+                else {
+                    setDone(Bad);
+                    err = IllegalCharacter;
+                    errmsg = QLatin1String("Illegal character");
+                }
+            }
+            break;
+        case InString:
+            if (current == stringType) {
+                shift(1);
+                setDone(String);
+            } else if (current == 0 || isLineTerminator()) {
+                setDone(Bad);
+                err = UnclosedStringLiteral;
+                errmsg = QLatin1String("Unclosed string at end of line");
+            } else if (current == '\\') {
+                state = InEscapeSequence;
+            } else {
+                record16(current);
+            }
+            break;
+            // Escape Sequences inside of strings
+        case InEscapeSequence:
+            if (isOctalDigit(current)) {
+                if (current >= '0' && current <= '3' &&
+                     isOctalDigit(next1) && isOctalDigit(next2)) {
+                    record16(convertOctal(current, next1, next2));
+                    shift(2);
+                    state = InString;
+                } else if (isOctalDigit(current) &&
+                            isOctalDigit(next1)) {
+                    record16(convertOctal('0', current, next1));
+                    shift(1);
+                    state = InString;
+                } else if (isOctalDigit(current)) {
+                    record16(convertOctal('0', '0', current));
+                    state = InString;
+                } else {
+                    setDone(Bad);
+                    err = IllegalEscapeSequence;
+                    errmsg = QLatin1String("Illegal escape squence");
+                }
+            } else if (current == 'x')
+                state = InHexEscape;
+            else if (current == 'u')
+                state = InUnicodeEscape;
+            else {
+                if (isLineTerminator()) {
+                    shiftWindowsLineBreak();
+                    yylineno++;
+                    yycolumn = 0;
+                    bol = true;
+                } else {
+                    record16(singleEscape(current));
+                }
+                state = InString;
+            }
+            break;
+        case InHexEscape:
+            if (isHexDigit(current) && isHexDigit(next1)) {
+                state = InString;
+                record16(QLatin1Char(convertHex(current, next1)));
+                shift(1);
+            } else if (current == stringType) {
+                record16(QLatin1Char('x'));
+                shift(1);
+                setDone(String);
+            } else {
+                record16(QLatin1Char('x'));
+                record16(current);
+                state = InString;
+            }
+            break;
+        case InUnicodeEscape:
+            if (isHexDigit(current) && isHexDigit(next1) &&
+                 isHexDigit(next2) && isHexDigit(next3)) {
+                record16(convertUnicode(current, next1, next2, next3));
+                shift(3);
+                state = InString;
+            } else if (current == stringType) {
+                record16(QLatin1Char('u'));
+                shift(1);
+                setDone(String);
+            } else {
+                setDone(Bad);
+                err = IllegalUnicodeEscapeSequence;
+                errmsg = QLatin1String("Illegal unicode escape sequence");
+            }
+            break;
+        case InSingleLineComment:
+            if (isLineTerminator()) {
+                shiftWindowsLineBreak();
+                yylineno++;
+                yycolumn = 0;
+                terminator = true;
+                bol = true;
+                if (restrKeyword) {
+                    token = JavaScriptGrammar::T_SEMICOLON;
+                    setDone(Other);
+                } else
+                    state = Start;
+            } else if (current == 0) {
+                setDone(Eof);
+            }
+            break;
+        case InMultiLineComment:
+            if (current == 0) {
+                setDone(Bad);
+                err = UnclosedComment;
+                errmsg = QLatin1String("Unclosed comment at end of file");
+            } else if (isLineTerminator()) {
+                shiftWindowsLineBreak();
+                yylineno++;
+            } else if (current == '*' && next1 == '/') {
+                state = Start;
+                shift(1);
+            }
+            break;
+        case InIdentifier:
+            if (isIdentLetter(current) || isDecimalDigit(current)) {
+                record16(current);
+                break;
+            }
+            setDone(Identifier);
+            break;
+        case InNum0:
+            if (current == 'x' || current == 'X') {
+                record8(current);
+                state = InHex;
+            } else if (current == '.') {
+                record8(current);
+                state = InDecimal;
+            } else if (current == 'e' || current == 'E') {
+                record8(current);
+                state = InExponentIndicator;
+            } else if (isOctalDigit(current)) {
+                record8(current);
+                state = InOctal;
+            } else if (isDecimalDigit(current)) {
+                record8(current);
+                state = InDecimal;
+            } else {
+                setDone(Number);
+            }
+            break;
+        case InHex:
+            if (isHexDigit(current))
+                record8(current);
+            else
+                setDone(Hex);
+            break;
+        case InOctal:
+            if (isOctalDigit(current)) {
+                record8(current);
+            } else if (isDecimalDigit(current)) {
+                record8(current);
+                state = InDecimal;
+            } else {
+                setDone(Octal);
+            }
+            break;
+        case InNum:
+            if (isDecimalDigit(current)) {
+                record8(current);
+            } else if (current == '.') {
+                record8(current);
+                state = InDecimal;
+            } else if (current == 'e' || current == 'E') {
+                record8(current);
+                state = InExponentIndicator;
+            } else {
+                setDone(Number);
+            }
+            break;
+        case InDecimal:
+            if (isDecimalDigit(current)) {
+                record8(current);
+            } else if (current == 'e' || current == 'E') {
+                record8(current);
+                state = InExponentIndicator;
+            } else {
+                setDone(Number);
+            }
+            break;
+        case InExponentIndicator:
+            if (current == '+' || current == '-') {
+                record8(current);
+            } else if (isDecimalDigit(current)) {
+                record8(current);
+                state = InExponent;
+            } else {
+                setDone(Bad);
+                err = IllegalExponentIndicator;
+                errmsg = QLatin1String("Illegal syntax for exponential number");
+            }
+            break;
+        case InExponent:
+            if (isDecimalDigit(current)) {
+                record8(current);
+            } else {
+                setDone(Number);
+            }
+            break;
+        default:
+            Q_ASSERT_X(0, "Lexer::lex", "Unhandled state in switch statement");
+        }
+
+        // move on to the next character
+        if (!done)
+            shift(1);
+        if (state != Start && state != InSingleLineComment)
+            bol = false;
+    }
+
+    // no identifiers allowed directly after numeric literal, e.g. "3in" is bad
+    if ((state == Number || state == Octal || state == Hex)
+         && isIdentLetter(current)) {
+        state = Bad;
+        err = IllegalIdentifier;
+        errmsg = QLatin1String("Identifier cannot start with numeric literal");
+    }
+
+    // terminate string
+    buffer8[pos8] = '\0';
+
+    double dval = 0;
+    if (state == Number) {
+        dval = qstrtod(buffer8, 0, 0);
+    } else if (state == Hex) { // scan hex numbers
+        dval = JavaScript::integerFromString(buffer8, pos8, 16);
+        state = Number;
+    } else if (state == Octal) {   // scan octal number
+        dval = JavaScript::integerFromString(buffer8, pos8, 8);
+        state = Number;
+    }
+
+    restrKeyword = false;
+    delimited = false;
+
+    switch (parenthesesState) {
+    case IgnoreParentheses:
+        break;
+    case CountParentheses:
+        if (token == JavaScriptGrammar::T_RPAREN) {
+            --parenthesesCount;
+            if (parenthesesCount == 0)
+                parenthesesState = BalancedParentheses;
+        } else if (token == JavaScriptGrammar::T_LPAREN) {
+            ++parenthesesCount;
+        }
+        break;
+    case BalancedParentheses:
+        parenthesesState = IgnoreParentheses;
+        break;
+    }
+
+    switch (state) {
+    case Eof:
+        return 0;
+    case Other:
+        if(token == JavaScriptGrammar::T_RBRACE || token == JavaScriptGrammar::T_SEMICOLON)
+            delimited = true;
+        return token;
+    case Identifier:
+        if ((token = findReservedWord(buffer16, pos16)) < 0) {
+            /* TODO: close leak on parse error. same holds true for String */
+            if (driver)
+                qsyylval.ustr = driver->intern(buffer16, pos16);
+            else
+                qsyylval.ustr = 0;
+            return JavaScriptGrammar::T_IDENTIFIER;
+        }
+        if (token == JavaScriptGrammar::T_CONTINUE || token == JavaScriptGrammar::T_BREAK
+            || token == JavaScriptGrammar::T_RETURN || token == JavaScriptGrammar::T_THROW) {
+            restrKeyword = true;
+        } else if (token == JavaScriptGrammar::T_IF || token == JavaScriptGrammar::T_FOR
+                   || token == JavaScriptGrammar::T_WHILE || token == JavaScriptGrammar::T_WITH) {
+            parenthesesState = CountParentheses;
+            parenthesesCount = 0;
+        } else if (token == JavaScriptGrammar::T_DO) {
+            parenthesesState = BalancedParentheses;
+        }
+        return token;
+    case String:
+        if (driver)
+            qsyylval.ustr = driver->intern(buffer16, pos16);
+        else
+            qsyylval.ustr = 0;
+        return JavaScriptGrammar::T_STRING_LITERAL;
+    case Number:
+        qsyylval.dval = dval;
+        return JavaScriptGrammar::T_NUMERIC_LITERAL;
+    case Bad:
+        return -1;
+    default:
+        Q_ASSERT(!"unhandled numeration value in switch");
+        return -1;
+    }
+}
+
+bool JavaScript::Lexer::isWhiteSpace() const
+{
+    return (current == ' ' || current == '\t' ||
+             current == 0x0b || current == 0x0c);
+}
+
+bool JavaScript::Lexer::isLineTerminator() const
+{
+    return (current == '\n' || current == '\r');
+}
+
+bool JavaScript::Lexer::isIdentLetter(ushort c)
+{
+    /* TODO: allow other legitimate unicode chars */
+    return ((c >= 'a' && c <= 'z')
+            || (c >= 'A' && c <= 'Z')
+            || c == '$'
+            || c == '_');
+}
+
+bool JavaScript::Lexer::isDecimalDigit(ushort c)
+{
+    return (c >= '0' && c <= '9');
+}
+
+bool JavaScript::Lexer::isHexDigit(ushort c) const
+{
+    return ((c >= '0' && c <= '9')
+            || (c >= 'a' && c <= 'f')
+            || (c >= 'A' && c <= 'F'));
+}
+
+bool JavaScript::Lexer::isOctalDigit(ushort c) const
+{
+    return (c >= '0' && c <= '7');
+}
+
+int JavaScript::Lexer::matchPunctuator(ushort c1, ushort c2,
+                            ushort c3, ushort c4)
+{
+    if (c1 == '>' && c2 == '>' && c3 == '>' && c4 == '=') {
+        shift(4);
+        return JavaScriptGrammar::T_GT_GT_GT_EQ;
+    } else if (c1 == '=' && c2 == '=' && c3 == '=') {
+        shift(3);
+        return JavaScriptGrammar::T_EQ_EQ_EQ;
+    } else if (c1 == '!' && c2 == '=' && c3 == '=') {
+        shift(3);
+        return JavaScriptGrammar::T_NOT_EQ_EQ;
+    } else if (c1 == '>' && c2 == '>' && c3 == '>') {
+        shift(3);
+        return JavaScriptGrammar::T_GT_GT_GT;
+    } else if (c1 == '<' && c2 == '<' && c3 == '=') {
+        shift(3);
+        return JavaScriptGrammar::T_LT_LT_EQ;
+    } else if (c1 == '>' && c2 == '>' && c3 == '=') {
+        shift(3);
+        return JavaScriptGrammar::T_GT_GT_EQ;
+    } else if (c1 == '<' && c2 == '=') {
+        shift(2);
+        return JavaScriptGrammar::T_LE;
+    } else if (c1 == '>' && c2 == '=') {
+        shift(2);
+        return JavaScriptGrammar::T_GE;
+    } else if (c1 == '!' && c2 == '=') {
+        shift(2);
+        return JavaScriptGrammar::T_NOT_EQ;
+    } else if (c1 == '+' && c2 == '+') {
+        shift(2);
+        return JavaScriptGrammar::T_PLUS_PLUS;
+    } else if (c1 == '-' && c2 == '-') {
+        shift(2);
+        return JavaScriptGrammar::T_MINUS_MINUS;
+    } else if (c1 == '=' && c2 == '=') {
+        shift(2);
+        return JavaScriptGrammar::T_EQ_EQ;
+    } else if (c1 == '+' && c2 == '=') {
+        shift(2);
+        return JavaScriptGrammar::T_PLUS_EQ;
+    } else if (c1 == '-' && c2 == '=') {
+        shift(2);
+        return JavaScriptGrammar::T_MINUS_EQ;
+    } else if (c1 == '*' && c2 == '=') {
+        shift(2);
+        return JavaScriptGrammar::T_STAR_EQ;
+    } else if (c1 == '/' && c2 == '=') {
+        shift(2);
+        return JavaScriptGrammar::T_DIVIDE_EQ;
+    } else if (c1 == '&' && c2 == '=') {
+        shift(2);
+        return JavaScriptGrammar::T_AND_EQ;
+    } else if (c1 == '^' && c2 == '=') {
+        shift(2);
+        return JavaScriptGrammar::T_XOR_EQ;
+    } else if (c1 == '%' && c2 == '=') {
+        shift(2);
+        return JavaScriptGrammar::T_REMAINDER_EQ;
+    } else if (c1 == '|' && c2 == '=') {
+        shift(2);
+        return JavaScriptGrammar::T_OR_EQ;
+    } else if (c1 == '<' && c2 == '<') {
+        shift(2);
+        return JavaScriptGrammar::T_LT_LT;
+    } else if (c1 == '>' && c2 == '>') {
+        shift(2);
+        return JavaScriptGrammar::T_GT_GT;
+    } else if (c1 == '&' && c2 == '&') {
+        shift(2);
+        return JavaScriptGrammar::T_AND_AND;
+    } else if (c1 == '|' && c2 == '|') {
+        shift(2);
+        return JavaScriptGrammar::T_OR_OR;
+    }
+
+    switch(c1) {
+        case '=': shift(1); return JavaScriptGrammar::T_EQ;
+        case '>': shift(1); return JavaScriptGrammar::T_GT;
+        case '<': shift(1); return JavaScriptGrammar::T_LT;
+        case ',': shift(1); return JavaScriptGrammar::T_COMMA;
+        case '!': shift(1); return JavaScriptGrammar::T_NOT;
+        case '~': shift(1); return JavaScriptGrammar::T_TILDE;
+        case '?': shift(1); return JavaScriptGrammar::T_QUESTION;
+        case ':': shift(1); return JavaScriptGrammar::T_COLON;
+        case '.': shift(1); return JavaScriptGrammar::T_DOT;
+        case '+': shift(1); return JavaScriptGrammar::T_PLUS;
+        case '-': shift(1); return JavaScriptGrammar::T_MINUS;
+        case '*': shift(1); return JavaScriptGrammar::T_STAR;
+        case '/': shift(1); return JavaScriptGrammar::T_DIVIDE_;
+        case '&': shift(1); return JavaScriptGrammar::T_AND;
+        case '|': shift(1); return JavaScriptGrammar::T_OR;
+        case '^': shift(1); return JavaScriptGrammar::T_XOR;
+        case '%': shift(1); return JavaScriptGrammar::T_REMAINDER;
+        case '(': shift(1); return JavaScriptGrammar::T_LPAREN;
+        case ')': shift(1); return JavaScriptGrammar::T_RPAREN;
+        case '{': shift(1); return JavaScriptGrammar::T_LBRACE;
+        case '}': shift(1); return JavaScriptGrammar::T_RBRACE;
+        case '[': shift(1); return JavaScriptGrammar::T_LBRACKET;
+        case ']': shift(1); return JavaScriptGrammar::T_RBRACKET;
+        case ';': shift(1); return JavaScriptGrammar::T_SEMICOLON;
+
+        default: return -1;
+    }
+}
+
+ushort JavaScript::Lexer::singleEscape(ushort c) const
+{
+    switch(c) {
+    case 'b':
+        return 0x08;
+    case 't':
+        return 0x09;
+    case 'n':
+        return 0x0A;
+    case 'v':
+        return 0x0B;
+    case 'f':
+        return 0x0C;
+    case 'r':
+        return 0x0D;
+    case '"':
+        return 0x22;
+    case '\'':
+        return 0x27;
+    case '\\':
+        return 0x5C;
+    default:
+        return c;
+    }
+}
+
+ushort JavaScript::Lexer::convertOctal(ushort c1, ushort c2,
+                            ushort c3) const
+{
+    return ((c1 - '0') * 64 + (c2 - '0') * 8 + c3 - '0');
+}
+
+unsigned char JavaScript::Lexer::convertHex(ushort c)
+{
+    if (c >= '0' && c <= '9')
+        return (c - '0');
+    else if (c >= 'a' && c <= 'f')
+        return (c - 'a' + 10);
+    else
+        return (c - 'A' + 10);
+}
+
+unsigned char JavaScript::Lexer::convertHex(ushort c1, ushort c2)
+{
+    return ((convertHex(c1) << 4) + convertHex(c2));
+}
+
+QChar JavaScript::Lexer::convertUnicode(ushort c1, ushort c2,
+                             ushort c3, ushort c4)
+{
+    return QChar((convertHex(c3) << 4) + convertHex(c4),
+                  (convertHex(c1) << 4) + convertHex(c2));
+}
+
+void JavaScript::Lexer::record8(ushort c)
+{
+    Q_ASSERT(c <= 0xff);
+
+    // enlarge buffer if full
+    if (pos8 >= size8 - 1) {
+        char *tmp = new char[2 * size8];
+        memcpy(tmp, buffer8, size8 * sizeof(char));
+        delete [] buffer8;
+        buffer8 = tmp;
+        size8 *= 2;
+    }
+
+    buffer8[pos8++] = (char) c;
+}
+
+void JavaScript::Lexer::record16(QChar c)
+{
+    // enlarge buffer if full
+    if (pos16 >= size16 - 1) {
+        QChar *tmp = new QChar[2 * size16];
+        memcpy(tmp, buffer16, size16 * sizeof(QChar));
+        delete [] buffer16;
+        buffer16 = tmp;
+        size16 *= 2;
+    }
+
+    buffer16[pos16++] = c;
+}
+
+void JavaScript::Lexer::recordStartPos()
+{
+    startlineno = yylineno;
+    startcolumn = yycolumn;
+}
+
+bool JavaScript::Lexer::scanRegExp(RegExpBodyPrefix prefix)
+{
+    pos16 = 0;
+    bool lastWasEscape = false;
+
+    if (prefix == EqualPrefix)
+        record16(QLatin1Char('='));
+
+    while (1) {
+        if (isLineTerminator() || current == 0) {
+            errmsg = QLatin1String("Unterminated regular expression literal");
+            return false;
+        }
+        else if (current != '/' || lastWasEscape == true)
+            {
+                record16(current);
+                lastWasEscape = !lastWasEscape && (current == '\\');
+            }
+        else {
+            if (driver)
+                pattern = driver->intern(buffer16, pos16);
+            else
+                pattern = 0;
+            pos16 = 0;
+            shift(1);
+            break;
+        }
+        shift(1);
+    }
+
+    flags = 0;
+    while (isIdentLetter(current)) {
+        int flag = JavaScript::Ecma::RegExp::flagFromChar(current);
+        if (flag == 0) {
+            errmsg = QString::fromLatin1("Invalid regular expression flag '%0'")
+                     .arg(QChar(current));
+            return false;
+        }
+        flags |= flag;
+        record16(current);
+        shift(1);
+    }
+
+    return true;
+}
+
+void JavaScript::Lexer::syncProhibitAutomaticSemicolon()
+{
+    if (parenthesesState == BalancedParentheses) {
+        // we have seen something like "if (foo)", which means we should
+        // never insert an automatic semicolon at this point, since it would
+        // then be expanded into an empty statement (ECMA-262 7.9.1)
+        prohibitAutomaticSemicolon = true;
+        parenthesesState = IgnoreParentheses;
+    } else {
+        prohibitAutomaticSemicolon = false;
+    }
+}
+
+QT_END_NAMESPACE
+
+
diff --git a/src/plugins/qtscripteditor/parser/javascriptlexer_p.h b/src/plugins/qtscripteditor/parser/javascriptlexer_p.h
new file mode 100644
index 0000000000000000000000000000000000000000..220bc3f2614b519912465e72ce0cb2bbf5f2aeb3
--- /dev/null
+++ b/src/plugins/qtscripteditor/parser/javascriptlexer_p.h
@@ -0,0 +1,246 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the QtScript module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain
+** additional rights. These rights are described in the Nokia Qt LGPL
+** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef JAVASCRIPTLEXER_P_H
+#define JAVASCRIPTLEXER_P_H
+
+//
+//  W A R N I N G
+//  -------------
+//
+// This file is not part of the Qt API.  It exists purely as an
+// implementation detail.  This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtCore/QString>
+
+
+
+QT_BEGIN_NAMESPACE
+
+class JavaScriptEnginePrivate;
+class JavaScriptNameIdImpl;
+
+namespace JavaScript {
+
+class Lexer
+{
+public:
+    Lexer(JavaScriptEnginePrivate *eng);
+    ~Lexer();
+
+    void setCode(const QString &c, int lineno);
+    int lex();
+
+    int currentLineNo() const { return yylineno; }
+    int currentColumnNo() const { return yycolumn; }
+
+    int startLineNo() const { return startlineno; }
+    int startColumnNo() const { return startcolumn; }
+
+    int endLineNo() const { return currentLineNo(); }
+    int endColumnNo() const
+    { int col = currentColumnNo(); return (col > 0) ? col - 1 : col; }
+
+    bool prevTerminator() const { return terminator; }
+
+    enum State { Start,
+                 Identifier,
+                 InIdentifier,
+                 InSingleLineComment,
+                 InMultiLineComment,
+                 InNum,
+                 InNum0,
+                 InHex,
+                 InOctal,
+                 InDecimal,
+                 InExponentIndicator,
+                 InExponent,
+                 Hex,
+                 Octal,
+                 Number,
+                 String,
+                 Eof,
+                 InString,
+                 InEscapeSequence,
+                 InHexEscape,
+                 InUnicodeEscape,
+                 Other,
+                 Bad };
+
+    enum Error {
+        NoError,
+        IllegalCharacter,
+        UnclosedStringLiteral,
+        IllegalEscapeSequence,
+        IllegalUnicodeEscapeSequence,
+        UnclosedComment,
+        IllegalExponentIndicator,
+        IllegalIdentifier
+    };
+
+    enum ParenthesesState {
+        IgnoreParentheses,
+        CountParentheses,
+        BalancedParentheses
+    };
+
+    enum RegExpBodyPrefix {
+        NoPrefix,
+        EqualPrefix
+    };
+
+    bool scanRegExp(RegExpBodyPrefix prefix = NoPrefix);
+
+    JavaScriptNameIdImpl *pattern;
+    int flags;
+
+    State lexerState() const
+        { return state; }
+
+    QString errorMessage() const
+        { return errmsg; }
+    void setErrorMessage(const QString &err)
+        { errmsg = err; }
+    void setErrorMessage(const char *err)
+        { setErrorMessage(QString::fromLatin1(err)); }
+
+    Error error() const
+        { return err; }
+    void clearError()
+        { err = NoError; }
+
+private:
+    JavaScriptEnginePrivate *driver;
+    int yylineno;
+    bool done;
+    char *buffer8;
+    QChar *buffer16;
+    uint size8, size16;
+    uint pos8, pos16;
+    bool terminator;
+    bool restrKeyword;
+    // encountered delimiter like "'" and "}" on last run
+    bool delimited;
+    int stackToken;
+
+    State state;
+    void setDone(State s);
+    uint pos;
+    void shift(uint p);
+    int lookupKeyword(const char *);
+
+    bool isWhiteSpace() const;
+    bool isLineTerminator() const;
+    bool isHexDigit(ushort c) const;
+    bool isOctalDigit(ushort c) const;
+
+    int matchPunctuator(ushort c1, ushort c2,
+                         ushort c3, ushort c4);
+    ushort singleEscape(ushort c) const;
+    ushort convertOctal(ushort c1, ushort c2,
+                         ushort c3) const;
+public:
+    static unsigned char convertHex(ushort c1);
+    static unsigned char convertHex(ushort c1, ushort c2);
+    static QChar convertUnicode(ushort c1, ushort c2,
+                                 ushort c3, ushort c4);
+    static bool isIdentLetter(ushort c);
+    static bool isDecimalDigit(ushort c);
+
+    inline int ival() const { return qsyylval.ival; }
+    inline double dval() const { return qsyylval.dval; }
+    inline JavaScriptNameIdImpl *ustr() const { return qsyylval.ustr; }
+
+    const QChar *characterBuffer() const { return buffer16; }
+    int characterCount() const { return pos16; }
+
+private:
+    void record8(ushort c);
+    void record16(QChar c);
+    void recordStartPos();
+
+    int findReservedWord(const QChar *buffer, int size) const;
+
+    void syncProhibitAutomaticSemicolon();
+
+    const QChar *code;
+    uint length;
+    int yycolumn;
+    int startlineno;
+    int startcolumn;
+    int bol;     // begin of line
+
+    union {
+        int ival;
+        double dval;
+        JavaScriptNameIdImpl *ustr;
+    } qsyylval;
+
+    // current and following unicode characters
+    ushort current, next1, next2, next3;
+
+    struct keyword {
+        const char *name;
+        int token;
+    };
+
+    QString errmsg;
+    Error err;
+
+    bool wantRx;
+    bool check_reserved;
+
+    ParenthesesState parenthesesState;
+    int parenthesesCount;
+    bool prohibitAutomaticSemicolon;
+};
+
+} // namespace JavaScript
+
+QT_END_NAMESPACE
+
+
+
+#endif
diff --git a/src/plugins/qtscripteditor/parser/javascriptmemorypool_p.h b/src/plugins/qtscripteditor/parser/javascriptmemorypool_p.h
new file mode 100644
index 0000000000000000000000000000000000000000..cff76776b107ca200f9dcb370e58256131f1158e
--- /dev/null
+++ b/src/plugins/qtscripteditor/parser/javascriptmemorypool_p.h
@@ -0,0 +1,130 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the QtScript module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain
+** additional rights. These rights are described in the Nokia Qt LGPL
+** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef JAVASCRIPTMEMORYPOOL_P_H
+#define JAVASCRIPTMEMORYPOOL_P_H
+
+//
+//  W A R N I N G
+//  -------------
+//
+// This file is not part of the Qt API.  It exists purely as an
+// implementation detail.  This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtCore/qglobal.h>
+#include <QtCore/qshareddata.h>
+#include <string.h>
+
+QT_BEGIN_NAMESPACE
+
+namespace JavaScript {
+
+class MemoryPool : public QSharedData
+{
+public:
+    enum { maxBlockCount = -1 };
+    enum { defaultBlockSize = 1 << 12 };
+
+    MemoryPool() {
+        m_blockIndex = maxBlockCount;
+        m_currentIndex = 0;
+        m_storage = 0;
+        m_currentBlock = 0;
+        m_currentBlockSize = 0;
+    }
+
+    virtual ~MemoryPool() {
+        for (int index = 0; index < m_blockIndex + 1; ++index)
+            qFree(m_storage[index]);
+
+        qFree(m_storage);
+    }
+
+    char *allocate(int bytes) {
+        bytes += (8 - bytes) & 7; // ensure multiple of 8 bytes (maintain alignment)
+        if (m_currentBlock == 0 || m_currentBlockSize < m_currentIndex + bytes) {
+            ++m_blockIndex;
+            m_currentBlockSize = defaultBlockSize << m_blockIndex;
+
+            m_storage = reinterpret_cast<char**>(qRealloc(m_storage, sizeof(char*) * (1 + m_blockIndex)));
+            m_currentBlock = m_storage[m_blockIndex] = reinterpret_cast<char*>(qMalloc(m_currentBlockSize));
+            ::memset(m_currentBlock, 0, m_currentBlockSize);
+
+            m_currentIndex = (8 - quintptr(m_currentBlock)) & 7; // ensure first chunk is 64-bit aligned
+            Q_ASSERT(m_currentIndex + bytes <= m_currentBlockSize);
+        }
+
+        char *p = reinterpret_cast<char *>
+            (m_currentBlock + m_currentIndex);
+
+        m_currentIndex += bytes;
+
+        return p;
+    }
+
+    int bytesAllocated() const {
+        int bytes = 0;
+        for (int index = 0; index < m_blockIndex; ++index)
+            bytes += (defaultBlockSize << index);
+        bytes += m_currentIndex;
+        return bytes;
+    }
+
+private:
+    int m_blockIndex;
+    int m_currentIndex;
+    char *m_currentBlock;
+    int m_currentBlockSize;
+    char **m_storage;
+
+private:
+    Q_DISABLE_COPY(MemoryPool)
+};
+
+} // namespace JavaScript
+
+QT_END_NAMESPACE
+
+#endif
diff --git a/src/plugins/qtscripteditor/parser/javascriptnodepool_p.h b/src/plugins/qtscripteditor/parser/javascriptnodepool_p.h
new file mode 100644
index 0000000000000000000000000000000000000000..3f59123eae37fef587b0873f461352f4f50e46ac
--- /dev/null
+++ b/src/plugins/qtscripteditor/parser/javascriptnodepool_p.h
@@ -0,0 +1,139 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the QtScript module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain
+** additional rights. These rights are described in the Nokia Qt LGPL
+** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef JAVASCRIPTNODEPOOL_P_H
+#define JAVASCRIPTNODEPOOL_P_H
+
+//
+//  W A R N I N G
+//  -------------
+//
+// This file is not part of the Qt API.  It exists purely as an
+// implementation detail.  This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtCore/QHash>
+#include <QtCore/QString>
+
+#include "javascriptmemorypool_p.h"
+
+QT_BEGIN_NAMESPACE
+
+class JavaScriptEnginePrivate;
+
+namespace JavaScript {
+
+namespace AST {
+class Node;
+} // namespace AST
+
+class Code;
+class CompilationUnit;
+
+template <typename NodeType>
+inline NodeType *makeAstNode(MemoryPool *storage)
+{
+    NodeType *node = new (storage->allocate(sizeof(NodeType))) NodeType();
+    return node;
+}
+
+template <typename NodeType, typename Arg1>
+inline NodeType *makeAstNode(MemoryPool *storage, Arg1 arg1)
+{
+    NodeType *node = new (storage->allocate(sizeof(NodeType))) NodeType(arg1);
+    return node;
+}
+
+template <typename NodeType, typename Arg1, typename Arg2>
+inline NodeType *makeAstNode(MemoryPool *storage, Arg1 arg1, Arg2 arg2)
+{
+    NodeType *node = new (storage->allocate(sizeof(NodeType))) NodeType(arg1, arg2);
+    return node;
+}
+
+template <typename NodeType, typename Arg1, typename Arg2, typename Arg3>
+inline NodeType *makeAstNode(MemoryPool *storage, Arg1 arg1, Arg2 arg2, Arg3 arg3)
+{
+    NodeType *node = new (storage->allocate(sizeof(NodeType))) NodeType(arg1, arg2, arg3);
+    return node;
+}
+
+template <typename NodeType, typename Arg1, typename Arg2, typename Arg3, typename Arg4>
+inline NodeType *makeAstNode(MemoryPool *storage, Arg1 arg1, Arg2 arg2, Arg3 arg3, Arg4 arg4)
+{
+    NodeType *node = new (storage->allocate(sizeof(NodeType))) NodeType(arg1, arg2, arg3, arg4);
+    return node;
+}
+
+class NodePool : public MemoryPool
+{
+public:
+    NodePool(const QString &fileName, JavaScriptEnginePrivate *engine);
+    virtual ~NodePool();
+
+    Code *createCompiledCode(AST::Node *node, CompilationUnit &compilation);
+
+    inline QString fileName() const { return m_fileName; }
+    inline JavaScriptEnginePrivate *engine() const { return m_engine; }
+#ifndef J_SCRIPT_NO_EVENT_NOTIFY
+    inline qint64 id() const { return m_id; }
+#endif
+
+private:
+    QHash<AST::Node*, Code*> m_codeCache;
+    QString m_fileName;
+    JavaScriptEnginePrivate *m_engine;
+#ifndef J_SCRIPT_NO_EVENT_NOTIFY
+    qint64 m_id;
+#endif
+
+private:
+    Q_DISABLE_COPY(NodePool)
+};
+
+} // namespace JavaScript
+
+QT_END_NAMESPACE
+
+#endif
diff --git a/src/plugins/qtscripteditor/parser/javascriptparser.cpp b/src/plugins/qtscripteditor/parser/javascriptparser.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..ac9dd96d0cd54140deead7b196fd2207bcd329ae
--- /dev/null
+++ b/src/plugins/qtscripteditor/parser/javascriptparser.cpp
@@ -0,0 +1,1586 @@
+// This file was generated by qlalr - DO NOT EDIT!
+
+#line 84 "./javascript.g"
+
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the QtScript module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain
+** additional rights. These rights are described in the Nokia Qt LGPL
+** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtCore/QtDebug>
+
+#ifndef QT_NO_JAVASCRIPT
+
+#include <string.h>
+
+
+#include "javascriptengine_p.h"
+
+
+
+
+#include "javascriptlexer_p.h"
+#include "javascriptast_p.h"
+#include "javascriptnodepool_p.h"
+
+#define Q_JAVASCRIPT_UPDATE_POSITION(node, startloc, endloc) do { \
+    node->startLine = startloc.startLine; \
+    node->startColumn = startloc.startColumn; \
+    node->endLine = endloc.endLine; \
+    node->endColumn = endloc.endColumn; \
+} while (0)
+
+
+#line 310 "./javascript.g"
+
+
+#include "javascriptparser_p.h"
+
+//
+// This file is automatically generated from javascript.g.
+// Changes will be lost.
+//
+
+QT_BEGIN_NAMESPACE
+
+inline static bool automatic(JavaScriptEnginePrivate *driver, int token)
+{
+    return token == JavaScriptGrammar::T_RBRACE
+        || token == 0
+        || driver->lexer()->prevTerminator();
+}
+
+
+JavaScriptParser::JavaScriptParser():
+    tos(0),
+    stack_size(0),
+    sym_stack(0),
+    state_stack(0),
+    location_stack(0),
+    error_lineno(0),
+    error_column(0)
+{
+}
+
+JavaScriptParser::~JavaScriptParser()
+{
+    if (stack_size) {
+        qFree(sym_stack);
+        qFree(state_stack);
+        qFree(location_stack);
+    }
+}
+
+static inline JavaScriptParser::Location location(JavaScript::Lexer *lexer)
+{
+    JavaScriptParser::Location loc;
+    loc.startLine = lexer->startLineNo();
+    loc.startColumn = lexer->startColumnNo();
+    loc.endLine = lexer->endLineNo();
+    loc.endColumn = lexer->endColumnNo();
+    return loc;
+}
+
+bool JavaScriptParser::parse(JavaScriptEnginePrivate *driver)
+{
+  const int INITIAL_STATE = 0;
+  JavaScript::Lexer *lexer = driver->lexer();
+
+  int yytoken = -1;
+  int saved_yytoken = -1;
+
+  reallocateStack();
+
+  tos = 0;
+  state_stack[++tos] = INITIAL_STATE;
+
+  while (true)
+    {
+      const int state = state_stack [tos];
+      if (yytoken == -1 && - TERMINAL_COUNT != action_index [state])
+        {
+          if (saved_yytoken == -1)
+            {
+              yytoken = lexer->lex();
+              location_stack [tos] = location(lexer);
+            }
+          else
+            {
+              yytoken = saved_yytoken;
+              saved_yytoken = -1;
+            }
+        }
+
+      int act = t_action (state, yytoken);
+
+      if (act == ACCEPT_STATE)
+        return true;
+
+      else if (act > 0)
+        {
+          if (++tos == stack_size)
+            reallocateStack();
+
+          sym_stack [tos].dval = lexer->dval ();
+          state_stack [tos] = act;
+          location_stack [tos] = location(lexer);
+          yytoken = -1;
+        }
+
+      else if (act < 0)
+        {
+          int r = - act - 1;
+
+          tos -= rhs [r];
+          act = state_stack [tos++];
+
+          switch (r) {
+
+#line 416 "./javascript.g"
+
+case 0: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::ThisExpression> (driver->nodePool());
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
+} break;
+
+#line 424 "./javascript.g"
+
+case 1: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::IdentifierExpression> (driver->nodePool(), sym(1).sval);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
+} break;
+
+#line 432 "./javascript.g"
+
+case 2: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::NullExpression> (driver->nodePool());
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
+} break;
+
+#line 440 "./javascript.g"
+
+case 3: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::TrueLiteral> (driver->nodePool());
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
+} break;
+
+#line 448 "./javascript.g"
+
+case 4: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::FalseLiteral> (driver->nodePool());
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
+} break;
+
+#line 456 "./javascript.g"
+
+case 5: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::NumericLiteral> (driver->nodePool(), sym(1).dval);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
+} break;
+
+#line 464 "./javascript.g"
+
+case 6: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::StringLiteral> (driver->nodePool(), sym(1).sval);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
+} break;
+
+#line 475 "./javascript.g"
+
+case 7: {
+  bool rx = lexer->scanRegExp(JavaScript::Lexer::NoPrefix);
+  if (!rx) {
+      error_message = lexer->errorMessage();
+      error_lineno = lexer->startLineNo();
+      error_column = lexer->startColumnNo();
+      return false;
+  }
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::RegExpLiteral> (driver->nodePool(), lexer->pattern, lexer->flags);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
+} break;
+
+#line 493 "./javascript.g"
+
+case 8: {
+  bool rx = lexer->scanRegExp(JavaScript::Lexer::EqualPrefix);
+  if (!rx) {
+      error_message = lexer->errorMessage();
+      error_lineno = lexer->startLineNo();
+      error_column = lexer->startColumnNo();
+      return false;
+  }
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::RegExpLiteral> (driver->nodePool(), lexer->pattern, lexer->flags);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
+} break;
+
+#line 508 "./javascript.g"
+
+case 9: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::ArrayLiteral> (driver->nodePool(), sym(2).Elision);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+
+#line 516 "./javascript.g"
+
+case 10: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::ArrayLiteral> (driver->nodePool(), sym(2).ElementList->finish ());
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+
+#line 524 "./javascript.g"
+
+case 11: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::ArrayLiteral> (driver->nodePool(), sym(2).ElementList->finish (), sym(4).Elision);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(5));
+} break;
+
+#line 540 "./javascript.g"
+
+case 12: {
+  if (sym(2).Node)
+    sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::ObjectLiteral> (driver->nodePool(), sym(2).PropertyNameAndValueList->finish ());
+  else
+    sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::ObjectLiteral> (driver->nodePool());
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+
+#line 551 "./javascript.g"
+
+case 13: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::ObjectLiteral> (driver->nodePool(), sym(2).PropertyNameAndValueList->finish ());
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(4));
+} break;
+
+#line 559 "./javascript.g"
+
+case 14: {
+  sym(1) = sym(2);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+
+#line 567 "./javascript.g"
+
+case 15: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::ElementList> (driver->nodePool(), sym(1).Elision, sym(2).Expression);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
+} break;
+
+#line 575 "./javascript.g"
+
+case 16: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::ElementList> (driver->nodePool(), sym(1).ElementList, sym(3).Elision, sym(4).Expression);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(4));
+} break;
+
+#line 583 "./javascript.g"
+
+case 17: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::Elision> (driver->nodePool());
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
+} break;
+
+#line 591 "./javascript.g"
+
+case 18: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::Elision> (driver->nodePool(), sym(1).Elision);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
+} break;
+
+#line 599 "./javascript.g"
+
+case 19: {
+  sym(1).Node = 0;
+} break;
+
+#line 606 "./javascript.g"
+
+case 20: {
+  sym(1).Elision = sym(1).Elision->finish ();
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
+} break;
+
+#line 614 "./javascript.g"
+
+case 21: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::PropertyNameAndValueList> (driver->nodePool(), sym(1).PropertyName, sym(3).Expression);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+
+#line 622 "./javascript.g"
+
+case 22: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::PropertyNameAndValueList> (driver->nodePool(), sym(1).PropertyNameAndValueList, sym(3).PropertyName, sym(5).Expression);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(5));
+} break;
+
+#line 630 "./javascript.g"
+
+case 23: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::IdentifierPropertyName> (driver->nodePool(), sym(1).sval);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
+} break;
+
+#line 638 "./javascript.g"
+
+case 24: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::StringLiteralPropertyName> (driver->nodePool(), sym(1).sval);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
+} break;
+
+#line 646 "./javascript.g"
+
+case 25: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::NumericLiteralPropertyName> (driver->nodePool(), sym(1).dval);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
+} break;
+
+#line 654 "./javascript.g"
+
+case 26: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::IdentifierPropertyName> (driver->nodePool(), sym(1).sval);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
+} break;
+
+#line 662 "./javascript.g"
+
+case 27:
+
+#line 666 "./javascript.g"
+
+case 28:
+
+#line 670 "./javascript.g"
+
+case 29:
+
+#line 674 "./javascript.g"
+
+case 30:
+
+#line 678 "./javascript.g"
+
+case 31:
+
+#line 682 "./javascript.g"
+
+case 32:
+
+#line 686 "./javascript.g"
+
+case 33:
+
+#line 690 "./javascript.g"
+
+case 34:
+
+#line 694 "./javascript.g"
+
+case 35:
+
+#line 698 "./javascript.g"
+
+case 36:
+
+#line 702 "./javascript.g"
+
+case 37:
+
+#line 706 "./javascript.g"
+
+case 38:
+
+#line 710 "./javascript.g"
+
+case 39:
+
+#line 714 "./javascript.g"
+
+case 40:
+
+#line 718 "./javascript.g"
+
+case 41:
+
+#line 722 "./javascript.g"
+
+case 42:
+
+#line 726 "./javascript.g"
+
+case 43:
+
+#line 730 "./javascript.g"
+
+case 44:
+
+#line 734 "./javascript.g"
+
+case 45:
+
+#line 738 "./javascript.g"
+
+case 46:
+
+#line 742 "./javascript.g"
+
+case 47:
+
+#line 746 "./javascript.g"
+
+case 48:
+
+#line 750 "./javascript.g"
+
+case 49:
+
+#line 754 "./javascript.g"
+
+case 50:
+
+#line 758 "./javascript.g"
+
+case 51:
+
+#line 762 "./javascript.g"
+
+case 52:
+
+#line 766 "./javascript.g"
+
+case 53:
+
+#line 770 "./javascript.g"
+
+case 54:
+
+#line 774 "./javascript.g"
+
+case 55:
+
+#line 778 "./javascript.g"
+
+case 56:
+
+#line 782 "./javascript.g"
+
+case 57:
+{
+  sym(1).sval = driver->intern(lexer->characterBuffer(), lexer->characterCount());
+} break;
+
+#line 796 "./javascript.g"
+
+case 62: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::ArrayMemberExpression> (driver->nodePool(), sym(1).Expression, sym(3).Expression);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(4));
+} break;
+
+#line 804 "./javascript.g"
+
+case 63: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::FieldMemberExpression> (driver->nodePool(), sym(1).Expression, sym(3).sval);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(4));
+} break;
+
+#line 812 "./javascript.g"
+
+case 64: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::NewMemberExpression> (driver->nodePool(), sym(2).Expression, sym(3).ArgumentList);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+
+#line 822 "./javascript.g"
+
+case 66: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::NewExpression> (driver->nodePool(), sym(2).Expression);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
+} break;
+
+#line 830 "./javascript.g"
+
+case 67: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::CallExpression> (driver->nodePool(), sym(1).Expression, sym(2).ArgumentList);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
+} break;
+
+#line 838 "./javascript.g"
+
+case 68: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::CallExpression> (driver->nodePool(), sym(1).Expression, sym(2).ArgumentList);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
+} break;
+
+#line 846 "./javascript.g"
+
+case 69: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::ArrayMemberExpression> (driver->nodePool(), sym(1).Expression, sym(3).Expression);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(4));
+} break;
+
+#line 854 "./javascript.g"
+
+case 70: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::FieldMemberExpression> (driver->nodePool(), sym(1).Expression, sym(3).sval);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+
+#line 862 "./javascript.g"
+
+case 71: {
+  sym(1).Node = 0;
+} break;
+
+#line 869 "./javascript.g"
+
+case 72: {
+  sym(1).Node = sym(2).ArgumentList->finish ();
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+
+#line 877 "./javascript.g"
+
+case 73: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::ArgumentList> (driver->nodePool(), sym(1).Expression);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
+} break;
+
+#line 885 "./javascript.g"
+
+case 74: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::ArgumentList> (driver->nodePool(), sym(1).ArgumentList, sym(3).Expression);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+
+#line 897 "./javascript.g"
+
+case 78: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::PostIncrementExpression> (driver->nodePool(), sym(1).Expression);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
+} break;
+
+#line 905 "./javascript.g"
+
+case 79: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::PostDecrementExpression> (driver->nodePool(), sym(1).Expression);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
+} break;
+
+#line 915 "./javascript.g"
+
+case 81: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::DeleteExpression> (driver->nodePool(), sym(2).Expression);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
+} break;
+
+#line 923 "./javascript.g"
+
+case 82: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::VoidExpression> (driver->nodePool(), sym(2).Expression);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
+} break;
+
+#line 931 "./javascript.g"
+
+case 83: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::TypeOfExpression> (driver->nodePool(), sym(2).Expression);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
+} break;
+
+#line 939 "./javascript.g"
+
+case 84: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::PreIncrementExpression> (driver->nodePool(), sym(2).Expression);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
+} break;
+
+#line 947 "./javascript.g"
+
+case 85: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::PreDecrementExpression> (driver->nodePool(), sym(2).Expression);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
+} break;
+
+#line 955 "./javascript.g"
+
+case 86: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::UnaryPlusExpression> (driver->nodePool(), sym(2).Expression);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
+} break;
+
+#line 963 "./javascript.g"
+
+case 87: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::UnaryMinusExpression> (driver->nodePool(), sym(2).Expression);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
+} break;
+
+#line 971 "./javascript.g"
+
+case 88: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::TildeExpression> (driver->nodePool(), sym(2).Expression);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
+} break;
+
+#line 979 "./javascript.g"
+
+case 89: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::NotExpression> (driver->nodePool(), sym(2).Expression);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
+} break;
+
+#line 989 "./javascript.g"
+
+case 91: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Mul, sym(3).Expression);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+
+#line 997 "./javascript.g"
+
+case 92: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Div, sym(3).Expression);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+
+#line 1005 "./javascript.g"
+
+case 93: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Mod, sym(3).Expression);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+
+#line 1015 "./javascript.g"
+
+case 95: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Add, sym(3).Expression);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+
+#line 1023 "./javascript.g"
+
+case 96: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Sub, sym(3).Expression);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+
+#line 1033 "./javascript.g"
+
+case 98: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::LShift, sym(3).Expression);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+
+#line 1041 "./javascript.g"
+
+case 99: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::RShift, sym(3).Expression);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+
+#line 1049 "./javascript.g"
+
+case 100: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::URShift, sym(3).Expression);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+
+#line 1059 "./javascript.g"
+
+case 102: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Lt, sym(3).Expression);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+
+#line 1067 "./javascript.g"
+
+case 103: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Gt, sym(3).Expression);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+
+#line 1075 "./javascript.g"
+
+case 104: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Le, sym(3).Expression);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+
+#line 1083 "./javascript.g"
+
+case 105: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Ge, sym(3).Expression);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+
+#line 1091 "./javascript.g"
+
+case 106: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::InstanceOf, sym(3).Expression);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+
+#line 1099 "./javascript.g"
+
+case 107: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::In, sym(3).Expression);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+
+#line 1109 "./javascript.g"
+
+case 109: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Lt, sym(3).Expression);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+
+#line 1117 "./javascript.g"
+
+case 110: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Gt, sym(3).Expression);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+
+#line 1125 "./javascript.g"
+
+case 111: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Le, sym(3).Expression);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+
+#line 1133 "./javascript.g"
+
+case 112: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Ge, sym(3).Expression);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+
+#line 1141 "./javascript.g"
+
+case 113: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::InstanceOf, sym(3).Expression);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+
+#line 1151 "./javascript.g"
+
+case 115: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Equal, sym(3).Expression);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+
+#line 1159 "./javascript.g"
+
+case 116: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::NotEqual, sym(3).Expression);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+
+#line 1167 "./javascript.g"
+
+case 117: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::StrictEqual, sym(3).Expression);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+
+#line 1175 "./javascript.g"
+
+case 118: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::StrictNotEqual, sym(3).Expression);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+
+#line 1185 "./javascript.g"
+
+case 120: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Equal, sym(3).Expression);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+
+#line 1193 "./javascript.g"
+
+case 121: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::NotEqual, sym(3).Expression);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+
+#line 1201 "./javascript.g"
+
+case 122: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::StrictEqual, sym(3).Expression);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+
+#line 1209 "./javascript.g"
+
+case 123: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::StrictNotEqual, sym(3).Expression);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+
+#line 1219 "./javascript.g"
+
+case 125: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::BitAnd, sym(3).Expression);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+
+#line 1229 "./javascript.g"
+
+case 127: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::BitAnd, sym(3).Expression);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+
+#line 1239 "./javascript.g"
+
+case 129: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::BitXor, sym(3).Expression);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+
+#line 1249 "./javascript.g"
+
+case 131: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::BitXor, sym(3).Expression);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+
+#line 1259 "./javascript.g"
+
+case 133: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::BitOr, sym(3).Expression);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+
+#line 1269 "./javascript.g"
+
+case 135: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::BitOr, sym(3).Expression);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+
+#line 1279 "./javascript.g"
+
+case 137: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::And, sym(3).Expression);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+
+#line 1289 "./javascript.g"
+
+case 139: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::And, sym(3).Expression);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+
+#line 1299 "./javascript.g"
+
+case 141: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Or, sym(3).Expression);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+
+#line 1309 "./javascript.g"
+
+case 143: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Or, sym(3).Expression);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+
+#line 1319 "./javascript.g"
+
+case 145: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::ConditionalExpression> (driver->nodePool(), sym(1).Expression, sym(3).Expression, sym(5).Expression);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+
+#line 1329 "./javascript.g"
+
+case 147: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::ConditionalExpression> (driver->nodePool(), sym(1).Expression, sym(3).Expression, sym(5).Expression);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+
+#line 1339 "./javascript.g"
+
+case 149: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, sym(2).ival, sym(3).Expression);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+
+#line 1349 "./javascript.g"
+
+case 151: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, sym(2).ival, sym(3).Expression);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+
+#line 1357 "./javascript.g"
+
+case 152: {
+  sym(1).ival = QSOperator::Assign;
+} break;
+
+#line 1364 "./javascript.g"
+
+case 153: {
+  sym(1).ival = QSOperator::InplaceMul;
+} break;
+
+#line 1371 "./javascript.g"
+
+case 154: {
+  sym(1).ival = QSOperator::InplaceDiv;
+} break;
+
+#line 1378 "./javascript.g"
+
+case 155: {
+  sym(1).ival = QSOperator::InplaceMod;
+} break;
+
+#line 1385 "./javascript.g"
+
+case 156: {
+  sym(1).ival = QSOperator::InplaceAdd;
+} break;
+
+#line 1392 "./javascript.g"
+
+case 157: {
+  sym(1).ival = QSOperator::InplaceSub;
+} break;
+
+#line 1399 "./javascript.g"
+
+case 158: {
+  sym(1).ival = QSOperator::InplaceLeftShift;
+} break;
+
+#line 1406 "./javascript.g"
+
+case 159: {
+  sym(1).ival = QSOperator::InplaceRightShift;
+} break;
+
+#line 1413 "./javascript.g"
+
+case 160: {
+  sym(1).ival = QSOperator::InplaceURightShift;
+} break;
+
+#line 1420 "./javascript.g"
+
+case 161: {
+  sym(1).ival = QSOperator::InplaceAnd;
+} break;
+
+#line 1427 "./javascript.g"
+
+case 162: {
+  sym(1).ival = QSOperator::InplaceXor;
+} break;
+
+#line 1434 "./javascript.g"
+
+case 163: {
+  sym(1).ival = QSOperator::InplaceOr;
+} break;
+
+#line 1443 "./javascript.g"
+
+case 165: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::Expression> (driver->nodePool(), sym(1).Expression, sym(3).Expression);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+
+#line 1451 "./javascript.g"
+
+case 166: {
+  sym(1).Node = 0;
+} break;
+
+#line 1462 "./javascript.g"
+
+case 169: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::Expression> (driver->nodePool(), sym(1).Expression, sym(3).Expression);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+
+#line 1470 "./javascript.g"
+
+case 170: {
+  sym(1).Node = 0;
+} break;
+
+#line 1496 "./javascript.g"
+
+case 187: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::Block> (driver->nodePool(), sym(2).StatementList);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+
+#line 1504 "./javascript.g"
+
+case 188: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::StatementList> (driver->nodePool(), sym(1).Statement);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
+} break;
+
+#line 1512 "./javascript.g"
+
+case 189: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::StatementList> (driver->nodePool(), sym(1).StatementList, sym(2).Statement);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
+} break;
+
+#line 1520 "./javascript.g"
+
+case 190: {
+  sym(1).Node = 0;
+} break;
+
+#line 1527 "./javascript.g"
+
+case 191: {
+  sym(1).Node = sym(1).StatementList->finish ();
+} break;
+
+#line 1535 "./javascript.g"
+
+case 193: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::VariableStatement> (driver->nodePool(), sym(2).VariableDeclarationList->finish (/*readOnly=*/sym(1).ival == T_CONST));
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+
+#line 1543 "./javascript.g"
+
+case 194: {
+  sym(1).ival = T_CONST;
+} break;
+
+#line 1550 "./javascript.g"
+
+case 195: {
+  sym(1).ival = T_VAR;
+} break;
+
+#line 1557 "./javascript.g"
+
+case 196: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::VariableDeclarationList> (driver->nodePool(), sym(1).VariableDeclaration);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
+} break;
+
+#line 1565 "./javascript.g"
+
+case 197: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::VariableDeclarationList> (driver->nodePool(), sym(1).VariableDeclarationList, sym(3).VariableDeclaration);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+
+#line 1573 "./javascript.g"
+
+case 198: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::VariableDeclarationList> (driver->nodePool(), sym(1).VariableDeclaration);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
+} break;
+
+#line 1581 "./javascript.g"
+
+case 199: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::VariableDeclarationList> (driver->nodePool(), sym(1).VariableDeclarationList, sym(3).VariableDeclaration);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+
+#line 1589 "./javascript.g"
+
+case 200: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::VariableDeclaration> (driver->nodePool(), sym(1).sval, sym(2).Expression);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
+} break;
+
+#line 1597 "./javascript.g"
+
+case 201: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::VariableDeclaration> (driver->nodePool(), sym(1).sval, sym(2).Expression);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
+} break;
+
+#line 1605 "./javascript.g"
+
+case 202: {
+  sym(1) = sym(2);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
+} break;
+
+#line 1613 "./javascript.g"
+
+case 203: {
+  sym(1).Node = 0;
+} break;
+
+#line 1622 "./javascript.g"
+
+case 205: {
+  sym(1) = sym(2);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
+} break;
+
+#line 1630 "./javascript.g"
+
+case 206: {
+  sym(1).Node = 0;
+} break;
+
+#line 1639 "./javascript.g"
+
+case 208: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::EmptyStatement> (driver->nodePool());
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
+} break;
+
+#line 1648 "./javascript.g"
+
+case 210: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::ExpressionStatement> (driver->nodePool(), sym(1).Expression);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
+} break;
+
+#line 1656 "./javascript.g"
+
+case 211: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::IfStatement> (driver->nodePool(), sym(3).Expression, sym(5).Statement, sym(7).Statement);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(7));
+} break;
+
+#line 1664 "./javascript.g"
+
+case 212: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::IfStatement> (driver->nodePool(), sym(3).Expression, sym(5).Statement);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(5));
+} break;
+
+#line 1674 "./javascript.g"
+
+case 214: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::DoWhileStatement> (driver->nodePool(), sym(2).Statement, sym(5).Expression);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(7));
+} break;
+
+#line 1682 "./javascript.g"
+
+case 215: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::WhileStatement> (driver->nodePool(), sym(3).Expression, sym(5).Statement);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(5));
+} break;
+
+#line 1690 "./javascript.g"
+
+case 216: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::ForStatement> (driver->nodePool(), sym(3).Expression, sym(5).Expression, sym(7).Expression, sym(9).Statement);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(9));
+} break;
+
+#line 1698 "./javascript.g"
+
+case 217: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::LocalForStatement> (driver->nodePool(), sym(4).VariableDeclarationList->finish (/*readOnly=*/false), sym(6).Expression, sym(8).Expression, sym(10).Statement);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(10));
+} break;
+
+#line 1706 "./javascript.g"
+
+case 218: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::ForEachStatement> (driver->nodePool(), sym(3).Expression, sym(5).Expression, sym(7).Statement);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(7));
+} break;
+
+#line 1714 "./javascript.g"
+
+case 219: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::LocalForEachStatement> (driver->nodePool(), sym(4).VariableDeclaration, sym(6).Expression, sym(8).Statement);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(8));
+} break;
+
+#line 1723 "./javascript.g"
+
+case 221: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::ContinueStatement> (driver->nodePool());
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
+} break;
+
+#line 1732 "./javascript.g"
+
+case 223: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::ContinueStatement> (driver->nodePool(), sym(2).sval);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+
+#line 1741 "./javascript.g"
+
+case 225: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::BreakStatement> (driver->nodePool());
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
+} break;
+
+#line 1750 "./javascript.g"
+
+case 227: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::BreakStatement> (driver->nodePool(), sym(2).sval);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+
+#line 1759 "./javascript.g"
+
+case 229: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::ReturnStatement> (driver->nodePool(), sym(2).Expression);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+
+#line 1767 "./javascript.g"
+
+case 230: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::WithStatement> (driver->nodePool(), sym(3).Expression, sym(5).Statement);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(5));
+} break;
+
+#line 1775 "./javascript.g"
+
+case 231: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::SwitchStatement> (driver->nodePool(), sym(3).Expression, sym(5).CaseBlock);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(5));
+} break;
+
+#line 1783 "./javascript.g"
+
+case 232: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::CaseBlock> (driver->nodePool(), sym(2).CaseClauses);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+
+#line 1791 "./javascript.g"
+
+case 233: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::CaseBlock> (driver->nodePool(), sym(2).CaseClauses, sym(3).DefaultClause, sym(4).CaseClauses);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(5));
+} break;
+
+#line 1799 "./javascript.g"
+
+case 234: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::CaseClauses> (driver->nodePool(), sym(1).CaseClause);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
+} break;
+
+#line 1807 "./javascript.g"
+
+case 235: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::CaseClauses> (driver->nodePool(), sym(1).CaseClauses, sym(2).CaseClause);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
+} break;
+
+#line 1815 "./javascript.g"
+
+case 236: {
+  sym(1).Node = 0;
+} break;
+
+#line 1822 "./javascript.g"
+
+case 237: {
+  sym(1).Node = sym(1).CaseClauses->finish ();
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
+} break;
+
+#line 1830 "./javascript.g"
+
+case 238: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::CaseClause> (driver->nodePool(), sym(2).Expression, sym(4).StatementList);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(4));
+} break;
+
+#line 1838 "./javascript.g"
+
+case 239: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::DefaultClause> (driver->nodePool(), sym(3).StatementList);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+
+#line 1846 "./javascript.g"
+
+case 240: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::LabelledStatement> (driver->nodePool(), sym(1).sval, sym(3).Statement);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+
+#line 1855 "./javascript.g"
+
+case 242: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::ThrowStatement> (driver->nodePool(), sym(2).Expression);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+
+#line 1863 "./javascript.g"
+
+case 243: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::TryStatement> (driver->nodePool(), sym(2).Statement, sym(3).Catch);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+
+#line 1871 "./javascript.g"
+
+case 244: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::TryStatement> (driver->nodePool(), sym(2).Statement, sym(3).Finally);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+
+#line 1879 "./javascript.g"
+
+case 245: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::TryStatement> (driver->nodePool(), sym(2).Statement, sym(3).Catch, sym(4).Finally);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(4));
+} break;
+
+#line 1887 "./javascript.g"
+
+case 246: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::Catch> (driver->nodePool(), sym(3).sval, sym(5).Statement);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(5));
+} break;
+
+#line 1895 "./javascript.g"
+
+case 247: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::Finally> (driver->nodePool(), sym(2).Statement);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
+} break;
+
+#line 1904 "./javascript.g"
+
+case 249: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::DebuggerStatement> (driver->nodePool());
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
+} break;
+
+#line 1912 "./javascript.g"
+
+case 250: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::FunctionDeclaration> (driver->nodePool(), sym(2).sval, sym(4).FormalParameterList, sym(7).FunctionBody);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(8));
+} break;
+
+#line 1920 "./javascript.g"
+
+case 251: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::FunctionExpression> (driver->nodePool(), sym(2).sval, sym(4).FormalParameterList, sym(7).FunctionBody);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(8));
+} break;
+
+#line 1928 "./javascript.g"
+
+case 252: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::FormalParameterList> (driver->nodePool(), sym(1).sval);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
+} break;
+
+#line 1936 "./javascript.g"
+
+case 253: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::FormalParameterList> (driver->nodePool(), sym(1).FormalParameterList, sym(3).sval);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
+} break;
+
+#line 1944 "./javascript.g"
+
+case 254: {
+  sym(1).Node = 0;
+} break;
+
+#line 1951 "./javascript.g"
+
+case 255: {
+  sym(1).Node = sym(1).FormalParameterList->finish ();
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
+} break;
+
+#line 1959 "./javascript.g"
+
+case 256: {
+  sym(1).Node = 0;
+} break;
+
+#line 1968 "./javascript.g"
+
+case 258: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::FunctionBody> (driver->nodePool(), sym(1).SourceElements->finish ());
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
+} break;
+
+#line 1976 "./javascript.g"
+
+case 259: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::Program> (driver->nodePool(), sym(1).SourceElements->finish ());
+  driver->changeAbstractSyntaxTree(sym(1).Node);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
+} break;
+
+#line 1985 "./javascript.g"
+
+case 260: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::SourceElements> (driver->nodePool(), sym(1).SourceElement);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
+} break;
+
+#line 1993 "./javascript.g"
+
+case 261: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::SourceElements> (driver->nodePool(), sym(1).SourceElements, sym(2).SourceElement);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
+} break;
+
+#line 2001 "./javascript.g"
+
+case 262: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::StatementSourceElement> (driver->nodePool(), sym(1).Statement);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
+} break;
+
+#line 2009 "./javascript.g"
+
+case 263: {
+  sym(1).Node = JavaScript::makeAstNode<JavaScript::AST::FunctionSourceElement> (driver->nodePool(), sym(1).FunctionDeclaration);
+  Q_JAVASCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
+} break;
+
+#line 2017 "./javascript.g"
+
+case 264: {
+  sym(1).sval = 0;
+} break;
+
+#line 2026 "./javascript.g"
+
+case 266: {
+  sym(1).Node = 0;
+} break;
+
+#line 2034 "./javascript.g"
+
+          } // switch
+
+          state_stack [tos] = nt_action (act, lhs [r] - TERMINAL_COUNT);
+
+          if (rhs[r] > 1) {
+              location_stack[tos - 1].endLine = location_stack[tos + rhs[r] - 2].endLine;
+              location_stack[tos - 1].endColumn = location_stack[tos + rhs[r] - 2].endColumn;
+              location_stack[tos] = location_stack[tos + rhs[r] - 1];
+          }
+        }
+
+      else
+        {
+          if (saved_yytoken == -1 && automatic (driver, yytoken) && t_action (state, T_AUTOMATIC_SEMICOLON) > 0)
+            {
+              saved_yytoken = yytoken;
+              yytoken = T_SEMICOLON;
+              continue;
+            }
+
+          else if ((state == INITIAL_STATE) && (yytoken == 0)) {
+              // accept empty input
+              yytoken = T_SEMICOLON;
+              continue;
+          }
+
+          int ers = state;
+          int shifts = 0;
+          int reduces = 0;
+          int expected_tokens [3];
+          for (int tk = 0; tk < TERMINAL_COUNT; ++tk)
+            {
+              int k = t_action (ers, tk);
+
+              if (! k)
+                continue;
+              else if (k < 0)
+                ++reduces;
+              else if (spell [tk])
+                {
+                  if (shifts < 3)
+                    expected_tokens [shifts] = tk;
+                  ++shifts;
+                }
+            }
+
+          error_message.clear ();
+          if (shifts && shifts < 3)
+            {
+              bool first = true;
+
+              for (int s = 0; s < shifts; ++s)
+                {
+                  if (first)
+                    error_message += QLatin1String ("Expected ");
+                  else
+                    error_message += QLatin1String (", ");
+
+                  first = false;
+                  error_message += QLatin1String("`");
+                  error_message += QLatin1String (spell [expected_tokens [s]]);
+                  error_message += QLatin1String("'");
+                }
+            }
+
+          if (error_message.isEmpty())
+              error_message = lexer->errorMessage();
+
+          error_lineno = lexer->startLineNo();
+          error_column = lexer->startColumnNo();
+
+          return false;
+        }
+    }
+
+    return false;
+}
+
+QT_END_NAMESPACE
+
+#endif // QT_NO_JAVASCRIPT
diff --git a/src/plugins/qtscripteditor/parser/javascriptparser_p.h b/src/plugins/qtscripteditor/parser/javascriptparser_p.h
new file mode 100644
index 0000000000000000000000000000000000000000..2119936332f5a75c3de49ceec7f0ff9f03729778
--- /dev/null
+++ b/src/plugins/qtscripteditor/parser/javascriptparser_p.h
@@ -0,0 +1,175 @@
+// This file was generated by qlalr - DO NOT EDIT!
+
+#line 151 "./javascript.g"
+
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the QtScript module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain
+** additional rights. These rights are described in the Nokia Qt LGPL
+** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//
+//  W A R N I N G
+//  -------------
+//
+// This file is not part of the Qt API.  It exists purely as an
+// implementation detail.  This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+//
+// This file is automatically generated from javascript.g.
+// Changes will be lost.
+//
+
+#ifndef JAVAJAVASCRIPTPARSER_P_H
+#define JAVAJAVASCRIPTPARSER_P_H
+
+#include "javascriptgrammar_p.h"
+
+#ifndef QT_NO_JAVASCRIPT
+
+#include "javascriptastfwd_p.h"
+
+QT_BEGIN_NAMESPACE
+
+class QString;
+class JavaScriptEnginePrivate;
+class JavaScriptNameIdImpl;
+
+class JavaScriptParser: protected JavaScriptGrammar
+{
+public:
+    union Value {
+      int ival;
+      double dval;
+      JavaScriptNameIdImpl *sval;
+      JavaScript::AST::ArgumentList *ArgumentList;
+      JavaScript::AST::CaseBlock *CaseBlock;
+      JavaScript::AST::CaseClause *CaseClause;
+      JavaScript::AST::CaseClauses *CaseClauses;
+      JavaScript::AST::Catch *Catch;
+      JavaScript::AST::DefaultClause *DefaultClause;
+      JavaScript::AST::ElementList *ElementList;
+      JavaScript::AST::Elision *Elision;
+      JavaScript::AST::ExpressionNode *Expression;
+      JavaScript::AST::Finally *Finally;
+      JavaScript::AST::FormalParameterList *FormalParameterList;
+      JavaScript::AST::FunctionBody *FunctionBody;
+      JavaScript::AST::FunctionDeclaration *FunctionDeclaration;
+      JavaScript::AST::Node *Node;
+      JavaScript::AST::PropertyName *PropertyName;
+      JavaScript::AST::PropertyNameAndValueList *PropertyNameAndValueList;
+      JavaScript::AST::SourceElement *SourceElement;
+      JavaScript::AST::SourceElements *SourceElements;
+      JavaScript::AST::Statement *Statement;
+      JavaScript::AST::StatementList *StatementList;
+      JavaScript::AST::VariableDeclaration *VariableDeclaration;
+      JavaScript::AST::VariableDeclarationList *VariableDeclarationList;
+    };
+
+    struct Location {
+      int startLine;
+      int startColumn;
+      int endLine;
+      int endColumn;
+    };
+
+public:
+    JavaScriptParser();
+    ~JavaScriptParser();
+
+    bool parse(JavaScriptEnginePrivate *driver);
+
+    inline QString errorMessage() const
+    { return error_message; }
+    inline int errorLineNumber() const
+    { return error_lineno; }
+    inline int errorColumnNumber() const
+    { return error_column; }
+
+protected:
+    inline void reallocateStack();
+
+    inline Value &sym(int index)
+    { return sym_stack [tos + index - 1]; }
+
+    inline Location &loc(int index)
+    { return location_stack [tos + index - 2]; }
+
+protected:
+    int tos;
+    int stack_size;
+    Value *sym_stack;
+    int *state_stack;
+    Location *location_stack;
+    QString error_message;
+    int error_lineno;
+    int error_column;
+};
+
+inline void JavaScriptParser::reallocateStack()
+{
+    if (! stack_size)
+        stack_size = 128;
+    else
+        stack_size <<= 1;
+
+    sym_stack = reinterpret_cast<Value*> (qRealloc(sym_stack, stack_size * sizeof(Value)));
+    state_stack = reinterpret_cast<int*> (qRealloc(state_stack, stack_size * sizeof(int)));
+    location_stack = reinterpret_cast<Location*> (qRealloc(location_stack, stack_size * sizeof(Location)));
+}
+
+
+#line 472 "./javascript.g"
+
+#define Q_JAVASCRIPT_REGEXPLITERAL_RULE1 7
+
+#line 490 "./javascript.g"
+
+#define Q_JAVASCRIPT_REGEXPLITERAL_RULE2 8
+
+#line 2117 "./javascript.g"
+
+QT_END_NAMESPACE
+
+#endif // QT_NO_JAVASCRIPT
+
+#endif // JAVAJAVASCRIPTPARSER_P_H
diff --git a/src/plugins/qtscripteditor/parser/javascriptvalue.h b/src/plugins/qtscripteditor/parser/javascriptvalue.h
new file mode 100644
index 0000000000000000000000000000000000000000..c68b817b9fc2d9eb305ba4741af744df0f2fd4a9
--- /dev/null
+++ b/src/plugins/qtscripteditor/parser/javascriptvalue.h
@@ -0,0 +1,6 @@
+#ifndef JAVASCRIPTVALUE_H
+#define JAVASCRIPTVALUE_H
+
+typedef double qjsreal;
+
+#endif // JAVASCRIPTVALUE_H
diff --git a/src/plugins/qtscripteditor/parser/parser.pri b/src/plugins/qtscripteditor/parser/parser.pri
new file mode 100644
index 0000000000000000000000000000000000000000..5c1bb19a7667475c0588c3df39d3994110ce442a
--- /dev/null
+++ b/src/plugins/qtscripteditor/parser/parser.pri
@@ -0,0 +1,19 @@
+
+HEADERS += $$PWD/javascriptast_p.h \
+           $$PWD/javascriptastfwd_p.h \
+           $$PWD/javascriptastvisitor_p.h \
+           $$PWD/javascriptengine_p.h \
+           $$PWD/javascriptgrammar_p.h \
+           $$PWD/javascriptlexer_p.h \
+           $$PWD/javascriptmemorypool_p.h \
+           $$PWD/javascriptnodepool_p.h \
+           $$PWD/javascriptparser_p.h \
+           $$PWD/javascriptvalue.h
+
+SOURCES += $$PWD/javascriptast.cpp \
+           $$PWD/javascriptastvisitor.cpp \
+           $$PWD/javascriptengine_p.cpp \
+           $$PWD/javascriptgrammar.cpp \
+           $$PWD/javascriptlexer.cpp \
+           $$PWD/javascriptparser.cpp
+
diff --git a/src/plugins/qtscripteditor/qtscripteditor.pro b/src/plugins/qtscripteditor/qtscripteditor.pro
index 18fd16a0e40c6e8879f92402dce499069405d3dd..7694856c4cb0e332b821beaa0acc9dab7c344593 100644
--- a/src/plugins/qtscripteditor/qtscripteditor.pro
+++ b/src/plugins/qtscripteditor/qtscripteditor.pro
@@ -7,6 +7,7 @@ include(../../plugins/coreplugin/coreplugin.pri)
 include(../../plugins/texteditor/texteditor.pri)
 include(../../shared/qscripthighlighter/qscripthighlighter.pri)
 include(../../shared/indenter/indenter.pri)
+include(parser/parser.pri)
 
 HEADERS += qtscripteditor.h \
 qtscripteditorfactory.h \