author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Fri, 19 Feb 2010 23:40:16 +0200 | |
branch | RCL_3 |
changeset 4 | 3b1da2848fc7 |
parent 3 | 41300fa6a67c |
permissions | -rw-r--r-- |
0 | 1 |
---------------------------------------------------------------------------- |
2 |
-- |
|
4
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
3 |
-- Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
0 | 4 |
-- All rights reserved. |
5 |
-- Contact: Nokia Corporation (qt-info@nokia.com) |
|
6 |
-- |
|
7 |
-- This file is part of the QtScript module of the Qt Toolkit. |
|
8 |
-- |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
9 |
-- $QT_BEGIN_LICENSE:LGPL-ONLY$ |
0 | 10 |
-- GNU Lesser General Public License Usage |
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
11 |
-- This file may be used under the terms of the GNU Lesser |
0 | 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. |
|
17 |
-- |
|
18 |
-- If you have questions regarding the use of this file, please contact |
|
19 |
-- Nokia at qt-info@nokia.com. |
|
20 |
-- $QT_END_LICENSE$ |
|
21 |
-- |
|
22 |
---------------------------------------------------------------------------- |
|
23 |
||
24 |
%parser QScriptGrammar |
|
25 |
%decl qscriptparser_p.h |
|
26 |
%impl qscriptparser.cpp |
|
27 |
%expect 3 |
|
28 |
%expect-rr 1 |
|
29 |
||
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" |
|
60 |
||
61 |
%start Program |
|
62 |
||
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
63 |
/./**************************************************************************** |
0 | 64 |
** |
4
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
65 |
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
0 | 66 |
** All rights reserved. |
67 |
** Contact: Nokia Corporation (qt-info@nokia.com) |
|
68 |
** |
|
69 |
** This file is part of the QtScript module of the Qt Toolkit. |
|
70 |
** |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
71 |
** $QT_BEGIN_LICENSE:LGPL$ |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
72 |
** No Commercial Usage |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
73 |
** This file contains pre-release code and may not be distributed. |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
74 |
** You may use this file in accordance with the terms and conditions |
0 | 75 |
** contained in the Technology Preview License Agreement accompanying |
76 |
** this package. |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
77 |
** |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
78 |
** GNU Lesser General Public License Usage |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
79 |
** Alternatively, this file may be used under the terms of the GNU Lesser |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
80 |
** General Public License version 2.1 as published by the Free Software |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
81 |
** Foundation and appearing in the file LICENSE.LGPL included in the |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
82 |
** packaging of this file. Please review the following information to |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
83 |
** ensure the GNU Lesser General Public License version 2.1 requirements |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
84 |
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
85 |
** |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
86 |
** In addition, as a special exception, Nokia gives you certain additional |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
87 |
** rights. These rights are described in the Nokia Qt LGPL Exception |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
88 |
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. |
0 | 89 |
** |
90 |
** If you have questions regarding the use of this file, please contact |
|
91 |
** Nokia at qt-info@nokia.com. |
|
92 |
** |
|
93 |
** |
|
94 |
** |
|
95 |
** |
|
96 |
** |
|
97 |
** |
|
98 |
** |
|
99 |
** |
|
100 |
** $QT_END_LICENSE$ |
|
101 |
** |
|
102 |
****************************************************************************/ |
|
103 |
||
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
104 |
// This file was generated by qlalr - DO NOT EDIT! |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
105 |
|
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
106 |
|
0 | 107 |
#include <QtCore/QtDebug> |
108 |
||
109 |
#include <string.h> |
|
110 |
||
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; \ |
|
116 |
} while (0) |
|
117 |
||
118 |
./ |
|
119 |
||
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
120 |
/:/**************************************************************************** |
0 | 121 |
** |
4
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
122 |
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
0 | 123 |
** All rights reserved. |
124 |
** Contact: Nokia Corporation (qt-info@nokia.com) |
|
125 |
** |
|
126 |
** This file is part of the QtScript module of the Qt Toolkit. |
|
127 |
** |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
128 |
** $QT_BEGIN_LICENSE:LGPL$ |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
129 |
** No Commercial Usage |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
130 |
** This file contains pre-release code and may not be distributed. |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
131 |
** You may use this file in accordance with the terms and conditions |
0 | 132 |
** contained in the Technology Preview License Agreement accompanying |
133 |
** this package. |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
134 |
** |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
135 |
** GNU Lesser General Public License Usage |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
136 |
** Alternatively, this file may be used under the terms of the GNU Lesser |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
137 |
** General Public License version 2.1 as published by the Free Software |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
138 |
** Foundation and appearing in the file LICENSE.LGPL included in the |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
139 |
** packaging of this file. Please review the following information to |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
140 |
** ensure the GNU Lesser General Public License version 2.1 requirements |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
141 |
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
142 |
** |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
143 |
** In addition, as a special exception, Nokia gives you certain additional |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
144 |
** rights. These rights are described in the Nokia Qt LGPL Exception |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
145 |
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
146 |
** |
0 | 147 |
** If you have questions regarding the use of this file, please contact |
148 |
** Nokia at qt-info@nokia.com. |
|
149 |
** |
|
150 |
** |
|
151 |
** |
|
152 |
** |
|
153 |
** |
|
154 |
** |
|
155 |
** |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
156 |
** |
0 | 157 |
** $QT_END_LICENSE$ |
158 |
** |
|
159 |
****************************************************************************/ |
|
160 |
||
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
161 |
// This file was generated by qlalr - DO NOT EDIT! |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
162 |
|
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
163 |
|
0 | 164 |
// |
165 |
// W A R N I N G |
|
166 |
// ------------- |
|
167 |
// |
|
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. |
|
171 |
// |
|
172 |
// We mean it. |
|
173 |
// |
|
174 |
||
175 |
// |
|
176 |
// This file is automatically generated from qscript.g. |
|
177 |
// Changes will be lost. |
|
178 |
// |
|
179 |
||
180 |
#ifndef QSCRIPTPARSER_P_H |
|
181 |
#define QSCRIPTPARSER_P_H |
|
182 |
||
183 |
#include "qscriptgrammar_p.h" |
|
184 |
||
185 |
#include "qscriptastfwd_p.h" |
|
186 |
||
187 |
QT_BEGIN_NAMESPACE |
|
188 |
||
189 |
class QString; |
|
190 |
class QScriptEnginePrivate; |
|
191 |
class QScriptNameIdImpl; |
|
192 |
||
193 |
class QScriptParser: protected $table |
|
194 |
{ |
|
195 |
public: |
|
196 |
union Value { |
|
197 |
int ival; |
|
198 |
double dval; |
|
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; |
|
222 |
}; |
|
223 |
||
224 |
struct Location { |
|
225 |
int startLine; |
|
226 |
int startColumn; |
|
227 |
int endLine; |
|
228 |
int endColumn; |
|
229 |
}; |
|
230 |
||
231 |
public: |
|
232 |
QScriptParser(); |
|
233 |
~QScriptParser(); |
|
234 |
||
235 |
bool parse(QScriptEnginePrivate *driver); |
|
236 |
||
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; } |
|
243 |
||
244 |
protected: |
|
245 |
inline void reallocateStack(); |
|
246 |
||
247 |
inline Value &sym(int index) |
|
248 |
{ return sym_stack [tos + index - 1]; } |
|
249 |
||
250 |
inline Location &loc(int index) |
|
251 |
{ return location_stack [tos + index - 2]; } |
|
252 |
||
253 |
protected: |
|
254 |
int tos; |
|
255 |
int stack_size; |
|
256 |
Value *sym_stack; |
|
257 |
int *state_stack; |
|
258 |
Location *location_stack; |
|
259 |
QString error_message; |
|
260 |
int error_lineno; |
|
261 |
int error_column; |
|
262 |
}; |
|
263 |
||
264 |
inline void QScriptParser::reallocateStack() |
|
265 |
{ |
|
266 |
if (! stack_size) |
|
267 |
stack_size = 128; |
|
268 |
else |
|
269 |
stack_size <<= 1; |
|
270 |
||
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))); |
|
274 |
} |
|
275 |
||
276 |
:/ |
|
277 |
||
278 |
||
279 |
/. |
|
280 |
||
281 |
#include "qscriptparser_p.h" |
|
282 |
||
283 |
// |
|
284 |
// This file is automatically generated from qscript.g. |
|
285 |
// Changes will be lost. |
|
286 |
// |
|
287 |
||
288 |
QT_BEGIN_NAMESPACE |
|
289 |
||
290 |
inline static bool automatic(QScriptEnginePrivate *driver, int token) |
|
291 |
{ |
|
292 |
return token == $table::T_RBRACE |
|
293 |
|| token == 0 |
|
294 |
|| driver->lexer()->prevTerminator(); |
|
295 |
} |
|
296 |
||
297 |
||
298 |
QScriptParser::QScriptParser(): |
|
299 |
tos(0), |
|
300 |
stack_size(0), |
|
301 |
sym_stack(0), |
|
302 |
state_stack(0), |
|
303 |
location_stack(0) |
|
304 |
{ |
|
305 |
} |
|
306 |
||
307 |
QScriptParser::~QScriptParser() |
|
308 |
{ |
|
309 |
if (stack_size) { |
|
310 |
qFree(sym_stack); |
|
311 |
qFree(state_stack); |
|
312 |
qFree(location_stack); |
|
313 |
} |
|
314 |
} |
|
315 |
||
316 |
static inline QScriptParser::Location location(QScript::Lexer *lexer) |
|
317 |
{ |
|
318 |
QScriptParser::Location loc; |
|
319 |
loc.startLine = lexer->startLineNo(); |
|
320 |
loc.startColumn = lexer->startColumnNo(); |
|
321 |
loc.endLine = lexer->endLineNo(); |
|
322 |
loc.endColumn = lexer->endColumnNo(); |
|
323 |
return loc; |
|
324 |
} |
|
325 |
||
326 |
bool QScriptParser::parse(QScriptEnginePrivate *driver) |
|
327 |
{ |
|
328 |
const int INITIAL_STATE = 0; |
|
329 |
QScript::Lexer *lexer = driver->lexer(); |
|
330 |
||
331 |
int yytoken = -1; |
|
332 |
int saved_yytoken = -1; |
|
333 |
||
334 |
reallocateStack(); |
|
335 |
||
336 |
tos = 0; |
|
337 |
state_stack[++tos] = INITIAL_STATE; |
|
338 |
||
339 |
while (true) |
|
340 |
{ |
|
341 |
const int state = state_stack [tos]; |
|
342 |
if (yytoken == -1 && - TERMINAL_COUNT != action_index [state]) |
|
343 |
{ |
|
344 |
if (saved_yytoken == -1) |
|
345 |
{ |
|
346 |
yytoken = lexer->lex(); |
|
347 |
location_stack [tos] = location(lexer); |
|
348 |
} |
|
349 |
else |
|
350 |
{ |
|
351 |
yytoken = saved_yytoken; |
|
352 |
saved_yytoken = -1; |
|
353 |
} |
|
354 |
} |
|
355 |
||
356 |
int act = t_action (state, yytoken); |
|
357 |
||
358 |
if (act == ACCEPT_STATE) |
|
359 |
return true; |
|
360 |
||
361 |
else if (act > 0) |
|
362 |
{ |
|
363 |
if (++tos == stack_size) |
|
364 |
reallocateStack(); |
|
365 |
||
366 |
sym_stack [tos].dval = lexer->dval (); |
|
367 |
state_stack [tos] = act; |
|
368 |
location_stack [tos] = location(lexer); |
|
369 |
yytoken = -1; |
|
370 |
} |
|
371 |
||
372 |
else if (act < 0) |
|
373 |
{ |
|
374 |
int r = - act - 1; |
|
375 |
||
376 |
tos -= rhs [r]; |
|
377 |
act = state_stack [tos++]; |
|
378 |
||
379 |
switch (r) { |
|
380 |
./ |
|
381 |
||
382 |
PrimaryExpression: T_THIS ; |
|
383 |
/. |
|
384 |
case $rule_number: { |
|
385 |
sym(1).Node = QScript::makeAstNode<QScript::AST::ThisExpression> (driver->nodePool()); |
|
386 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1)); |
|
387 |
} break; |
|
388 |
./ |
|
389 |
||
390 |
PrimaryExpression: T_IDENTIFIER ; |
|
391 |
/. |
|
392 |
case $rule_number: { |
|
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)); |
|
395 |
} break; |
|
396 |
./ |
|
397 |
||
398 |
PrimaryExpression: T_NULL ; |
|
399 |
/. |
|
400 |
case $rule_number: { |
|
401 |
sym(1).Node = QScript::makeAstNode<QScript::AST::NullExpression> (driver->nodePool()); |
|
402 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1)); |
|
403 |
} break; |
|
404 |
./ |
|
405 |
||
406 |
PrimaryExpression: T_TRUE ; |
|
407 |
/. |
|
408 |
case $rule_number: { |
|
409 |
sym(1).Node = QScript::makeAstNode<QScript::AST::TrueLiteral> (driver->nodePool()); |
|
410 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1)); |
|
411 |
} break; |
|
412 |
./ |
|
413 |
||
414 |
PrimaryExpression: T_FALSE ; |
|
415 |
/. |
|
416 |
case $rule_number: { |
|
417 |
sym(1).Node = QScript::makeAstNode<QScript::AST::FalseLiteral> (driver->nodePool()); |
|
418 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1)); |
|
419 |
} break; |
|
420 |
./ |
|
421 |
||
422 |
PrimaryExpression: T_NUMERIC_LITERAL ; |
|
423 |
/. |
|
424 |
case $rule_number: { |
|
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)); |
|
427 |
} break; |
|
428 |
./ |
|
429 |
||
430 |
PrimaryExpression: T_STRING_LITERAL ; |
|
431 |
/. |
|
432 |
case $rule_number: { |
|
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)); |
|
435 |
} break; |
|
436 |
./ |
|
437 |
||
438 |
PrimaryExpression: T_DIVIDE_ ; |
|
439 |
/: |
|
440 |
#define Q_SCRIPT_REGEXPLITERAL_RULE1 $rule_number |
|
441 |
:/ |
|
442 |
/. |
|
443 |
case $rule_number: { |
|
444 |
bool rx = lexer->scanRegExp(QScript::Lexer::NoPrefix); |
|
445 |
if (!rx) { |
|
446 |
error_message = lexer->errorMessage(); |
|
447 |
error_lineno = lexer->startLineNo(); |
|
448 |
error_column = lexer->startColumnNo(); |
|
449 |
return false; |
|
450 |
} |
|
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)); |
|
453 |
} break; |
|
454 |
./ |
|
455 |
||
456 |
PrimaryExpression: T_DIVIDE_EQ ; |
|
457 |
/: |
|
458 |
#define Q_SCRIPT_REGEXPLITERAL_RULE2 $rule_number |
|
459 |
:/ |
|
460 |
/. |
|
461 |
case $rule_number: { |
|
462 |
bool rx = lexer->scanRegExp(QScript::Lexer::EqualPrefix); |
|
463 |
if (!rx) { |
|
464 |
error_message = lexer->errorMessage(); |
|
465 |
error_lineno = lexer->startLineNo(); |
|
466 |
error_column = lexer->startColumnNo(); |
|
467 |
return false; |
|
468 |
} |
|
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)); |
|
471 |
} break; |
|
472 |
./ |
|
473 |
||
474 |
PrimaryExpression: T_LBRACKET ElisionOpt T_RBRACKET ; |
|
475 |
/. |
|
476 |
case $rule_number: { |
|
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)); |
|
479 |
} break; |
|
480 |
./ |
|
481 |
||
482 |
PrimaryExpression: T_LBRACKET ElementList T_RBRACKET ; |
|
483 |
/. |
|
484 |
case $rule_number: { |
|
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)); |
|
487 |
} break; |
|
488 |
./ |
|
489 |
||
490 |
PrimaryExpression: T_LBRACKET ElementList T_COMMA ElisionOpt T_RBRACKET ; |
|
491 |
/. |
|
492 |
case $rule_number: { |
|
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)); |
|
495 |
} break; |
|
496 |
./ |
|
497 |
||
498 |
-- PrimaryExpression: T_LBRACE T_RBRACE ; |
|
499 |
-- /. |
|
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)); |
|
503 |
-- } break; |
|
504 |
-- ./ |
|
505 |
||
506 |
PrimaryExpression: T_LBRACE PropertyNameAndValueListOpt T_RBRACE ; |
|
507 |
/. |
|
508 |
case $rule_number: { |
|
509 |
if (sym(2).Node) |
|
510 |
sym(1).Node = QScript::makeAstNode<QScript::AST::ObjectLiteral> (driver->nodePool(), sym(2).PropertyNameAndValueList->finish ()); |
|
511 |
else |
|
512 |
sym(1).Node = QScript::makeAstNode<QScript::AST::ObjectLiteral> (driver->nodePool()); |
|
513 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3)); |
|
514 |
} break; |
|
515 |
./ |
|
516 |
||
517 |
PrimaryExpression: T_LBRACE PropertyNameAndValueList T_COMMA T_RBRACE ; |
|
518 |
/. |
|
519 |
case $rule_number: { |
|
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)); |
|
522 |
} break; |
|
523 |
./ |
|
524 |
||
525 |
PrimaryExpression: T_LPAREN Expression T_RPAREN ; |
|
526 |
/. |
|
527 |
case $rule_number: { |
|
528 |
sym(1) = sym(2); |
|
529 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3)); |
|
530 |
} break; |
|
531 |
./ |
|
532 |
||
533 |
ElementList: ElisionOpt AssignmentExpression ; |
|
534 |
/. |
|
535 |
case $rule_number: { |
|
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)); |
|
538 |
} break; |
|
539 |
./ |
|
540 |
||
541 |
ElementList: ElementList T_COMMA ElisionOpt AssignmentExpression ; |
|
542 |
/. |
|
543 |
case $rule_number: { |
|
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)); |
|
546 |
} break; |
|
547 |
./ |
|
548 |
||
549 |
Elision: T_COMMA ; |
|
550 |
/. |
|
551 |
case $rule_number: { |
|
552 |
sym(1).Node = QScript::makeAstNode<QScript::AST::Elision> (driver->nodePool()); |
|
553 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1)); |
|
554 |
} break; |
|
555 |
./ |
|
556 |
||
557 |
Elision: Elision T_COMMA ; |
|
558 |
/. |
|
559 |
case $rule_number: { |
|
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)); |
|
562 |
} break; |
|
563 |
./ |
|
564 |
||
565 |
ElisionOpt: ; |
|
566 |
/. |
|
567 |
case $rule_number: { |
|
568 |
sym(1).Node = 0; |
|
569 |
} break; |
|
570 |
./ |
|
571 |
||
572 |
ElisionOpt: Elision ; |
|
573 |
/. |
|
574 |
case $rule_number: { |
|
575 |
sym(1).Elision = sym(1).Elision->finish (); |
|
576 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1)); |
|
577 |
} break; |
|
578 |
./ |
|
579 |
||
580 |
PropertyNameAndValueList: PropertyName T_COLON AssignmentExpression ; |
|
581 |
/. |
|
582 |
case $rule_number: { |
|
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)); |
|
585 |
} break; |
|
586 |
./ |
|
587 |
||
588 |
PropertyNameAndValueList: PropertyNameAndValueList T_COMMA PropertyName T_COLON AssignmentExpression ; |
|
589 |
/. |
|
590 |
case $rule_number: { |
|
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)); |
|
593 |
} break; |
|
594 |
./ |
|
595 |
||
596 |
PropertyName: T_IDENTIFIER ; |
|
597 |
/. |
|
598 |
case $rule_number: { |
|
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)); |
|
601 |
} break; |
|
602 |
./ |
|
603 |
||
604 |
PropertyName: T_STRING_LITERAL ; |
|
605 |
/. |
|
606 |
case $rule_number: { |
|
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)); |
|
609 |
} break; |
|
610 |
./ |
|
611 |
||
612 |
PropertyName: T_NUMERIC_LITERAL ; |
|
613 |
/. |
|
614 |
case $rule_number: { |
|
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)); |
|
617 |
} break; |
|
618 |
./ |
|
619 |
||
620 |
PropertyName: ReservedIdentifier ; |
|
621 |
/. |
|
622 |
case $rule_number: { |
|
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)); |
|
625 |
} break; |
|
626 |
./ |
|
627 |
||
628 |
ReservedIdentifier: T_BREAK ; |
|
629 |
/. |
|
630 |
case $rule_number: |
|
631 |
./ |
|
632 |
ReservedIdentifier: T_CASE ; |
|
633 |
/. |
|
634 |
case $rule_number: |
|
635 |
./ |
|
636 |
ReservedIdentifier: T_CATCH ; |
|
637 |
/. |
|
638 |
case $rule_number: |
|
639 |
./ |
|
640 |
ReservedIdentifier: T_CONTINUE ; |
|
641 |
/. |
|
642 |
case $rule_number: |
|
643 |
./ |
|
644 |
ReservedIdentifier: T_DEFAULT ; |
|
645 |
/. |
|
646 |
case $rule_number: |
|
647 |
./ |
|
648 |
ReservedIdentifier: T_DELETE ; |
|
649 |
/. |
|
650 |
case $rule_number: |
|
651 |
./ |
|
652 |
ReservedIdentifier: T_DO ; |
|
653 |
/. |
|
654 |
case $rule_number: |
|
655 |
./ |
|
656 |
ReservedIdentifier: T_ELSE ; |
|
657 |
/. |
|
658 |
case $rule_number: |
|
659 |
./ |
|
660 |
ReservedIdentifier: T_FALSE ; |
|
661 |
/. |
|
662 |
case $rule_number: |
|
663 |
./ |
|
664 |
ReservedIdentifier: T_FINALLY ; |
|
665 |
/. |
|
666 |
case $rule_number: |
|
667 |
./ |
|
668 |
ReservedIdentifier: T_FOR ; |
|
669 |
/. |
|
670 |
case $rule_number: |
|
671 |
./ |
|
672 |
ReservedIdentifier: T_FUNCTION ; |
|
673 |
/. |
|
674 |
case $rule_number: |
|
675 |
./ |
|
676 |
ReservedIdentifier: T_IF ; |
|
677 |
/. |
|
678 |
case $rule_number: |
|
679 |
./ |
|
680 |
ReservedIdentifier: T_IN ; |
|
681 |
/. |
|
682 |
case $rule_number: |
|
683 |
./ |
|
684 |
ReservedIdentifier: T_INSTANCEOF ; |
|
685 |
/. |
|
686 |
case $rule_number: |
|
687 |
./ |
|
688 |
ReservedIdentifier: T_NEW ; |
|
689 |
/. |
|
690 |
case $rule_number: |
|
691 |
./ |
|
692 |
ReservedIdentifier: T_NULL ; |
|
693 |
/. |
|
694 |
case $rule_number: |
|
695 |
./ |
|
696 |
ReservedIdentifier: T_RETURN ; |
|
697 |
/. |
|
698 |
case $rule_number: |
|
699 |
./ |
|
700 |
ReservedIdentifier: T_SWITCH ; |
|
701 |
/. |
|
702 |
case $rule_number: |
|
703 |
./ |
|
704 |
ReservedIdentifier: T_THIS ; |
|
705 |
/. |
|
706 |
case $rule_number: |
|
707 |
./ |
|
708 |
ReservedIdentifier: T_THROW ; |
|
709 |
/. |
|
710 |
case $rule_number: |
|
711 |
./ |
|
712 |
ReservedIdentifier: T_TRUE ; |
|
713 |
/. |
|
714 |
case $rule_number: |
|
715 |
./ |
|
716 |
ReservedIdentifier: T_TRY ; |
|
717 |
/. |
|
718 |
case $rule_number: |
|
719 |
./ |
|
720 |
ReservedIdentifier: T_TYPEOF ; |
|
721 |
/. |
|
722 |
case $rule_number: |
|
723 |
./ |
|
724 |
ReservedIdentifier: T_VAR ; |
|
725 |
/. |
|
726 |
case $rule_number: |
|
727 |
./ |
|
728 |
ReservedIdentifier: T_VOID ; |
|
729 |
/. |
|
730 |
case $rule_number: |
|
731 |
./ |
|
732 |
ReservedIdentifier: T_WHILE ; |
|
733 |
/. |
|
734 |
case $rule_number: |
|
735 |
./ |
|
736 |
ReservedIdentifier: T_CONST ; |
|
737 |
/. |
|
738 |
case $rule_number: |
|
739 |
./ |
|
740 |
ReservedIdentifier: T_DEBUGGER ; |
|
741 |
/. |
|
742 |
case $rule_number: |
|
743 |
./ |
|
744 |
ReservedIdentifier: T_RESERVED_WORD ; |
|
745 |
/. |
|
746 |
case $rule_number: |
|
747 |
./ |
|
748 |
ReservedIdentifier: T_WITH ; |
|
749 |
/. |
|
750 |
case $rule_number: |
|
751 |
{ |
|
752 |
sym(1).sval = driver->intern(lexer->characterBuffer(), lexer->characterCount()); |
|
753 |
} break; |
|
754 |
./ |
|
755 |
||
756 |
PropertyIdentifier: T_IDENTIFIER ; |
|
757 |
PropertyIdentifier: ReservedIdentifier ; |
|
758 |
||
759 |
MemberExpression: PrimaryExpression ; |
|
760 |
MemberExpression: FunctionExpression ; |
|
761 |
||
762 |
MemberExpression: MemberExpression T_LBRACKET Expression T_RBRACKET ; |
|
763 |
/. |
|
764 |
case $rule_number: { |
|
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)); |
|
767 |
} break; |
|
768 |
./ |
|
769 |
||
770 |
MemberExpression: MemberExpression T_DOT PropertyIdentifier ; |
|
771 |
/. |
|
772 |
case $rule_number: { |
|
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)); |
|
775 |
} break; |
|
776 |
./ |
|
777 |
||
778 |
MemberExpression: T_NEW MemberExpression Arguments ; |
|
779 |
/. |
|
780 |
case $rule_number: { |
|
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)); |
|
783 |
} break; |
|
784 |
./ |
|
785 |
||
786 |
NewExpression: MemberExpression ; |
|
787 |
||
788 |
NewExpression: T_NEW NewExpression ; |
|
789 |
/. |
|
790 |
case $rule_number: { |
|
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)); |
|
793 |
} break; |
|
794 |
./ |
|
795 |
||
796 |
CallExpression: MemberExpression Arguments ; |
|
797 |
/. |
|
798 |
case $rule_number: { |
|
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)); |
|
801 |
} break; |
|
802 |
./ |
|
803 |
||
804 |
CallExpression: CallExpression Arguments ; |
|
805 |
/. |
|
806 |
case $rule_number: { |
|
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)); |
|
809 |
} break; |
|
810 |
./ |
|
811 |
||
812 |
CallExpression: CallExpression T_LBRACKET Expression T_RBRACKET ; |
|
813 |
/. |
|
814 |
case $rule_number: { |
|
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)); |
|
817 |
} break; |
|
818 |
./ |
|
819 |
||
820 |
CallExpression: CallExpression T_DOT PropertyIdentifier ; |
|
821 |
/. |
|
822 |
case $rule_number: { |
|
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)); |
|
825 |
} break; |
|
826 |
./ |
|
827 |
||
828 |
Arguments: T_LPAREN T_RPAREN ; |
|
829 |
/. |
|
830 |
case $rule_number: { |
|
831 |
sym(1).Node = 0; |
|
832 |
} break; |
|
833 |
./ |
|
834 |
||
835 |
Arguments: T_LPAREN ArgumentList T_RPAREN ; |
|
836 |
/. |
|
837 |
case $rule_number: { |
|
838 |
sym(1).Node = sym(2).ArgumentList->finish (); |
|
839 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3)); |
|
840 |
} break; |
|
841 |
./ |
|
842 |
||
843 |
ArgumentList: AssignmentExpression ; |
|
844 |
/. |
|
845 |
case $rule_number: { |
|
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)); |
|
848 |
} break; |
|
849 |
./ |
|
850 |
||
851 |
ArgumentList: ArgumentList T_COMMA AssignmentExpression ; |
|
852 |
/. |
|
853 |
case $rule_number: { |
|
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)); |
|
856 |
} break; |
|
857 |
./ |
|
858 |
||
859 |
LeftHandSideExpression: NewExpression ; |
|
860 |
LeftHandSideExpression: CallExpression ; |
|
861 |
PostfixExpression: LeftHandSideExpression ; |
|
862 |
||
863 |
PostfixExpression: LeftHandSideExpression T_PLUS_PLUS ; |
|
864 |
/. |
|
865 |
case $rule_number: { |
|
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)); |
|
868 |
} break; |
|
869 |
./ |
|
870 |
||
871 |
PostfixExpression: LeftHandSideExpression T_MINUS_MINUS ; |
|
872 |
/. |
|
873 |
case $rule_number: { |
|
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)); |
|
876 |
} break; |
|
877 |
./ |
|
878 |
||
879 |
UnaryExpression: PostfixExpression ; |
|
880 |
||
881 |
UnaryExpression: T_DELETE UnaryExpression ; |
|
882 |
/. |
|
883 |
case $rule_number: { |
|
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)); |
|
886 |
} break; |
|
887 |
./ |
|
888 |
||
889 |
UnaryExpression: T_VOID UnaryExpression ; |
|
890 |
/. |
|
891 |
case $rule_number: { |
|
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)); |
|
894 |
} break; |
|
895 |
./ |
|
896 |
||
897 |
UnaryExpression: T_TYPEOF UnaryExpression ; |
|
898 |
/. |
|
899 |
case $rule_number: { |
|
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)); |
|
902 |
} break; |
|
903 |
./ |
|
904 |
||
905 |
UnaryExpression: T_PLUS_PLUS UnaryExpression ; |
|
906 |
/. |
|
907 |
case $rule_number: { |
|
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)); |
|
910 |
} break; |
|
911 |
./ |
|
912 |
||
913 |
UnaryExpression: T_MINUS_MINUS UnaryExpression ; |
|
914 |
/. |
|
915 |
case $rule_number: { |
|
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)); |
|
918 |
} break; |
|
919 |
./ |
|
920 |
||
921 |
UnaryExpression: T_PLUS UnaryExpression ; |
|
922 |
/. |
|
923 |
case $rule_number: { |
|
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)); |
|
926 |
} break; |
|
927 |
./ |
|
928 |
||
929 |
UnaryExpression: T_MINUS UnaryExpression ; |
|
930 |
/. |
|
931 |
case $rule_number: { |
|
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)); |
|
934 |
} break; |
|
935 |
./ |
|
936 |
||
937 |
UnaryExpression: T_TILDE UnaryExpression ; |
|
938 |
/. |
|
939 |
case $rule_number: { |
|
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)); |
|
942 |
} break; |
|
943 |
./ |
|
944 |
||
945 |
UnaryExpression: T_NOT UnaryExpression ; |
|
946 |
/. |
|
947 |
case $rule_number: { |
|
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)); |
|
950 |
} break; |
|
951 |
./ |
|
952 |
||
953 |
MultiplicativeExpression: UnaryExpression ; |
|
954 |
||
955 |
MultiplicativeExpression: MultiplicativeExpression T_STAR UnaryExpression ; |
|
956 |
/. |
|
957 |
case $rule_number: { |
|
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)); |
|
960 |
} break; |
|
961 |
./ |
|
962 |
||
963 |
MultiplicativeExpression: MultiplicativeExpression T_DIVIDE_ UnaryExpression ; |
|
964 |
/. |
|
965 |
case $rule_number: { |
|
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)); |
|
968 |
} break; |
|
969 |
./ |
|
970 |
||
971 |
MultiplicativeExpression: MultiplicativeExpression T_REMAINDER UnaryExpression ; |
|
972 |
/. |
|
973 |
case $rule_number: { |
|
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)); |
|
976 |
} break; |
|
977 |
./ |
|
978 |
||
979 |
AdditiveExpression: MultiplicativeExpression ; |
|
980 |
||
981 |
AdditiveExpression: AdditiveExpression T_PLUS MultiplicativeExpression ; |
|
982 |
/. |
|
983 |
case $rule_number: { |
|
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)); |
|
986 |
} break; |
|
987 |
./ |
|
988 |
||
989 |
AdditiveExpression: AdditiveExpression T_MINUS MultiplicativeExpression ; |
|
990 |
/. |
|
991 |
case $rule_number: { |
|
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)); |
|
994 |
} break; |
|
995 |
./ |
|
996 |
||
997 |
ShiftExpression: AdditiveExpression ; |
|
998 |
||
999 |
ShiftExpression: ShiftExpression T_LT_LT AdditiveExpression ; |
|
1000 |
/. |
|
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)); |
|
1004 |
} break; |
|
1005 |
./ |
|
1006 |
||
1007 |
ShiftExpression: ShiftExpression T_GT_GT AdditiveExpression ; |
|
1008 |
/. |
|
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)); |
|
1012 |
} break; |
|
1013 |
./ |
|
1014 |
||
1015 |
ShiftExpression: ShiftExpression T_GT_GT_GT AdditiveExpression ; |
|
1016 |
/. |
|
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)); |
|
1020 |
} break; |
|
1021 |
./ |
|
1022 |
||
1023 |
RelationalExpression: ShiftExpression ; |
|
1024 |
||
1025 |
RelationalExpression: RelationalExpression T_LT ShiftExpression ; |
|
1026 |
/. |
|
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)); |
|
1030 |
} break; |
|
1031 |
./ |
|
1032 |
||
1033 |
RelationalExpression: RelationalExpression T_GT ShiftExpression ; |
|
1034 |
/. |
|
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)); |
|
1038 |
} break; |
|
1039 |
./ |
|
1040 |
||
1041 |
RelationalExpression: RelationalExpression T_LE ShiftExpression ; |
|
1042 |
/. |
|
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)); |
|
1046 |
} break; |
|
1047 |
./ |
|
1048 |
||
1049 |
RelationalExpression: RelationalExpression T_GE ShiftExpression ; |
|
1050 |
/. |
|
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)); |
|
1054 |
} break; |
|
1055 |
./ |
|
1056 |
||
1057 |
RelationalExpression: RelationalExpression T_INSTANCEOF ShiftExpression ; |
|
1058 |
/. |
|
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)); |
|
1062 |
} break; |
|
1063 |
./ |
|
1064 |
||
1065 |
RelationalExpression: RelationalExpression T_IN ShiftExpression ; |
|
1066 |
/. |
|
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)); |
|
1070 |
} break; |
|
1071 |
./ |
|
1072 |
||
1073 |
RelationalExpressionNotIn: ShiftExpression ; |
|
1074 |
||
1075 |
RelationalExpressionNotIn: RelationalExpressionNotIn T_LT ShiftExpression ; |
|
1076 |
/. |
|
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)); |
|
1080 |
} break; |
|
1081 |
./ |
|
1082 |
||
1083 |
RelationalExpressionNotIn: RelationalExpressionNotIn T_GT ShiftExpression ; |
|
1084 |
/. |
|
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)); |
|
1088 |
} break; |
|
1089 |
./ |
|
1090 |
||
1091 |
RelationalExpressionNotIn: RelationalExpressionNotIn T_LE ShiftExpression ; |
|
1092 |
/. |
|
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)); |
|
1096 |
} break; |
|
1097 |
./ |
|
1098 |
||
1099 |
RelationalExpressionNotIn: RelationalExpressionNotIn T_GE ShiftExpression ; |
|
1100 |
/. |
|
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)); |
|
1104 |
} break; |
|
1105 |
./ |
|
1106 |
||
1107 |
RelationalExpressionNotIn: RelationalExpressionNotIn T_INSTANCEOF ShiftExpression ; |
|
1108 |
/. |
|
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)); |
|
1112 |
} break; |
|
1113 |
./ |
|
1114 |
||
1115 |
EqualityExpression: RelationalExpression ; |
|
1116 |
||
1117 |
EqualityExpression: EqualityExpression T_EQ_EQ RelationalExpression ; |
|
1118 |
/. |
|
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)); |
|
1122 |
} break; |
|
1123 |
./ |
|
1124 |
||
1125 |
EqualityExpression: EqualityExpression T_NOT_EQ RelationalExpression ; |
|
1126 |
/. |
|
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)); |
|
1130 |
} break; |
|
1131 |
./ |
|
1132 |
||
1133 |
EqualityExpression: EqualityExpression T_EQ_EQ_EQ RelationalExpression ; |
|
1134 |
/. |
|
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)); |
|
1138 |
} break; |
|
1139 |
./ |
|
1140 |
||
1141 |
EqualityExpression: EqualityExpression T_NOT_EQ_EQ RelationalExpression ; |
|
1142 |
/. |
|
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)); |
|
1146 |
} break; |
|
1147 |
./ |
|
1148 |
||
1149 |
EqualityExpressionNotIn: RelationalExpressionNotIn ; |
|
1150 |
||
1151 |
EqualityExpressionNotIn: EqualityExpressionNotIn T_EQ_EQ RelationalExpressionNotIn ; |
|
1152 |
/. |
|
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)); |
|
1156 |
} break; |
|
1157 |
./ |
|
1158 |
||
1159 |
EqualityExpressionNotIn: EqualityExpressionNotIn T_NOT_EQ RelationalExpressionNotIn; |
|
1160 |
/. |
|
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)); |
|
1164 |
} break; |
|
1165 |
./ |
|
1166 |
||
1167 |
EqualityExpressionNotIn: EqualityExpressionNotIn T_EQ_EQ_EQ RelationalExpressionNotIn ; |
|
1168 |
/. |
|
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)); |
|
1172 |
} break; |
|
1173 |
./ |
|
1174 |
||
1175 |
EqualityExpressionNotIn: EqualityExpressionNotIn T_NOT_EQ_EQ RelationalExpressionNotIn ; |
|
1176 |
/. |
|
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)); |
|
1180 |
} break; |
|
1181 |
./ |
|
1182 |
||
1183 |
BitwiseANDExpression: EqualityExpression ; |
|
1184 |
||
1185 |
BitwiseANDExpression: BitwiseANDExpression T_AND EqualityExpression ; |
|
1186 |
/. |
|
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)); |
|
1190 |
} break; |
|
1191 |
./ |
|
1192 |
||
1193 |
BitwiseANDExpressionNotIn: EqualityExpressionNotIn ; |
|
1194 |
||
1195 |
BitwiseANDExpressionNotIn: BitwiseANDExpressionNotIn T_AND EqualityExpressionNotIn ; |
|
1196 |
/. |
|
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)); |
|
1200 |
} break; |
|
1201 |
./ |
|
1202 |
||
1203 |
BitwiseXORExpression: BitwiseANDExpression ; |
|
1204 |
||
1205 |
BitwiseXORExpression: BitwiseXORExpression T_XOR BitwiseANDExpression ; |
|
1206 |
/. |
|
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)); |
|
1210 |
} break; |
|
1211 |
./ |
|
1212 |
||
1213 |
BitwiseXORExpressionNotIn: BitwiseANDExpressionNotIn ; |
|
1214 |
||
1215 |
BitwiseXORExpressionNotIn: BitwiseXORExpressionNotIn T_XOR BitwiseANDExpressionNotIn ; |
|
1216 |
/. |
|
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)); |
|
1220 |
} break; |
|
1221 |
./ |
|
1222 |
||
1223 |
BitwiseORExpression: BitwiseXORExpression ; |
|
1224 |
||
1225 |
BitwiseORExpression: BitwiseORExpression T_OR BitwiseXORExpression ; |
|
1226 |
/. |
|
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)); |
|
1230 |
} break; |
|
1231 |
./ |
|
1232 |
||
1233 |
BitwiseORExpressionNotIn: BitwiseXORExpressionNotIn ; |
|
1234 |
||
1235 |
BitwiseORExpressionNotIn: BitwiseORExpressionNotIn T_OR BitwiseXORExpressionNotIn ; |
|
1236 |
/. |
|
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)); |
|
1240 |
} break; |
|
1241 |
./ |
|
1242 |
||
1243 |
LogicalANDExpression: BitwiseORExpression ; |
|
1244 |
||
1245 |
LogicalANDExpression: LogicalANDExpression T_AND_AND BitwiseORExpression ; |
|
1246 |
/. |
|
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)); |
|
1250 |
} break; |
|
1251 |
./ |
|
1252 |
||
1253 |
LogicalANDExpressionNotIn: BitwiseORExpressionNotIn ; |
|
1254 |
||
1255 |
LogicalANDExpressionNotIn: LogicalANDExpressionNotIn T_AND_AND BitwiseORExpressionNotIn ; |
|
1256 |
/. |
|
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)); |
|
1260 |
} break; |
|
1261 |
./ |
|
1262 |
||
1263 |
LogicalORExpression: LogicalANDExpression ; |
|
1264 |
||
1265 |
LogicalORExpression: LogicalORExpression T_OR_OR LogicalANDExpression ; |
|
1266 |
/. |
|
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)); |
|
1270 |
} break; |
|
1271 |
./ |
|
1272 |
||
1273 |
LogicalORExpressionNotIn: LogicalANDExpressionNotIn ; |
|
1274 |
||
1275 |
LogicalORExpressionNotIn: LogicalORExpressionNotIn T_OR_OR LogicalANDExpressionNotIn ; |
|
1276 |
/. |
|
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)); |
|
1280 |
} break; |
|
1281 |
./ |
|
1282 |
||
1283 |
ConditionalExpression: LogicalORExpression ; |
|
1284 |
||
1285 |
ConditionalExpression: LogicalORExpression T_QUESTION AssignmentExpression T_COLON AssignmentExpression ; |
|
1286 |
/. |
|
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)); |
|
1290 |
} break; |
|
1291 |
./ |
|
1292 |
||
1293 |
ConditionalExpressionNotIn: LogicalORExpressionNotIn ; |
|
1294 |
||
1295 |
ConditionalExpressionNotIn: LogicalORExpressionNotIn T_QUESTION AssignmentExpressionNotIn T_COLON AssignmentExpressionNotIn ; |
|
1296 |
/. |
|
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)); |
|
1300 |
} break; |
|
1301 |
./ |
|
1302 |
||
1303 |
AssignmentExpression: ConditionalExpression ; |
|
1304 |
||
1305 |
AssignmentExpression: LeftHandSideExpression AssignmentOperator AssignmentExpression ; |
|
1306 |
/. |
|
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)); |
|
1310 |
} break; |
|
1311 |
./ |
|
1312 |
||
1313 |
AssignmentExpressionNotIn: ConditionalExpressionNotIn ; |
|
1314 |
||
1315 |
AssignmentExpressionNotIn: LeftHandSideExpression AssignmentOperator AssignmentExpressionNotIn ; |
|
1316 |
/. |
|
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)); |
|
1320 |
} break; |
|
1321 |
./ |
|
1322 |
||
1323 |
AssignmentOperator: T_EQ ; |
|
1324 |
/. |
|
1325 |
case $rule_number: { |
|
1326 |
sym(1).ival = QSOperator::Assign; |
|
1327 |
} break; |
|
1328 |
./ |
|
1329 |
||
1330 |
AssignmentOperator: T_STAR_EQ ; |
|
1331 |
/. |
|
1332 |
case $rule_number: { |
|
1333 |
sym(1).ival = QSOperator::InplaceMul; |
|
1334 |
} break; |
|
1335 |
./ |
|
1336 |
||
1337 |
AssignmentOperator: T_DIVIDE_EQ ; |
|
1338 |
/. |
|
1339 |
case $rule_number: { |
|
1340 |
sym(1).ival = QSOperator::InplaceDiv; |
|
1341 |
} break; |
|
1342 |
./ |
|
1343 |
||
1344 |
AssignmentOperator: T_REMAINDER_EQ ; |
|
1345 |
/. |
|
1346 |
case $rule_number: { |
|
1347 |
sym(1).ival = QSOperator::InplaceMod; |
|
1348 |
} break; |
|
1349 |
./ |
|
1350 |
||
1351 |
AssignmentOperator: T_PLUS_EQ ; |
|
1352 |
/. |
|
1353 |
case $rule_number: { |
|
1354 |
sym(1).ival = QSOperator::InplaceAdd; |
|
1355 |
} break; |
|
1356 |
./ |
|
1357 |
||
1358 |
AssignmentOperator: T_MINUS_EQ ; |
|
1359 |
/. |
|
1360 |
case $rule_number: { |
|
1361 |
sym(1).ival = QSOperator::InplaceSub; |
|
1362 |
} break; |
|
1363 |
./ |
|
1364 |
||
1365 |
AssignmentOperator: T_LT_LT_EQ ; |
|
1366 |
/. |
|
1367 |
case $rule_number: { |
|
1368 |
sym(1).ival = QSOperator::InplaceLeftShift; |
|
1369 |
} break; |
|
1370 |
./ |
|
1371 |
||
1372 |
AssignmentOperator: T_GT_GT_EQ ; |
|
1373 |
/. |
|
1374 |
case $rule_number: { |
|
1375 |
sym(1).ival = QSOperator::InplaceRightShift; |
|
1376 |
} break; |
|
1377 |
./ |
|
1378 |
||
1379 |
AssignmentOperator: T_GT_GT_GT_EQ ; |
|
1380 |
/. |
|
1381 |
case $rule_number: { |
|
1382 |
sym(1).ival = QSOperator::InplaceURightShift; |
|
1383 |
} break; |
|
1384 |
./ |
|
1385 |
||
1386 |
AssignmentOperator: T_AND_EQ ; |
|
1387 |
/. |
|
1388 |
case $rule_number: { |
|
1389 |
sym(1).ival = QSOperator::InplaceAnd; |
|
1390 |
} break; |
|
1391 |
./ |
|
1392 |
||
1393 |
AssignmentOperator: T_XOR_EQ ; |
|
1394 |
/. |
|
1395 |
case $rule_number: { |
|
1396 |
sym(1).ival = QSOperator::InplaceXor; |
|
1397 |
} break; |
|
1398 |
./ |
|
1399 |
||
1400 |
AssignmentOperator: T_OR_EQ ; |
|
1401 |
/. |
|
1402 |
case $rule_number: { |
|
1403 |
sym(1).ival = QSOperator::InplaceOr; |
|
1404 |
} break; |
|
1405 |
./ |
|
1406 |
||
1407 |
Expression: AssignmentExpression ; |
|
1408 |
||
1409 |
Expression: Expression T_COMMA AssignmentExpression ; |
|
1410 |
/. |
|
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)); |
|
1414 |
} break; |
|
1415 |
./ |
|
1416 |
||
1417 |
ExpressionOpt: ; |
|
1418 |
/. |
|
1419 |
case $rule_number: { |
|
1420 |
sym(1).Node = 0; |
|
1421 |
} break; |
|
1422 |
./ |
|
1423 |
||
1424 |
ExpressionOpt: Expression ; |
|
1425 |
||
1426 |
ExpressionNotIn: AssignmentExpressionNotIn ; |
|
1427 |
||
1428 |
ExpressionNotIn: ExpressionNotIn T_COMMA AssignmentExpressionNotIn ; |
|
1429 |
/. |
|
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)); |
|
1433 |
} break; |
|
1434 |
./ |
|
1435 |
||
1436 |
ExpressionNotInOpt: ; |
|
1437 |
/. |
|
1438 |
case $rule_number: { |
|
1439 |
sym(1).Node = 0; |
|
1440 |
} break; |
|
1441 |
./ |
|
1442 |
||
1443 |
ExpressionNotInOpt: ExpressionNotIn ; |
|
1444 |
||
1445 |
Statement: Block ; |
|
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 ; |
|
1460 |
||
1461 |
||
1462 |
Block: T_LBRACE StatementListOpt T_RBRACE ; |
|
1463 |
/. |
|
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)); |
|
1467 |
} break; |
|
1468 |
./ |
|
1469 |
||
1470 |
StatementList: Statement ; |
|
1471 |
/. |
|
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)); |
|
1475 |
} break; |
|
1476 |
./ |
|
1477 |
||
1478 |
StatementList: StatementList Statement ; |
|
1479 |
/. |
|
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)); |
|
1483 |
} break; |
|
1484 |
./ |
|
1485 |
||
1486 |
StatementListOpt: ; |
|
1487 |
/. |
|
1488 |
case $rule_number: { |
|
1489 |
sym(1).Node = 0; |
|
1490 |
} break; |
|
1491 |
./ |
|
1492 |
||
1493 |
StatementListOpt: StatementList ; |
|
1494 |
/. |
|
1495 |
case $rule_number: { |
|
1496 |
sym(1).Node = sym(1).StatementList->finish (); |
|
1497 |
} break; |
|
1498 |
./ |
|
1499 |
||
1500 |
VariableStatement: VariableDeclarationKind VariableDeclarationList T_AUTOMATIC_SEMICOLON ; -- automatic semicolon |
|
1501 |
VariableStatement: VariableDeclarationKind VariableDeclarationList T_SEMICOLON ; |
|
1502 |
/. |
|
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)); |
|
1506 |
} break; |
|
1507 |
./ |
|
1508 |
||
1509 |
VariableDeclarationKind: T_CONST ; |
|
1510 |
/. |
|
1511 |
case $rule_number: { |
|
1512 |
sym(1).ival = T_CONST; |
|
1513 |
} break; |
|
1514 |
./ |
|
1515 |
||
1516 |
VariableDeclarationKind: T_VAR ; |
|
1517 |
/. |
|
1518 |
case $rule_number: { |
|
1519 |
sym(1).ival = T_VAR; |
|
1520 |
} break; |
|
1521 |
./ |
|
1522 |
||
1523 |
VariableDeclarationList: VariableDeclaration ; |
|
1524 |
/. |
|
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)); |
|
1528 |
} break; |
|
1529 |
./ |
|
1530 |
||
1531 |
VariableDeclarationList: VariableDeclarationList T_COMMA VariableDeclaration ; |
|
1532 |
/. |
|
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)); |
|
1536 |
} break; |
|
1537 |
./ |
|
1538 |
||
1539 |
VariableDeclarationListNotIn: VariableDeclarationNotIn ; |
|
1540 |
/. |
|
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)); |
|
1544 |
} break; |
|
1545 |
./ |
|
1546 |
||
1547 |
VariableDeclarationListNotIn: VariableDeclarationListNotIn T_COMMA VariableDeclarationNotIn ; |
|
1548 |
/. |
|
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)); |
|
1552 |
} break; |
|
1553 |
./ |
|
1554 |
||
1555 |
VariableDeclaration: T_IDENTIFIER InitialiserOpt ; |
|
1556 |
/. |
|
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)); |
|
1560 |
} break; |
|
1561 |
./ |
|
1562 |
||
1563 |
VariableDeclarationNotIn: T_IDENTIFIER InitialiserNotInOpt ; |
|
1564 |
/. |
|
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)); |
|
1568 |
} break; |
|
1569 |
./ |
|
1570 |
||
1571 |
Initialiser: T_EQ AssignmentExpression ; |
|
1572 |
/. |
|
1573 |
case $rule_number: { |
|
1574 |
sym(1) = sym(2); |
|
1575 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2)); |
|
1576 |
} break; |
|
1577 |
./ |
|
1578 |
||
1579 |
InitialiserOpt: ; |
|
1580 |
/. |
|
1581 |
case $rule_number: { |
|
1582 |
sym(1).Node = 0; |
|
1583 |
} break; |
|
1584 |
./ |
|
1585 |
||
1586 |
InitialiserOpt: Initialiser ; |
|
1587 |
||
1588 |
InitialiserNotIn: T_EQ AssignmentExpressionNotIn ; |
|
1589 |
/. |
|
1590 |
case $rule_number: { |
|
1591 |
sym(1) = sym(2); |
|
1592 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2)); |
|
1593 |
} break; |
|
1594 |
./ |
|
1595 |
||
1596 |
InitialiserNotInOpt: ; |
|
1597 |
/. |
|
1598 |
case $rule_number: { |
|
1599 |
sym(1).Node = 0; |
|
1600 |
} break; |
|
1601 |
./ |
|
1602 |
||
1603 |
InitialiserNotInOpt: InitialiserNotIn ; |
|
1604 |
||
1605 |
EmptyStatement: T_SEMICOLON ; |
|
1606 |
/. |
|
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)); |
|
1610 |
} break; |
|
1611 |
./ |
|
1612 |
||
1613 |
ExpressionStatement: Expression T_AUTOMATIC_SEMICOLON ; -- automatic semicolon |
|
1614 |
ExpressionStatement: Expression T_SEMICOLON ; |
|
1615 |
/. |
|
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)); |
|
1619 |
} break; |
|
1620 |
./ |
|
1621 |
||
1622 |
IfStatement: T_IF T_LPAREN Expression T_RPAREN Statement T_ELSE Statement ; |
|
1623 |
/. |
|
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)); |
|
1627 |
} break; |
|
1628 |
./ |
|
1629 |
||
1630 |
IfStatement: T_IF T_LPAREN Expression T_RPAREN Statement ; |
|
1631 |
/. |
|
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)); |
|
1635 |
} break; |
|
1636 |
./ |
|
1637 |
||
1638 |
||
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 ; |
|
1641 |
/. |
|
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)); |
|
1645 |
} break; |
|
1646 |
./ |
|
1647 |
||
1648 |
IterationStatement: T_WHILE T_LPAREN Expression T_RPAREN Statement ; |
|
1649 |
/. |
|
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)); |
|
1653 |
} break; |
|
1654 |
./ |
|
1655 |
||
1656 |
IterationStatement: T_FOR T_LPAREN ExpressionNotInOpt T_SEMICOLON ExpressionOpt T_SEMICOLON ExpressionOpt T_RPAREN Statement ; |
|
1657 |
/. |
|
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)); |
|
1661 |
} break; |
|
1662 |
./ |
|
1663 |
||
1664 |
IterationStatement: T_FOR T_LPAREN T_VAR VariableDeclarationListNotIn T_SEMICOLON ExpressionOpt T_SEMICOLON ExpressionOpt T_RPAREN Statement ; |
|
1665 |
/. |
|
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)); |
|
1669 |
} break; |
|
1670 |
./ |
|
1671 |
||
1672 |
IterationStatement: T_FOR T_LPAREN LeftHandSideExpression T_IN Expression T_RPAREN Statement ; |
|
1673 |
/. |
|
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)); |
|
1677 |
} break; |
|
1678 |
./ |
|
1679 |
||
1680 |
IterationStatement: T_FOR T_LPAREN T_VAR VariableDeclarationNotIn T_IN Expression T_RPAREN Statement ; |
|
1681 |
/. |
|
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)); |
|
1685 |
} break; |
|
1686 |
./ |
|
1687 |
||
1688 |
ContinueStatement: T_CONTINUE T_AUTOMATIC_SEMICOLON ; -- automatic semicolon |
|
1689 |
ContinueStatement: T_CONTINUE T_SEMICOLON ; |
|
1690 |
/. |
|
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)); |
|
1694 |
} break; |
|
1695 |
./ |
|
1696 |
||
1697 |
ContinueStatement: T_CONTINUE T_IDENTIFIER T_AUTOMATIC_SEMICOLON ; -- automatic semicolon |
|
1698 |
ContinueStatement: T_CONTINUE T_IDENTIFIER T_SEMICOLON ; |
|
1699 |
/. |
|
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)); |
|
1703 |
} break; |
|
1704 |
./ |
|
1705 |
||
1706 |
BreakStatement: T_BREAK T_AUTOMATIC_SEMICOLON ; -- automatic semicolon |
|
1707 |
BreakStatement: T_BREAK T_SEMICOLON ; |
|
1708 |
/. |
|
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)); |
|
1712 |
} break; |
|
1713 |
./ |
|
1714 |
||
1715 |
BreakStatement: T_BREAK T_IDENTIFIER T_AUTOMATIC_SEMICOLON ; -- automatic semicolon |
|
1716 |
BreakStatement: T_BREAK T_IDENTIFIER T_SEMICOLON ; |
|
1717 |
/. |
|
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)); |
|
1721 |
} break; |
|
1722 |
./ |
|
1723 |
||
1724 |
ReturnStatement: T_RETURN ExpressionOpt T_AUTOMATIC_SEMICOLON ; -- automatic semicolon |
|
1725 |
ReturnStatement: T_RETURN ExpressionOpt T_SEMICOLON ; |
|
1726 |
/. |
|
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)); |
|
1730 |
} break; |
|
1731 |
./ |
|
1732 |
||
1733 |
WithStatement: T_WITH T_LPAREN Expression T_RPAREN Statement ; |
|
1734 |
/. |
|
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)); |
|
1738 |
} break; |
|
1739 |
./ |
|
1740 |
||
1741 |
SwitchStatement: T_SWITCH T_LPAREN Expression T_RPAREN CaseBlock ; |
|
1742 |
/. |
|
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)); |
|
1746 |
} break; |
|
1747 |
./ |
|
1748 |
||
1749 |
CaseBlock: T_LBRACE CaseClausesOpt T_RBRACE ; |
|
1750 |
/. |
|
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)); |
|
1754 |
} break; |
|
1755 |
./ |
|
1756 |
||
1757 |
CaseBlock: T_LBRACE CaseClausesOpt DefaultClause CaseClausesOpt T_RBRACE ; |
|
1758 |
/. |
|
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)); |
|
1762 |
} break; |
|
1763 |
./ |
|
1764 |
||
1765 |
CaseClauses: CaseClause ; |
|
1766 |
/. |
|
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)); |
|
1770 |
} break; |
|
1771 |
./ |
|
1772 |
||
1773 |
CaseClauses: CaseClauses CaseClause ; |
|
1774 |
/. |
|
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)); |
|
1778 |
} break; |
|
1779 |
./ |
|
1780 |
||
1781 |
CaseClausesOpt: ; |
|
1782 |
/. |
|
1783 |
case $rule_number: { |
|
1784 |
sym(1).Node = 0; |
|
1785 |
} break; |
|
1786 |
./ |
|
1787 |
||
1788 |
CaseClausesOpt: CaseClauses ; |
|
1789 |
/. |
|
1790 |
case $rule_number: { |
|
1791 |
sym(1).Node = sym(1).CaseClauses->finish (); |
|
1792 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1)); |
|
1793 |
} break; |
|
1794 |
./ |
|
1795 |
||
1796 |
CaseClause: T_CASE Expression T_COLON StatementListOpt ; |
|
1797 |
/. |
|
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)); |
|
1801 |
} break; |
|
1802 |
./ |
|
1803 |
||
1804 |
DefaultClause: T_DEFAULT T_COLON StatementListOpt ; |
|
1805 |
/. |
|
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)); |
|
1809 |
} break; |
|
1810 |
./ |
|
1811 |
||
1812 |
LabelledStatement: T_IDENTIFIER T_COLON Statement ; |
|
1813 |
/. |
|
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)); |
|
1817 |
} break; |
|
1818 |
./ |
|
1819 |
||
1820 |
ThrowStatement: T_THROW Expression T_AUTOMATIC_SEMICOLON ; -- automatic semicolon |
|
1821 |
ThrowStatement: T_THROW Expression T_SEMICOLON ; |
|
1822 |
/. |
|
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)); |
|
1826 |
} break; |
|
1827 |
./ |
|
1828 |
||
1829 |
TryStatement: T_TRY Block Catch ; |
|
1830 |
/. |
|
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)); |
|
1834 |
} break; |
|
1835 |
./ |
|
1836 |
||
1837 |
TryStatement: T_TRY Block Finally ; |
|
1838 |
/. |
|
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)); |
|
1842 |
} break; |
|
1843 |
./ |
|
1844 |
||
1845 |
TryStatement: T_TRY Block Catch Finally ; |
|
1846 |
/. |
|
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)); |
|
1850 |
} break; |
|
1851 |
./ |
|
1852 |
||
1853 |
Catch: T_CATCH T_LPAREN T_IDENTIFIER T_RPAREN Block ; |
|
1854 |
/. |
|
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)); |
|
1858 |
} break; |
|
1859 |
./ |
|
1860 |
||
1861 |
Finally: T_FINALLY Block ; |
|
1862 |
/. |
|
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)); |
|
1866 |
} break; |
|
1867 |
./ |
|
1868 |
||
1869 |
DebuggerStatement: T_DEBUGGER T_AUTOMATIC_SEMICOLON ; -- automatic semicolon |
|
1870 |
DebuggerStatement: T_DEBUGGER T_SEMICOLON ; |
|
1871 |
/. |
|
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)); |
|
1875 |
} break; |
|
1876 |
./ |
|
1877 |
||
1878 |
FunctionDeclaration: T_FUNCTION T_IDENTIFIER T_LPAREN FormalParameterListOpt T_RPAREN T_LBRACE FunctionBodyOpt T_RBRACE ; |
|
1879 |
/. |
|
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)); |
|
1883 |
} break; |
|
1884 |
./ |
|
1885 |
||
1886 |
FunctionExpression: T_FUNCTION IdentifierOpt T_LPAREN FormalParameterListOpt T_RPAREN T_LBRACE FunctionBodyOpt T_RBRACE ; |
|
1887 |
/. |
|
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)); |
|
1891 |
} break; |
|
1892 |
./ |
|
1893 |
||
1894 |
FormalParameterList: T_IDENTIFIER ; |
|
1895 |
/. |
|
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)); |
|
1899 |
} break; |
|
1900 |
./ |
|
1901 |
||
1902 |
FormalParameterList: FormalParameterList T_COMMA T_IDENTIFIER ; |
|
1903 |
/. |
|
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)); |
|
1907 |
} break; |
|
1908 |
./ |
|
1909 |
||
1910 |
FormalParameterListOpt: ; |
|
1911 |
/. |
|
1912 |
case $rule_number: { |
|
1913 |
sym(1).Node = 0; |
|
1914 |
} break; |
|
1915 |
./ |
|
1916 |
||
1917 |
FormalParameterListOpt: FormalParameterList ; |
|
1918 |
/. |
|
1919 |
case $rule_number: { |
|
1920 |
sym(1).Node = sym(1).FormalParameterList->finish (); |
|
1921 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1)); |
|
1922 |
} break; |
|
1923 |
./ |
|
1924 |
||
1925 |
FunctionBodyOpt: ; |
|
1926 |
/. |
|
1927 |
case $rule_number: { |
|
1928 |
sym(1).Node = 0; |
|
1929 |
} break; |
|
1930 |
./ |
|
1931 |
||
1932 |
FunctionBodyOpt: FunctionBody ; |
|
1933 |
||
1934 |
FunctionBody: SourceElements ; |
|
1935 |
/. |
|
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)); |
|
1939 |
} break; |
|
1940 |
./ |
|
1941 |
||
1942 |
Program: SourceElements ; |
|
1943 |
/. |
|
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)); |
|
1948 |
} break; |
|
1949 |
./ |
|
1950 |
||
1951 |
SourceElements: SourceElement ; |
|
1952 |
/. |
|
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)); |
|
1956 |
} break; |
|
1957 |
./ |
|
1958 |
||
1959 |
SourceElements: SourceElements SourceElement ; |
|
1960 |
/. |
|
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)); |
|
1964 |
} break; |
|
1965 |
./ |
|
1966 |
||
1967 |
SourceElement: Statement ; |
|
1968 |
/. |
|
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)); |
|
1972 |
} break; |
|
1973 |
./ |
|
1974 |
||
1975 |
SourceElement: FunctionDeclaration ; |
|
1976 |
/. |
|
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)); |
|
1980 |
} break; |
|
1981 |
./ |
|
1982 |
||
1983 |
IdentifierOpt: ; |
|
1984 |
/. |
|
1985 |
case $rule_number: { |
|
1986 |
sym(1).sval = 0; |
|
1987 |
} break; |
|
1988 |
./ |
|
1989 |
||
1990 |
IdentifierOpt: T_IDENTIFIER ; |
|
1991 |
||
1992 |
PropertyNameAndValueListOpt: ; |
|
1993 |
/. |
|
1994 |
case $rule_number: { |
|
1995 |
sym(1).Node = 0; |
|
1996 |
} break; |
|
1997 |
./ |
|
1998 |
||
1999 |
PropertyNameAndValueListOpt: PropertyNameAndValueList ; |
|
2000 |
||
2001 |
/. |
|
2002 |
} // switch |
|
2003 |
||
2004 |
state_stack [tos] = nt_action (act, lhs [r] - TERMINAL_COUNT); |
|
2005 |
||
2006 |
if (rhs[r] > 1) { |
|
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]; |
|
2010 |
} |
|
2011 |
} |
|
2012 |
||
2013 |
else |
|
2014 |
{ |
|
2015 |
if (saved_yytoken == -1 && automatic (driver, yytoken) && t_action (state, T_AUTOMATIC_SEMICOLON) > 0) |
|
2016 |
{ |
|
2017 |
saved_yytoken = yytoken; |
|
2018 |
yytoken = T_SEMICOLON; |
|
2019 |
continue; |
|
2020 |
} |
|
2021 |
||
2022 |
else if ((state == INITIAL_STATE) && (yytoken == 0)) { |
|
2023 |
// accept empty input |
|
2024 |
yytoken = T_SEMICOLON; |
|
2025 |
continue; |
|
2026 |
} |
|
2027 |
||
2028 |
int ers = state; |
|
2029 |
int shifts = 0; |
|
2030 |
int reduces = 0; |
|
2031 |
int expected_tokens [3]; |
|
2032 |
for (int tk = 0; tk < TERMINAL_COUNT; ++tk) |
|
2033 |
{ |
|
2034 |
int k = t_action (ers, tk); |
|
2035 |
||
2036 |
if (! k) |
|
2037 |
continue; |
|
2038 |
else if (k < 0) |
|
2039 |
++reduces; |
|
2040 |
else if (spell [tk]) |
|
2041 |
{ |
|
2042 |
if (shifts < 3) |
|
2043 |
expected_tokens [shifts] = tk; |
|
2044 |
++shifts; |
|
2045 |
} |
|
2046 |
} |
|
2047 |
||
2048 |
error_message.clear (); |
|
2049 |
if (shifts && shifts < 3) |
|
2050 |
{ |
|
2051 |
bool first = true; |
|
2052 |
||
2053 |
for (int s = 0; s < shifts; ++s) |
|
2054 |
{ |
|
2055 |
if (first) |
|
2056 |
error_message += QLatin1String ("Expected "); |
|
2057 |
else |
|
2058 |
error_message += QLatin1String (", "); |
|
2059 |
||
2060 |
first = false; |
|
2061 |
error_message += QLatin1String("`"); |
|
2062 |
error_message += QLatin1String (spell [expected_tokens [s]]); |
|
2063 |
error_message += QLatin1String("'"); |
|
2064 |
} |
|
2065 |
} |
|
2066 |
||
2067 |
if (error_message.isEmpty()) |
|
2068 |
error_message = lexer->errorMessage(); |
|
2069 |
||
2070 |
error_lineno = lexer->startLineNo(); |
|
2071 |
error_column = lexer->startColumnNo(); |
|
2072 |
||
2073 |
return false; |
|
2074 |
} |
|
2075 |
} |
|
2076 |
||
2077 |
return false; |
|
2078 |
} |
|
2079 |
||
2080 |
QT_END_NAMESPACE |
|
2081 |
./ |
|
2082 |
/: |
|
2083 |
QT_END_NAMESPACE |
|
2084 |
||
2085 |
#endif // QSCRIPTPARSER_P_H |
|
2086 |
:/ |