1 ----------------------------------------------------------------------------
3 -- Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
4 -- All rights reserved.
5 -- Contact: Nokia Corporation (qt-info@nokia.com)
7 -- This file is part of the QtScript module of the Qt Toolkit.
9 -- $QT_BEGIN_LICENSE:LGPL-ONLY$
10 -- GNU Lesser General Public License Usage
11 -- This file may be used under the terms of the GNU Lesser
12 -- General Public License version 2.1 as published by the Free Software
13 -- Foundation and appearing in the file LICENSE.LGPL included in the
14 -- packaging of this file. Please review the following information to
15 -- ensure the GNU Lesser General Public License version 2.1 requirements
16 -- will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
18 -- If you have questions regarding the use of this file, please contact
19 -- Nokia at qt-info@nokia.com.
22 ----------------------------------------------------------------------------
24 %parser QScriptGrammar
25 %decl qscriptparser_p.h
26 %impl qscriptparser.cpp
30 %token T_AND "&" T_AND_AND "&&" T_AND_EQ "&="
31 %token T_BREAK "break" T_CASE "case" T_CATCH "catch"
32 %token T_COLON ":" T_COMMA ";" T_CONTINUE "continue"
33 %token T_DEFAULT "default" T_DELETE "delete" T_DIVIDE_ "/"
34 %token T_DIVIDE_EQ "/=" T_DO "do" T_DOT "."
35 %token T_ELSE "else" T_EQ "=" T_EQ_EQ "=="
36 %token T_EQ_EQ_EQ "===" T_FINALLY "finally" T_FOR "for"
37 %token T_FUNCTION "function" T_GE ">=" T_GT ">"
38 %token T_GT_GT ">>" T_GT_GT_EQ ">>=" T_GT_GT_GT ">>>"
39 %token T_GT_GT_GT_EQ ">>>=" T_IDENTIFIER "identifier" T_IF "if"
40 %token T_IN "in" T_INSTANCEOF "instanceof" T_LBRACE "{"
41 %token T_LBRACKET "[" T_LE "<=" T_LPAREN "("
42 %token T_LT "<" T_LT_LT "<<" T_LT_LT_EQ "<<="
43 %token T_MINUS "-" T_MINUS_EQ "-=" T_MINUS_MINUS "--"
44 %token T_NEW "new" T_NOT "!" T_NOT_EQ "!="
45 %token T_NOT_EQ_EQ "!==" T_NUMERIC_LITERAL "numeric literal" T_OR "|"
46 %token T_OR_EQ "|=" T_OR_OR "||" T_PLUS "+"
47 %token T_PLUS_EQ "+=" T_PLUS_PLUS "++" T_QUESTION "?"
48 %token T_RBRACE "}" T_RBRACKET "]" T_REMAINDER "%"
49 %token T_REMAINDER_EQ "%=" T_RETURN "return" T_RPAREN ")"
50 %token T_SEMICOLON ";" T_AUTOMATIC_SEMICOLON T_STAR "*"
51 %token T_STAR_EQ "*=" T_STRING_LITERAL "string literal"
52 %token T_SWITCH "switch" T_THIS "this" T_THROW "throw"
53 %token T_TILDE "~" T_TRY "try" T_TYPEOF "typeof"
54 %token T_VAR "var" T_VOID "void" T_WHILE "while"
55 %token T_WITH "with" T_XOR "^" T_XOR_EQ "^="
56 %token T_NULL "null" T_TRUE "true" T_FALSE "false"
57 %token T_CONST "const"
58 %token T_DEBUGGER "debugger"
59 %token T_RESERVED_WORD "reserved word"
63 /./****************************************************************************
65 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
66 ** All rights reserved.
67 ** Contact: Nokia Corporation (qt-info@nokia.com)
69 ** This file is part of the QtScript module of the Qt Toolkit.
71 ** $QT_BEGIN_LICENSE:LGPL$
72 ** No Commercial Usage
73 ** This file contains pre-release code and may not be distributed.
74 ** You may use this file in accordance with the terms and conditions
75 ** contained in the Technology Preview License Agreement accompanying
78 ** GNU Lesser General Public License Usage
79 ** Alternatively, this file may be used under the terms of the GNU Lesser
80 ** General Public License version 2.1 as published by the Free Software
81 ** Foundation and appearing in the file LICENSE.LGPL included in the
82 ** packaging of this file. Please review the following information to
83 ** ensure the GNU Lesser General Public License version 2.1 requirements
84 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
86 ** In addition, as a special exception, Nokia gives you certain additional
87 ** rights. These rights are described in the Nokia Qt LGPL Exception
88 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
90 ** If you have questions regarding the use of this file, please contact
91 ** Nokia at qt-info@nokia.com.
102 ****************************************************************************/
104 // This file was generated by qlalr - DO NOT EDIT!
107 #include <QtCore/QtDebug>
111 #define Q_SCRIPT_UPDATE_POSITION(node, startloc, endloc) do { \
112 node->startLine = startloc.startLine; \
113 node->startColumn = startloc.startColumn; \
114 node->endLine = endloc.endLine; \
115 node->endColumn = endloc.endColumn; \
120 /:/****************************************************************************
122 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
123 ** All rights reserved.
124 ** Contact: Nokia Corporation (qt-info@nokia.com)
126 ** This file is part of the QtScript module of the Qt Toolkit.
128 ** $QT_BEGIN_LICENSE:LGPL$
129 ** No Commercial Usage
130 ** This file contains pre-release code and may not be distributed.
131 ** You may use this file in accordance with the terms and conditions
132 ** contained in the Technology Preview License Agreement accompanying
135 ** GNU Lesser General Public License Usage
136 ** Alternatively, this file may be used under the terms of the GNU Lesser
137 ** General Public License version 2.1 as published by the Free Software
138 ** Foundation and appearing in the file LICENSE.LGPL included in the
139 ** packaging of this file. Please review the following information to
140 ** ensure the GNU Lesser General Public License version 2.1 requirements
141 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
143 ** In addition, as a special exception, Nokia gives you certain additional
144 ** rights. These rights are described in the Nokia Qt LGPL Exception
145 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
147 ** If you have questions regarding the use of this file, please contact
148 ** Nokia at qt-info@nokia.com.
159 ****************************************************************************/
161 // This file was generated by qlalr - DO NOT EDIT!
168 // This file is not part of the Qt API. It exists purely as an
169 // implementation detail. This header file may change from version to
170 // version without notice, or even be removed.
176 // This file is automatically generated from qscript.g.
177 // Changes will be lost.
180 #ifndef QSCRIPTPARSER_P_H
181 #define QSCRIPTPARSER_P_H
183 #include "qscriptgrammar_p.h"
185 #include "qscriptastfwd_p.h"
190 class QScriptEnginePrivate;
191 class QScriptNameIdImpl;
193 class QScriptParser: protected $table
199 QScriptNameIdImpl *sval;
200 QScript::AST::ArgumentList *ArgumentList;
201 QScript::AST::CaseBlock *CaseBlock;
202 QScript::AST::CaseClause *CaseClause;
203 QScript::AST::CaseClauses *CaseClauses;
204 QScript::AST::Catch *Catch;
205 QScript::AST::DefaultClause *DefaultClause;
206 QScript::AST::ElementList *ElementList;
207 QScript::AST::Elision *Elision;
208 QScript::AST::ExpressionNode *Expression;
209 QScript::AST::Finally *Finally;
210 QScript::AST::FormalParameterList *FormalParameterList;
211 QScript::AST::FunctionBody *FunctionBody;
212 QScript::AST::FunctionDeclaration *FunctionDeclaration;
213 QScript::AST::Node *Node;
214 QScript::AST::PropertyName *PropertyName;
215 QScript::AST::PropertyNameAndValueList *PropertyNameAndValueList;
216 QScript::AST::SourceElement *SourceElement;
217 QScript::AST::SourceElements *SourceElements;
218 QScript::AST::Statement *Statement;
219 QScript::AST::StatementList *StatementList;
220 QScript::AST::VariableDeclaration *VariableDeclaration;
221 QScript::AST::VariableDeclarationList *VariableDeclarationList;
235 bool parse(QScriptEnginePrivate *driver);
237 inline QString errorMessage() const
238 { return error_message; }
239 inline int errorLineNumber() const
240 { return error_lineno; }
241 inline int errorColumnNumber() const
242 { return error_column; }
245 inline void reallocateStack();
247 inline Value &sym(int index)
248 { return sym_stack [tos + index - 1]; }
250 inline Location &loc(int index)
251 { return location_stack [tos + index - 2]; }
258 Location *location_stack;
259 QString error_message;
264 inline void QScriptParser::reallocateStack()
271 sym_stack = reinterpret_cast<Value*> (qRealloc(sym_stack, stack_size * sizeof(Value)));
272 state_stack = reinterpret_cast<int*> (qRealloc(state_stack, stack_size * sizeof(int)));
273 location_stack = reinterpret_cast<Location*> (qRealloc(location_stack, stack_size * sizeof(Location)));
281 #include "qscriptparser_p.h"
284 // This file is automatically generated from qscript.g.
285 // Changes will be lost.
290 inline static bool automatic(QScriptEnginePrivate *driver, int token)
292 return token == $table::T_RBRACE
294 || driver->lexer()->prevTerminator();
298 QScriptParser::QScriptParser():
307 QScriptParser::~QScriptParser()
312 qFree(location_stack);
316 static inline QScriptParser::Location location(QScript::Lexer *lexer)
318 QScriptParser::Location loc;
319 loc.startLine = lexer->startLineNo();
320 loc.startColumn = lexer->startColumnNo();
321 loc.endLine = lexer->endLineNo();
322 loc.endColumn = lexer->endColumnNo();
326 bool QScriptParser::parse(QScriptEnginePrivate *driver)
328 const int INITIAL_STATE = 0;
329 QScript::Lexer *lexer = driver->lexer();
332 int saved_yytoken = -1;
337 state_stack[++tos] = INITIAL_STATE;
341 const int state = state_stack [tos];
342 if (yytoken == -1 && - TERMINAL_COUNT != action_index [state])
344 if (saved_yytoken == -1)
346 yytoken = lexer->lex();
347 location_stack [tos] = location(lexer);
351 yytoken = saved_yytoken;
356 int act = t_action (state, yytoken);
358 if (act == ACCEPT_STATE)
363 if (++tos == stack_size)
366 sym_stack [tos].dval = lexer->dval ();
367 state_stack [tos] = act;
368 location_stack [tos] = location(lexer);
377 act = state_stack [tos++];
382 PrimaryExpression: T_THIS ;
385 sym(1).Node = QScript::makeAstNode<QScript::AST::ThisExpression> (driver->nodePool());
386 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
390 PrimaryExpression: T_IDENTIFIER ;
393 sym(1).Node = QScript::makeAstNode<QScript::AST::IdentifierExpression> (driver->nodePool(), sym(1).sval);
394 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
398 PrimaryExpression: T_NULL ;
401 sym(1).Node = QScript::makeAstNode<QScript::AST::NullExpression> (driver->nodePool());
402 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
406 PrimaryExpression: T_TRUE ;
409 sym(1).Node = QScript::makeAstNode<QScript::AST::TrueLiteral> (driver->nodePool());
410 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
414 PrimaryExpression: T_FALSE ;
417 sym(1).Node = QScript::makeAstNode<QScript::AST::FalseLiteral> (driver->nodePool());
418 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
422 PrimaryExpression: T_NUMERIC_LITERAL ;
425 sym(1).Node = QScript::makeAstNode<QScript::AST::NumericLiteral> (driver->nodePool(), sym(1).dval);
426 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
430 PrimaryExpression: T_STRING_LITERAL ;
433 sym(1).Node = QScript::makeAstNode<QScript::AST::StringLiteral> (driver->nodePool(), sym(1).sval);
434 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
438 PrimaryExpression: T_DIVIDE_ ;
440 #define Q_SCRIPT_REGEXPLITERAL_RULE1 $rule_number
444 bool rx = lexer->scanRegExp(QScript::Lexer::NoPrefix);
446 error_message = lexer->errorMessage();
447 error_lineno = lexer->startLineNo();
448 error_column = lexer->startColumnNo();
451 sym(1).Node = QScript::makeAstNode<QScript::AST::RegExpLiteral> (driver->nodePool(), lexer->pattern, lexer->flags);
452 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
456 PrimaryExpression: T_DIVIDE_EQ ;
458 #define Q_SCRIPT_REGEXPLITERAL_RULE2 $rule_number
462 bool rx = lexer->scanRegExp(QScript::Lexer::EqualPrefix);
464 error_message = lexer->errorMessage();
465 error_lineno = lexer->startLineNo();
466 error_column = lexer->startColumnNo();
469 sym(1).Node = QScript::makeAstNode<QScript::AST::RegExpLiteral> (driver->nodePool(), lexer->pattern, lexer->flags);
470 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
474 PrimaryExpression: T_LBRACKET ElisionOpt T_RBRACKET ;
477 sym(1).Node = QScript::makeAstNode<QScript::AST::ArrayLiteral> (driver->nodePool(), sym(2).Elision);
478 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
482 PrimaryExpression: T_LBRACKET ElementList T_RBRACKET ;
485 sym(1).Node = QScript::makeAstNode<QScript::AST::ArrayLiteral> (driver->nodePool(), sym(2).ElementList->finish ());
486 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
490 PrimaryExpression: T_LBRACKET ElementList T_COMMA ElisionOpt T_RBRACKET ;
493 sym(1).Node = QScript::makeAstNode<QScript::AST::ArrayLiteral> (driver->nodePool(), sym(2).ElementList->finish (), sym(4).Elision);
494 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(5));
498 -- PrimaryExpression: T_LBRACE T_RBRACE ;
500 -- case $rule_number: {
501 -- sym(1).Node = QScript::makeAstNode<QScript::AST::ObjectLiteral> (driver->nodePool());
502 -- Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
506 PrimaryExpression: T_LBRACE PropertyNameAndValueListOpt T_RBRACE ;
510 sym(1).Node = QScript::makeAstNode<QScript::AST::ObjectLiteral> (driver->nodePool(), sym(2).PropertyNameAndValueList->finish ());
512 sym(1).Node = QScript::makeAstNode<QScript::AST::ObjectLiteral> (driver->nodePool());
513 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
517 PrimaryExpression: T_LBRACE PropertyNameAndValueList T_COMMA T_RBRACE ;
520 sym(1).Node = QScript::makeAstNode<QScript::AST::ObjectLiteral> (driver->nodePool(), sym(2).PropertyNameAndValueList->finish ());
521 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(4));
525 PrimaryExpression: T_LPAREN Expression T_RPAREN ;
529 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
533 ElementList: ElisionOpt AssignmentExpression ;
536 sym(1).Node = QScript::makeAstNode<QScript::AST::ElementList> (driver->nodePool(), sym(1).Elision, sym(2).Expression);
537 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
541 ElementList: ElementList T_COMMA ElisionOpt AssignmentExpression ;
544 sym(1).Node = QScript::makeAstNode<QScript::AST::ElementList> (driver->nodePool(), sym(1).ElementList, sym(3).Elision, sym(4).Expression);
545 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(4));
552 sym(1).Node = QScript::makeAstNode<QScript::AST::Elision> (driver->nodePool());
553 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
557 Elision: Elision T_COMMA ;
560 sym(1).Node = QScript::makeAstNode<QScript::AST::Elision> (driver->nodePool(), sym(1).Elision);
561 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
572 ElisionOpt: Elision ;
575 sym(1).Elision = sym(1).Elision->finish ();
576 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
580 PropertyNameAndValueList: PropertyName T_COLON AssignmentExpression ;
583 sym(1).Node = QScript::makeAstNode<QScript::AST::PropertyNameAndValueList> (driver->nodePool(), sym(1).PropertyName, sym(3).Expression);
584 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
588 PropertyNameAndValueList: PropertyNameAndValueList T_COMMA PropertyName T_COLON AssignmentExpression ;
591 sym(1).Node = QScript::makeAstNode<QScript::AST::PropertyNameAndValueList> (driver->nodePool(), sym(1).PropertyNameAndValueList, sym(3).PropertyName, sym(5).Expression);
592 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(5));
596 PropertyName: T_IDENTIFIER ;
599 sym(1).Node = QScript::makeAstNode<QScript::AST::IdentifierPropertyName> (driver->nodePool(), sym(1).sval);
600 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
604 PropertyName: T_STRING_LITERAL ;
607 sym(1).Node = QScript::makeAstNode<QScript::AST::StringLiteralPropertyName> (driver->nodePool(), sym(1).sval);
608 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
612 PropertyName: T_NUMERIC_LITERAL ;
615 sym(1).Node = QScript::makeAstNode<QScript::AST::NumericLiteralPropertyName> (driver->nodePool(), sym(1).dval);
616 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
620 PropertyName: ReservedIdentifier ;
623 sym(1).Node = QScript::makeAstNode<QScript::AST::IdentifierPropertyName> (driver->nodePool(), sym(1).sval);
624 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
628 ReservedIdentifier: T_BREAK ;
632 ReservedIdentifier: T_CASE ;
636 ReservedIdentifier: T_CATCH ;
640 ReservedIdentifier: T_CONTINUE ;
644 ReservedIdentifier: T_DEFAULT ;
648 ReservedIdentifier: T_DELETE ;
652 ReservedIdentifier: T_DO ;
656 ReservedIdentifier: T_ELSE ;
660 ReservedIdentifier: T_FALSE ;
664 ReservedIdentifier: T_FINALLY ;
668 ReservedIdentifier: T_FOR ;
672 ReservedIdentifier: T_FUNCTION ;
676 ReservedIdentifier: T_IF ;
680 ReservedIdentifier: T_IN ;
684 ReservedIdentifier: T_INSTANCEOF ;
688 ReservedIdentifier: T_NEW ;
692 ReservedIdentifier: T_NULL ;
696 ReservedIdentifier: T_RETURN ;
700 ReservedIdentifier: T_SWITCH ;
704 ReservedIdentifier: T_THIS ;
708 ReservedIdentifier: T_THROW ;
712 ReservedIdentifier: T_TRUE ;
716 ReservedIdentifier: T_TRY ;
720 ReservedIdentifier: T_TYPEOF ;
724 ReservedIdentifier: T_VAR ;
728 ReservedIdentifier: T_VOID ;
732 ReservedIdentifier: T_WHILE ;
736 ReservedIdentifier: T_CONST ;
740 ReservedIdentifier: T_DEBUGGER ;
744 ReservedIdentifier: T_RESERVED_WORD ;
748 ReservedIdentifier: T_WITH ;
752 sym(1).sval = driver->intern(lexer->characterBuffer(), lexer->characterCount());
756 PropertyIdentifier: T_IDENTIFIER ;
757 PropertyIdentifier: ReservedIdentifier ;
759 MemberExpression: PrimaryExpression ;
760 MemberExpression: FunctionExpression ;
762 MemberExpression: MemberExpression T_LBRACKET Expression T_RBRACKET ;
765 sym(1).Node = QScript::makeAstNode<QScript::AST::ArrayMemberExpression> (driver->nodePool(), sym(1).Expression, sym(3).Expression);
766 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(4));
770 MemberExpression: MemberExpression T_DOT PropertyIdentifier ;
773 sym(1).Node = QScript::makeAstNode<QScript::AST::FieldMemberExpression> (driver->nodePool(), sym(1).Expression, sym(3).sval);
774 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(4));
778 MemberExpression: T_NEW MemberExpression Arguments ;
781 sym(1).Node = QScript::makeAstNode<QScript::AST::NewMemberExpression> (driver->nodePool(), sym(2).Expression, sym(3).ArgumentList);
782 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
786 NewExpression: MemberExpression ;
788 NewExpression: T_NEW NewExpression ;
791 sym(1).Node = QScript::makeAstNode<QScript::AST::NewExpression> (driver->nodePool(), sym(2).Expression);
792 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
796 CallExpression: MemberExpression Arguments ;
799 sym(1).Node = QScript::makeAstNode<QScript::AST::CallExpression> (driver->nodePool(), sym(1).Expression, sym(2).ArgumentList);
800 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
804 CallExpression: CallExpression Arguments ;
807 sym(1).Node = QScript::makeAstNode<QScript::AST::CallExpression> (driver->nodePool(), sym(1).Expression, sym(2).ArgumentList);
808 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
812 CallExpression: CallExpression T_LBRACKET Expression T_RBRACKET ;
815 sym(1).Node = QScript::makeAstNode<QScript::AST::ArrayMemberExpression> (driver->nodePool(), sym(1).Expression, sym(3).Expression);
816 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(4));
820 CallExpression: CallExpression T_DOT PropertyIdentifier ;
823 sym(1).Node = QScript::makeAstNode<QScript::AST::FieldMemberExpression> (driver->nodePool(), sym(1).Expression, sym(3).sval);
824 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
828 Arguments: T_LPAREN T_RPAREN ;
835 Arguments: T_LPAREN ArgumentList T_RPAREN ;
838 sym(1).Node = sym(2).ArgumentList->finish ();
839 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
843 ArgumentList: AssignmentExpression ;
846 sym(1).Node = QScript::makeAstNode<QScript::AST::ArgumentList> (driver->nodePool(), sym(1).Expression);
847 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
851 ArgumentList: ArgumentList T_COMMA AssignmentExpression ;
854 sym(1).Node = QScript::makeAstNode<QScript::AST::ArgumentList> (driver->nodePool(), sym(1).ArgumentList, sym(3).Expression);
855 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
859 LeftHandSideExpression: NewExpression ;
860 LeftHandSideExpression: CallExpression ;
861 PostfixExpression: LeftHandSideExpression ;
863 PostfixExpression: LeftHandSideExpression T_PLUS_PLUS ;
866 sym(1).Node = QScript::makeAstNode<QScript::AST::PostIncrementExpression> (driver->nodePool(), sym(1).Expression);
867 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
871 PostfixExpression: LeftHandSideExpression T_MINUS_MINUS ;
874 sym(1).Node = QScript::makeAstNode<QScript::AST::PostDecrementExpression> (driver->nodePool(), sym(1).Expression);
875 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
879 UnaryExpression: PostfixExpression ;
881 UnaryExpression: T_DELETE UnaryExpression ;
884 sym(1).Node = QScript::makeAstNode<QScript::AST::DeleteExpression> (driver->nodePool(), sym(2).Expression);
885 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
889 UnaryExpression: T_VOID UnaryExpression ;
892 sym(1).Node = QScript::makeAstNode<QScript::AST::VoidExpression> (driver->nodePool(), sym(2).Expression);
893 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
897 UnaryExpression: T_TYPEOF UnaryExpression ;
900 sym(1).Node = QScript::makeAstNode<QScript::AST::TypeOfExpression> (driver->nodePool(), sym(2).Expression);
901 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
905 UnaryExpression: T_PLUS_PLUS UnaryExpression ;
908 sym(1).Node = QScript::makeAstNode<QScript::AST::PreIncrementExpression> (driver->nodePool(), sym(2).Expression);
909 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
913 UnaryExpression: T_MINUS_MINUS UnaryExpression ;
916 sym(1).Node = QScript::makeAstNode<QScript::AST::PreDecrementExpression> (driver->nodePool(), sym(2).Expression);
917 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
921 UnaryExpression: T_PLUS UnaryExpression ;
924 sym(1).Node = QScript::makeAstNode<QScript::AST::UnaryPlusExpression> (driver->nodePool(), sym(2).Expression);
925 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
929 UnaryExpression: T_MINUS UnaryExpression ;
932 sym(1).Node = QScript::makeAstNode<QScript::AST::UnaryMinusExpression> (driver->nodePool(), sym(2).Expression);
933 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
937 UnaryExpression: T_TILDE UnaryExpression ;
940 sym(1).Node = QScript::makeAstNode<QScript::AST::TildeExpression> (driver->nodePool(), sym(2).Expression);
941 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
945 UnaryExpression: T_NOT UnaryExpression ;
948 sym(1).Node = QScript::makeAstNode<QScript::AST::NotExpression> (driver->nodePool(), sym(2).Expression);
949 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
953 MultiplicativeExpression: UnaryExpression ;
955 MultiplicativeExpression: MultiplicativeExpression T_STAR UnaryExpression ;
958 sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Mul, sym(3).Expression);
959 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
963 MultiplicativeExpression: MultiplicativeExpression T_DIVIDE_ UnaryExpression ;
966 sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Div, sym(3).Expression);
967 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
971 MultiplicativeExpression: MultiplicativeExpression T_REMAINDER UnaryExpression ;
974 sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Mod, sym(3).Expression);
975 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
979 AdditiveExpression: MultiplicativeExpression ;
981 AdditiveExpression: AdditiveExpression T_PLUS MultiplicativeExpression ;
984 sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Add, sym(3).Expression);
985 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
989 AdditiveExpression: AdditiveExpression T_MINUS MultiplicativeExpression ;
992 sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Sub, sym(3).Expression);
993 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
997 ShiftExpression: AdditiveExpression ;
999 ShiftExpression: ShiftExpression T_LT_LT AdditiveExpression ;
1001 case $rule_number: {
1002 sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::LShift, sym(3).Expression);
1003 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
1007 ShiftExpression: ShiftExpression T_GT_GT AdditiveExpression ;
1009 case $rule_number: {
1010 sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::RShift, sym(3).Expression);
1011 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
1015 ShiftExpression: ShiftExpression T_GT_GT_GT AdditiveExpression ;
1017 case $rule_number: {
1018 sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::URShift, sym(3).Expression);
1019 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
1023 RelationalExpression: ShiftExpression ;
1025 RelationalExpression: RelationalExpression T_LT ShiftExpression ;
1027 case $rule_number: {
1028 sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Lt, sym(3).Expression);
1029 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
1033 RelationalExpression: RelationalExpression T_GT ShiftExpression ;
1035 case $rule_number: {
1036 sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Gt, sym(3).Expression);
1037 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
1041 RelationalExpression: RelationalExpression T_LE ShiftExpression ;
1043 case $rule_number: {
1044 sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Le, sym(3).Expression);
1045 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
1049 RelationalExpression: RelationalExpression T_GE ShiftExpression ;
1051 case $rule_number: {
1052 sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Ge, sym(3).Expression);
1053 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
1057 RelationalExpression: RelationalExpression T_INSTANCEOF ShiftExpression ;
1059 case $rule_number: {
1060 sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::InstanceOf, sym(3).Expression);
1061 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
1065 RelationalExpression: RelationalExpression T_IN ShiftExpression ;
1067 case $rule_number: {
1068 sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::In, sym(3).Expression);
1069 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
1073 RelationalExpressionNotIn: ShiftExpression ;
1075 RelationalExpressionNotIn: RelationalExpressionNotIn T_LT ShiftExpression ;
1077 case $rule_number: {
1078 sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Lt, sym(3).Expression);
1079 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
1083 RelationalExpressionNotIn: RelationalExpressionNotIn T_GT ShiftExpression ;
1085 case $rule_number: {
1086 sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Gt, sym(3).Expression);
1087 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
1091 RelationalExpressionNotIn: RelationalExpressionNotIn T_LE ShiftExpression ;
1093 case $rule_number: {
1094 sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Le, sym(3).Expression);
1095 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
1099 RelationalExpressionNotIn: RelationalExpressionNotIn T_GE ShiftExpression ;
1101 case $rule_number: {
1102 sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Ge, sym(3).Expression);
1103 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
1107 RelationalExpressionNotIn: RelationalExpressionNotIn T_INSTANCEOF ShiftExpression ;
1109 case $rule_number: {
1110 sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::InstanceOf, sym(3).Expression);
1111 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
1115 EqualityExpression: RelationalExpression ;
1117 EqualityExpression: EqualityExpression T_EQ_EQ RelationalExpression ;
1119 case $rule_number: {
1120 sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Equal, sym(3).Expression);
1121 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
1125 EqualityExpression: EqualityExpression T_NOT_EQ RelationalExpression ;
1127 case $rule_number: {
1128 sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::NotEqual, sym(3).Expression);
1129 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
1133 EqualityExpression: EqualityExpression T_EQ_EQ_EQ RelationalExpression ;
1135 case $rule_number: {
1136 sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::StrictEqual, sym(3).Expression);
1137 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
1141 EqualityExpression: EqualityExpression T_NOT_EQ_EQ RelationalExpression ;
1143 case $rule_number: {
1144 sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::StrictNotEqual, sym(3).Expression);
1145 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
1149 EqualityExpressionNotIn: RelationalExpressionNotIn ;
1151 EqualityExpressionNotIn: EqualityExpressionNotIn T_EQ_EQ RelationalExpressionNotIn ;
1153 case $rule_number: {
1154 sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Equal, sym(3).Expression);
1155 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
1159 EqualityExpressionNotIn: EqualityExpressionNotIn T_NOT_EQ RelationalExpressionNotIn;
1161 case $rule_number: {
1162 sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::NotEqual, sym(3).Expression);
1163 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
1167 EqualityExpressionNotIn: EqualityExpressionNotIn T_EQ_EQ_EQ RelationalExpressionNotIn ;
1169 case $rule_number: {
1170 sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::StrictEqual, sym(3).Expression);
1171 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
1175 EqualityExpressionNotIn: EqualityExpressionNotIn T_NOT_EQ_EQ RelationalExpressionNotIn ;
1177 case $rule_number: {
1178 sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::StrictNotEqual, sym(3).Expression);
1179 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
1183 BitwiseANDExpression: EqualityExpression ;
1185 BitwiseANDExpression: BitwiseANDExpression T_AND EqualityExpression ;
1187 case $rule_number: {
1188 sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::BitAnd, sym(3).Expression);
1189 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
1193 BitwiseANDExpressionNotIn: EqualityExpressionNotIn ;
1195 BitwiseANDExpressionNotIn: BitwiseANDExpressionNotIn T_AND EqualityExpressionNotIn ;
1197 case $rule_number: {
1198 sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::BitAnd, sym(3).Expression);
1199 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
1203 BitwiseXORExpression: BitwiseANDExpression ;
1205 BitwiseXORExpression: BitwiseXORExpression T_XOR BitwiseANDExpression ;
1207 case $rule_number: {
1208 sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::BitXor, sym(3).Expression);
1209 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
1213 BitwiseXORExpressionNotIn: BitwiseANDExpressionNotIn ;
1215 BitwiseXORExpressionNotIn: BitwiseXORExpressionNotIn T_XOR BitwiseANDExpressionNotIn ;
1217 case $rule_number: {
1218 sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::BitXor, sym(3).Expression);
1219 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
1223 BitwiseORExpression: BitwiseXORExpression ;
1225 BitwiseORExpression: BitwiseORExpression T_OR BitwiseXORExpression ;
1227 case $rule_number: {
1228 sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::BitOr, sym(3).Expression);
1229 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
1233 BitwiseORExpressionNotIn: BitwiseXORExpressionNotIn ;
1235 BitwiseORExpressionNotIn: BitwiseORExpressionNotIn T_OR BitwiseXORExpressionNotIn ;
1237 case $rule_number: {
1238 sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::BitOr, sym(3).Expression);
1239 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
1243 LogicalANDExpression: BitwiseORExpression ;
1245 LogicalANDExpression: LogicalANDExpression T_AND_AND BitwiseORExpression ;
1247 case $rule_number: {
1248 sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::And, sym(3).Expression);
1249 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
1253 LogicalANDExpressionNotIn: BitwiseORExpressionNotIn ;
1255 LogicalANDExpressionNotIn: LogicalANDExpressionNotIn T_AND_AND BitwiseORExpressionNotIn ;
1257 case $rule_number: {
1258 sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::And, sym(3).Expression);
1259 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
1263 LogicalORExpression: LogicalANDExpression ;
1265 LogicalORExpression: LogicalORExpression T_OR_OR LogicalANDExpression ;
1267 case $rule_number: {
1268 sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Or, sym(3).Expression);
1269 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
1273 LogicalORExpressionNotIn: LogicalANDExpressionNotIn ;
1275 LogicalORExpressionNotIn: LogicalORExpressionNotIn T_OR_OR LogicalANDExpressionNotIn ;
1277 case $rule_number: {
1278 sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Or, sym(3).Expression);
1279 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
1283 ConditionalExpression: LogicalORExpression ;
1285 ConditionalExpression: LogicalORExpression T_QUESTION AssignmentExpression T_COLON AssignmentExpression ;
1287 case $rule_number: {
1288 sym(1).Node = QScript::makeAstNode<QScript::AST::ConditionalExpression> (driver->nodePool(), sym(1).Expression, sym(3).Expression, sym(5).Expression);
1289 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
1293 ConditionalExpressionNotIn: LogicalORExpressionNotIn ;
1295 ConditionalExpressionNotIn: LogicalORExpressionNotIn T_QUESTION AssignmentExpressionNotIn T_COLON AssignmentExpressionNotIn ;
1297 case $rule_number: {
1298 sym(1).Node = QScript::makeAstNode<QScript::AST::ConditionalExpression> (driver->nodePool(), sym(1).Expression, sym(3).Expression, sym(5).Expression);
1299 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
1303 AssignmentExpression: ConditionalExpression ;
1305 AssignmentExpression: LeftHandSideExpression AssignmentOperator AssignmentExpression ;
1307 case $rule_number: {
1308 sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, sym(2).ival, sym(3).Expression);
1309 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
1313 AssignmentExpressionNotIn: ConditionalExpressionNotIn ;
1315 AssignmentExpressionNotIn: LeftHandSideExpression AssignmentOperator AssignmentExpressionNotIn ;
1317 case $rule_number: {
1318 sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, sym(2).ival, sym(3).Expression);
1319 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
1323 AssignmentOperator: T_EQ ;
1325 case $rule_number: {
1326 sym(1).ival = QSOperator::Assign;
1330 AssignmentOperator: T_STAR_EQ ;
1332 case $rule_number: {
1333 sym(1).ival = QSOperator::InplaceMul;
1337 AssignmentOperator: T_DIVIDE_EQ ;
1339 case $rule_number: {
1340 sym(1).ival = QSOperator::InplaceDiv;
1344 AssignmentOperator: T_REMAINDER_EQ ;
1346 case $rule_number: {
1347 sym(1).ival = QSOperator::InplaceMod;
1351 AssignmentOperator: T_PLUS_EQ ;
1353 case $rule_number: {
1354 sym(1).ival = QSOperator::InplaceAdd;
1358 AssignmentOperator: T_MINUS_EQ ;
1360 case $rule_number: {
1361 sym(1).ival = QSOperator::InplaceSub;
1365 AssignmentOperator: T_LT_LT_EQ ;
1367 case $rule_number: {
1368 sym(1).ival = QSOperator::InplaceLeftShift;
1372 AssignmentOperator: T_GT_GT_EQ ;
1374 case $rule_number: {
1375 sym(1).ival = QSOperator::InplaceRightShift;
1379 AssignmentOperator: T_GT_GT_GT_EQ ;
1381 case $rule_number: {
1382 sym(1).ival = QSOperator::InplaceURightShift;
1386 AssignmentOperator: T_AND_EQ ;
1388 case $rule_number: {
1389 sym(1).ival = QSOperator::InplaceAnd;
1393 AssignmentOperator: T_XOR_EQ ;
1395 case $rule_number: {
1396 sym(1).ival = QSOperator::InplaceXor;
1400 AssignmentOperator: T_OR_EQ ;
1402 case $rule_number: {
1403 sym(1).ival = QSOperator::InplaceOr;
1407 Expression: AssignmentExpression ;
1409 Expression: Expression T_COMMA AssignmentExpression ;
1411 case $rule_number: {
1412 sym(1).Node = QScript::makeAstNode<QScript::AST::Expression> (driver->nodePool(), sym(1).Expression, sym(3).Expression);
1413 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
1419 case $rule_number: {
1424 ExpressionOpt: Expression ;
1426 ExpressionNotIn: AssignmentExpressionNotIn ;
1428 ExpressionNotIn: ExpressionNotIn T_COMMA AssignmentExpressionNotIn ;
1430 case $rule_number: {
1431 sym(1).Node = QScript::makeAstNode<QScript::AST::Expression> (driver->nodePool(), sym(1).Expression, sym(3).Expression);
1432 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
1436 ExpressionNotInOpt: ;
1438 case $rule_number: {
1443 ExpressionNotInOpt: ExpressionNotIn ;
1446 Statement: VariableStatement ;
1447 Statement: EmptyStatement ;
1448 Statement: ExpressionStatement ;
1449 Statement: IfStatement ;
1450 Statement: IterationStatement ;
1451 Statement: ContinueStatement ;
1452 Statement: BreakStatement ;
1453 Statement: ReturnStatement ;
1454 Statement: WithStatement ;
1455 Statement: LabelledStatement ;
1456 Statement: SwitchStatement ;
1457 Statement: ThrowStatement ;
1458 Statement: TryStatement ;
1459 Statement: DebuggerStatement ;
1462 Block: T_LBRACE StatementListOpt T_RBRACE ;
1464 case $rule_number: {
1465 sym(1).Node = QScript::makeAstNode<QScript::AST::Block> (driver->nodePool(), sym(2).StatementList);
1466 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
1470 StatementList: Statement ;
1472 case $rule_number: {
1473 sym(1).Node = QScript::makeAstNode<QScript::AST::StatementList> (driver->nodePool(), sym(1).Statement);
1474 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
1478 StatementList: StatementList Statement ;
1480 case $rule_number: {
1481 sym(1).Node = QScript::makeAstNode<QScript::AST::StatementList> (driver->nodePool(), sym(1).StatementList, sym(2).Statement);
1482 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
1488 case $rule_number: {
1493 StatementListOpt: StatementList ;
1495 case $rule_number: {
1496 sym(1).Node = sym(1).StatementList->finish ();
1500 VariableStatement: VariableDeclarationKind VariableDeclarationList T_AUTOMATIC_SEMICOLON ; -- automatic semicolon
1501 VariableStatement: VariableDeclarationKind VariableDeclarationList T_SEMICOLON ;
1503 case $rule_number: {
1504 sym(1).Node = QScript::makeAstNode<QScript::AST::VariableStatement> (driver->nodePool(), sym(2).VariableDeclarationList->finish (/*readOnly=*/sym(1).ival == T_CONST));
1505 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
1509 VariableDeclarationKind: T_CONST ;
1511 case $rule_number: {
1512 sym(1).ival = T_CONST;
1516 VariableDeclarationKind: T_VAR ;
1518 case $rule_number: {
1519 sym(1).ival = T_VAR;
1523 VariableDeclarationList: VariableDeclaration ;
1525 case $rule_number: {
1526 sym(1).Node = QScript::makeAstNode<QScript::AST::VariableDeclarationList> (driver->nodePool(), sym(1).VariableDeclaration);
1527 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
1531 VariableDeclarationList: VariableDeclarationList T_COMMA VariableDeclaration ;
1533 case $rule_number: {
1534 sym(1).Node = QScript::makeAstNode<QScript::AST::VariableDeclarationList> (driver->nodePool(), sym(1).VariableDeclarationList, sym(3).VariableDeclaration);
1535 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
1539 VariableDeclarationListNotIn: VariableDeclarationNotIn ;
1541 case $rule_number: {
1542 sym(1).Node = QScript::makeAstNode<QScript::AST::VariableDeclarationList> (driver->nodePool(), sym(1).VariableDeclaration);
1543 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
1547 VariableDeclarationListNotIn: VariableDeclarationListNotIn T_COMMA VariableDeclarationNotIn ;
1549 case $rule_number: {
1550 sym(1).Node = QScript::makeAstNode<QScript::AST::VariableDeclarationList> (driver->nodePool(), sym(1).VariableDeclarationList, sym(3).VariableDeclaration);
1551 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
1555 VariableDeclaration: T_IDENTIFIER InitialiserOpt ;
1557 case $rule_number: {
1558 sym(1).Node = QScript::makeAstNode<QScript::AST::VariableDeclaration> (driver->nodePool(), sym(1).sval, sym(2).Expression);
1559 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
1563 VariableDeclarationNotIn: T_IDENTIFIER InitialiserNotInOpt ;
1565 case $rule_number: {
1566 sym(1).Node = QScript::makeAstNode<QScript::AST::VariableDeclaration> (driver->nodePool(), sym(1).sval, sym(2).Expression);
1567 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
1571 Initialiser: T_EQ AssignmentExpression ;
1573 case $rule_number: {
1575 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
1581 case $rule_number: {
1586 InitialiserOpt: Initialiser ;
1588 InitialiserNotIn: T_EQ AssignmentExpressionNotIn ;
1590 case $rule_number: {
1592 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
1596 InitialiserNotInOpt: ;
1598 case $rule_number: {
1603 InitialiserNotInOpt: InitialiserNotIn ;
1605 EmptyStatement: T_SEMICOLON ;
1607 case $rule_number: {
1608 sym(1).Node = QScript::makeAstNode<QScript::AST::EmptyStatement> (driver->nodePool());
1609 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
1613 ExpressionStatement: Expression T_AUTOMATIC_SEMICOLON ; -- automatic semicolon
1614 ExpressionStatement: Expression T_SEMICOLON ;
1616 case $rule_number: {
1617 sym(1).Node = QScript::makeAstNode<QScript::AST::ExpressionStatement> (driver->nodePool(), sym(1).Expression);
1618 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
1622 IfStatement: T_IF T_LPAREN Expression T_RPAREN Statement T_ELSE Statement ;
1624 case $rule_number: {
1625 sym(1).Node = QScript::makeAstNode<QScript::AST::IfStatement> (driver->nodePool(), sym(3).Expression, sym(5).Statement, sym(7).Statement);
1626 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(7));
1630 IfStatement: T_IF T_LPAREN Expression T_RPAREN Statement ;
1632 case $rule_number: {
1633 sym(1).Node = QScript::makeAstNode<QScript::AST::IfStatement> (driver->nodePool(), sym(3).Expression, sym(5).Statement);
1634 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(5));
1639 IterationStatement: T_DO Statement T_WHILE T_LPAREN Expression T_RPAREN T_AUTOMATIC_SEMICOLON ; -- automatic semicolon
1640 IterationStatement: T_DO Statement T_WHILE T_LPAREN Expression T_RPAREN T_SEMICOLON ;
1642 case $rule_number: {
1643 sym(1).Node = QScript::makeAstNode<QScript::AST::DoWhileStatement> (driver->nodePool(), sym(2).Statement, sym(5).Expression);
1644 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(7));
1648 IterationStatement: T_WHILE T_LPAREN Expression T_RPAREN Statement ;
1650 case $rule_number: {
1651 sym(1).Node = QScript::makeAstNode<QScript::AST::WhileStatement> (driver->nodePool(), sym(3).Expression, sym(5).Statement);
1652 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(5));
1656 IterationStatement: T_FOR T_LPAREN ExpressionNotInOpt T_SEMICOLON ExpressionOpt T_SEMICOLON ExpressionOpt T_RPAREN Statement ;
1658 case $rule_number: {
1659 sym(1).Node = QScript::makeAstNode<QScript::AST::ForStatement> (driver->nodePool(), sym(3).Expression, sym(5).Expression, sym(7).Expression, sym(9).Statement);
1660 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(9));
1664 IterationStatement: T_FOR T_LPAREN T_VAR VariableDeclarationListNotIn T_SEMICOLON ExpressionOpt T_SEMICOLON ExpressionOpt T_RPAREN Statement ;
1666 case $rule_number: {
1667 sym(1).Node = QScript::makeAstNode<QScript::AST::LocalForStatement> (driver->nodePool(), sym(4).VariableDeclarationList->finish (/*readOnly=*/false), sym(6).Expression, sym(8).Expression, sym(10).Statement);
1668 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(10));
1672 IterationStatement: T_FOR T_LPAREN LeftHandSideExpression T_IN Expression T_RPAREN Statement ;
1674 case $rule_number: {
1675 sym(1).Node = QScript::makeAstNode<QScript::AST::ForEachStatement> (driver->nodePool(), sym(3).Expression, sym(5).Expression, sym(7).Statement);
1676 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(7));
1680 IterationStatement: T_FOR T_LPAREN T_VAR VariableDeclarationNotIn T_IN Expression T_RPAREN Statement ;
1682 case $rule_number: {
1683 sym(1).Node = QScript::makeAstNode<QScript::AST::LocalForEachStatement> (driver->nodePool(), sym(4).VariableDeclaration, sym(6).Expression, sym(8).Statement);
1684 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(8));
1688 ContinueStatement: T_CONTINUE T_AUTOMATIC_SEMICOLON ; -- automatic semicolon
1689 ContinueStatement: T_CONTINUE T_SEMICOLON ;
1691 case $rule_number: {
1692 sym(1).Node = QScript::makeAstNode<QScript::AST::ContinueStatement> (driver->nodePool());
1693 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
1697 ContinueStatement: T_CONTINUE T_IDENTIFIER T_AUTOMATIC_SEMICOLON ; -- automatic semicolon
1698 ContinueStatement: T_CONTINUE T_IDENTIFIER T_SEMICOLON ;
1700 case $rule_number: {
1701 sym(1).Node = QScript::makeAstNode<QScript::AST::ContinueStatement> (driver->nodePool(), sym(2).sval);
1702 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
1706 BreakStatement: T_BREAK T_AUTOMATIC_SEMICOLON ; -- automatic semicolon
1707 BreakStatement: T_BREAK T_SEMICOLON ;
1709 case $rule_number: {
1710 sym(1).Node = QScript::makeAstNode<QScript::AST::BreakStatement> (driver->nodePool());
1711 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
1715 BreakStatement: T_BREAK T_IDENTIFIER T_AUTOMATIC_SEMICOLON ; -- automatic semicolon
1716 BreakStatement: T_BREAK T_IDENTIFIER T_SEMICOLON ;
1718 case $rule_number: {
1719 sym(1).Node = QScript::makeAstNode<QScript::AST::BreakStatement> (driver->nodePool(), sym(2).sval);
1720 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
1724 ReturnStatement: T_RETURN ExpressionOpt T_AUTOMATIC_SEMICOLON ; -- automatic semicolon
1725 ReturnStatement: T_RETURN ExpressionOpt T_SEMICOLON ;
1727 case $rule_number: {
1728 sym(1).Node = QScript::makeAstNode<QScript::AST::ReturnStatement> (driver->nodePool(), sym(2).Expression);
1729 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
1733 WithStatement: T_WITH T_LPAREN Expression T_RPAREN Statement ;
1735 case $rule_number: {
1736 sym(1).Node = QScript::makeAstNode<QScript::AST::WithStatement> (driver->nodePool(), sym(3).Expression, sym(5).Statement);
1737 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(5));
1741 SwitchStatement: T_SWITCH T_LPAREN Expression T_RPAREN CaseBlock ;
1743 case $rule_number: {
1744 sym(1).Node = QScript::makeAstNode<QScript::AST::SwitchStatement> (driver->nodePool(), sym(3).Expression, sym(5).CaseBlock);
1745 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(5));
1749 CaseBlock: T_LBRACE CaseClausesOpt T_RBRACE ;
1751 case $rule_number: {
1752 sym(1).Node = QScript::makeAstNode<QScript::AST::CaseBlock> (driver->nodePool(), sym(2).CaseClauses);
1753 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
1757 CaseBlock: T_LBRACE CaseClausesOpt DefaultClause CaseClausesOpt T_RBRACE ;
1759 case $rule_number: {
1760 sym(1).Node = QScript::makeAstNode<QScript::AST::CaseBlock> (driver->nodePool(), sym(2).CaseClauses, sym(3).DefaultClause, sym(4).CaseClauses);
1761 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(5));
1765 CaseClauses: CaseClause ;
1767 case $rule_number: {
1768 sym(1).Node = QScript::makeAstNode<QScript::AST::CaseClauses> (driver->nodePool(), sym(1).CaseClause);
1769 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
1773 CaseClauses: CaseClauses CaseClause ;
1775 case $rule_number: {
1776 sym(1).Node = QScript::makeAstNode<QScript::AST::CaseClauses> (driver->nodePool(), sym(1).CaseClauses, sym(2).CaseClause);
1777 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
1783 case $rule_number: {
1788 CaseClausesOpt: CaseClauses ;
1790 case $rule_number: {
1791 sym(1).Node = sym(1).CaseClauses->finish ();
1792 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
1796 CaseClause: T_CASE Expression T_COLON StatementListOpt ;
1798 case $rule_number: {
1799 sym(1).Node = QScript::makeAstNode<QScript::AST::CaseClause> (driver->nodePool(), sym(2).Expression, sym(4).StatementList);
1800 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(4));
1804 DefaultClause: T_DEFAULT T_COLON StatementListOpt ;
1806 case $rule_number: {
1807 sym(1).Node = QScript::makeAstNode<QScript::AST::DefaultClause> (driver->nodePool(), sym(3).StatementList);
1808 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
1812 LabelledStatement: T_IDENTIFIER T_COLON Statement ;
1814 case $rule_number: {
1815 sym(1).Node = QScript::makeAstNode<QScript::AST::LabelledStatement> (driver->nodePool(), sym(1).sval, sym(3).Statement);
1816 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
1820 ThrowStatement: T_THROW Expression T_AUTOMATIC_SEMICOLON ; -- automatic semicolon
1821 ThrowStatement: T_THROW Expression T_SEMICOLON ;
1823 case $rule_number: {
1824 sym(1).Node = QScript::makeAstNode<QScript::AST::ThrowStatement> (driver->nodePool(), sym(2).Expression);
1825 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
1829 TryStatement: T_TRY Block Catch ;
1831 case $rule_number: {
1832 sym(1).Node = QScript::makeAstNode<QScript::AST::TryStatement> (driver->nodePool(), sym(2).Statement, sym(3).Catch);
1833 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
1837 TryStatement: T_TRY Block Finally ;
1839 case $rule_number: {
1840 sym(1).Node = QScript::makeAstNode<QScript::AST::TryStatement> (driver->nodePool(), sym(2).Statement, sym(3).Finally);
1841 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
1845 TryStatement: T_TRY Block Catch Finally ;
1847 case $rule_number: {
1848 sym(1).Node = QScript::makeAstNode<QScript::AST::TryStatement> (driver->nodePool(), sym(2).Statement, sym(3).Catch, sym(4).Finally);
1849 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(4));
1853 Catch: T_CATCH T_LPAREN T_IDENTIFIER T_RPAREN Block ;
1855 case $rule_number: {
1856 sym(1).Node = QScript::makeAstNode<QScript::AST::Catch> (driver->nodePool(), sym(3).sval, sym(5).Statement);
1857 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(5));
1861 Finally: T_FINALLY Block ;
1863 case $rule_number: {
1864 sym(1).Node = QScript::makeAstNode<QScript::AST::Finally> (driver->nodePool(), sym(2).Statement);
1865 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
1869 DebuggerStatement: T_DEBUGGER T_AUTOMATIC_SEMICOLON ; -- automatic semicolon
1870 DebuggerStatement: T_DEBUGGER T_SEMICOLON ;
1872 case $rule_number: {
1873 sym(1).Node = QScript::makeAstNode<QScript::AST::DebuggerStatement> (driver->nodePool());
1874 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
1878 FunctionDeclaration: T_FUNCTION T_IDENTIFIER T_LPAREN FormalParameterListOpt T_RPAREN T_LBRACE FunctionBodyOpt T_RBRACE ;
1880 case $rule_number: {
1881 sym(1).Node = QScript::makeAstNode<QScript::AST::FunctionDeclaration> (driver->nodePool(), sym(2).sval, sym(4).FormalParameterList, sym(7).FunctionBody);
1882 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(8));
1886 FunctionExpression: T_FUNCTION IdentifierOpt T_LPAREN FormalParameterListOpt T_RPAREN T_LBRACE FunctionBodyOpt T_RBRACE ;
1888 case $rule_number: {
1889 sym(1).Node = QScript::makeAstNode<QScript::AST::FunctionExpression> (driver->nodePool(), sym(2).sval, sym(4).FormalParameterList, sym(7).FunctionBody);
1890 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(8));
1894 FormalParameterList: T_IDENTIFIER ;
1896 case $rule_number: {
1897 sym(1).Node = QScript::makeAstNode<QScript::AST::FormalParameterList> (driver->nodePool(), sym(1).sval);
1898 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
1902 FormalParameterList: FormalParameterList T_COMMA T_IDENTIFIER ;
1904 case $rule_number: {
1905 sym(1).Node = QScript::makeAstNode<QScript::AST::FormalParameterList> (driver->nodePool(), sym(1).FormalParameterList, sym(3).sval);
1906 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
1910 FormalParameterListOpt: ;
1912 case $rule_number: {
1917 FormalParameterListOpt: FormalParameterList ;
1919 case $rule_number: {
1920 sym(1).Node = sym(1).FormalParameterList->finish ();
1921 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
1927 case $rule_number: {
1932 FunctionBodyOpt: FunctionBody ;
1934 FunctionBody: SourceElements ;
1936 case $rule_number: {
1937 sym(1).Node = QScript::makeAstNode<QScript::AST::FunctionBody> (driver->nodePool(), sym(1).SourceElements->finish ());
1938 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
1942 Program: SourceElements ;
1944 case $rule_number: {
1945 sym(1).Node = QScript::makeAstNode<QScript::AST::Program> (driver->nodePool(), sym(1).SourceElements->finish ());
1946 driver->changeAbstractSyntaxTree(sym(1).Node);
1947 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
1951 SourceElements: SourceElement ;
1953 case $rule_number: {
1954 sym(1).Node = QScript::makeAstNode<QScript::AST::SourceElements> (driver->nodePool(), sym(1).SourceElement);
1955 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
1959 SourceElements: SourceElements SourceElement ;
1961 case $rule_number: {
1962 sym(1).Node = QScript::makeAstNode<QScript::AST::SourceElements> (driver->nodePool(), sym(1).SourceElements, sym(2).SourceElement);
1963 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
1967 SourceElement: Statement ;
1969 case $rule_number: {
1970 sym(1).Node = QScript::makeAstNode<QScript::AST::StatementSourceElement> (driver->nodePool(), sym(1).Statement);
1971 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
1975 SourceElement: FunctionDeclaration ;
1977 case $rule_number: {
1978 sym(1).Node = QScript::makeAstNode<QScript::AST::FunctionSourceElement> (driver->nodePool(), sym(1).FunctionDeclaration);
1979 Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
1985 case $rule_number: {
1990 IdentifierOpt: T_IDENTIFIER ;
1992 PropertyNameAndValueListOpt: ;
1994 case $rule_number: {
1999 PropertyNameAndValueListOpt: PropertyNameAndValueList ;
2004 state_stack [tos] = nt_action (act, lhs [r] - TERMINAL_COUNT);
2007 location_stack[tos - 1].endLine = location_stack[tos + rhs[r] - 2].endLine;
2008 location_stack[tos - 1].endColumn = location_stack[tos + rhs[r] - 2].endColumn;
2009 location_stack[tos] = location_stack[tos + rhs[r] - 1];
2015 if (saved_yytoken == -1 && automatic (driver, yytoken) && t_action (state, T_AUTOMATIC_SEMICOLON) > 0)
2017 saved_yytoken = yytoken;
2018 yytoken = T_SEMICOLON;
2022 else if ((state == INITIAL_STATE) && (yytoken == 0)) {
2023 // accept empty input
2024 yytoken = T_SEMICOLON;
2031 int expected_tokens [3];
2032 for (int tk = 0; tk < TERMINAL_COUNT; ++tk)
2034 int k = t_action (ers, tk);
2040 else if (spell [tk])
2043 expected_tokens [shifts] = tk;
2048 error_message.clear ();
2049 if (shifts && shifts < 3)
2053 for (int s = 0; s < shifts; ++s)
2056 error_message += QLatin1String ("Expected ");
2058 error_message += QLatin1String (", ");
2061 error_message += QLatin1String("`");
2062 error_message += QLatin1String (spell [expected_tokens [s]]);
2063 error_message += QLatin1String("'");
2067 if (error_message.isEmpty())
2068 error_message = lexer->errorMessage();
2070 error_lineno = lexer->startLineNo();
2071 error_column = lexer->startColumnNo();
2085 #endif // QSCRIPTPARSER_P_H