0
|
1 |
// This file was generated by qlalr - DO NOT EDIT!
|
|
2 |
|
|
3 |
/****************************************************************************
|
|
4 |
**
|
|
5 |
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
6 |
** All rights reserved.
|
|
7 |
** Contact: Nokia Corporation (qt-info@nokia.com)
|
|
8 |
**
|
|
9 |
** This file is part of the QtScript module of the Qt Toolkit.
|
|
10 |
**
|
|
11 |
** $QT_BEGIN_LICENSE:LGPL$
|
|
12 |
** No Commercial Usage
|
|
13 |
** This file contains pre-release code and may not be distributed.
|
|
14 |
** You may use this file in accordance with the terms and conditions
|
|
15 |
** contained in the Technology Preview License Agreement accompanying
|
|
16 |
** this package.
|
|
17 |
**
|
|
18 |
** GNU Lesser General Public License Usage
|
|
19 |
** Alternatively, this file may be used under the terms of the GNU Lesser
|
|
20 |
** General Public License version 2.1 as published by the Free Software
|
|
21 |
** Foundation and appearing in the file LICENSE.LGPL included in the
|
|
22 |
** packaging of this file. Please review the following information to
|
|
23 |
** ensure the GNU Lesser General Public License version 2.1 requirements
|
|
24 |
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
|
25 |
**
|
|
26 |
** In addition, as a special exception, Nokia gives you certain additional
|
|
27 |
** rights. These rights are described in the Nokia Qt LGPL Exception
|
|
28 |
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
29 |
**
|
|
30 |
** If you have questions regarding the use of this file, please contact
|
|
31 |
** Nokia at qt-info@nokia.com.
|
|
32 |
**
|
|
33 |
**
|
|
34 |
**
|
|
35 |
**
|
|
36 |
**
|
|
37 |
**
|
|
38 |
**
|
|
39 |
**
|
|
40 |
** $QT_END_LICENSE$
|
|
41 |
**
|
|
42 |
****************************************************************************/
|
|
43 |
|
|
44 |
#include <QtCore/QtDebug>
|
|
45 |
|
|
46 |
#include <string.h>
|
|
47 |
|
|
48 |
#include "qscriptast_p.h"
|
|
49 |
|
|
50 |
#define Q_SCRIPT_UPDATE_POSITION(node, startloc, endloc) do { \
|
|
51 |
node->startLine = startloc.startLine; \
|
|
52 |
node->startColumn = startloc.startColumn; \
|
|
53 |
node->endLine = endloc.endLine; \
|
|
54 |
node->endColumn = endloc.endColumn; \
|
|
55 |
} while (0)
|
|
56 |
|
|
57 |
|
|
58 |
|
|
59 |
#include "qscriptparser_p.h"
|
|
60 |
|
|
61 |
//
|
|
62 |
// This file is automatically generated from qscript.g.
|
|
63 |
// Changes will be lost.
|
|
64 |
//
|
|
65 |
|
|
66 |
QT_BEGIN_NAMESPACE
|
|
67 |
|
|
68 |
inline static bool automatic(QScriptEnginePrivate *driver, int token)
|
|
69 |
{
|
|
70 |
return token == QScriptGrammar::T_RBRACE
|
|
71 |
|| token == 0
|
|
72 |
|| driver->lexer()->prevTerminator();
|
|
73 |
}
|
|
74 |
|
|
75 |
|
|
76 |
QScriptParser::QScriptParser():
|
|
77 |
tos(0),
|
|
78 |
stack_size(0),
|
|
79 |
sym_stack(0),
|
|
80 |
state_stack(0),
|
|
81 |
location_stack(0)
|
|
82 |
{
|
|
83 |
}
|
|
84 |
|
|
85 |
QScriptParser::~QScriptParser()
|
|
86 |
{
|
|
87 |
if (stack_size) {
|
|
88 |
qFree(sym_stack);
|
|
89 |
qFree(state_stack);
|
|
90 |
qFree(location_stack);
|
|
91 |
}
|
|
92 |
}
|
|
93 |
|
|
94 |
static inline QScriptParser::Location location(QScript::Lexer *lexer)
|
|
95 |
{
|
|
96 |
QScriptParser::Location loc;
|
|
97 |
loc.startLine = lexer->startLineNo();
|
|
98 |
loc.startColumn = lexer->startColumnNo();
|
|
99 |
loc.endLine = lexer->endLineNo();
|
|
100 |
loc.endColumn = lexer->endColumnNo();
|
|
101 |
return loc;
|
|
102 |
}
|
|
103 |
|
|
104 |
bool QScriptParser::parse(QScriptEnginePrivate *driver)
|
|
105 |
{
|
|
106 |
const int INITIAL_STATE = 0;
|
|
107 |
QScript::Lexer *lexer = driver->lexer();
|
|
108 |
|
|
109 |
int yytoken = -1;
|
|
110 |
int saved_yytoken = -1;
|
|
111 |
|
|
112 |
reallocateStack();
|
|
113 |
|
|
114 |
tos = 0;
|
|
115 |
state_stack[++tos] = INITIAL_STATE;
|
|
116 |
|
|
117 |
while (true)
|
|
118 |
{
|
|
119 |
const int state = state_stack [tos];
|
|
120 |
if (yytoken == -1 && - TERMINAL_COUNT != action_index [state])
|
|
121 |
{
|
|
122 |
if (saved_yytoken == -1)
|
|
123 |
{
|
|
124 |
yytoken = lexer->lex();
|
|
125 |
location_stack [tos] = location(lexer);
|
|
126 |
}
|
|
127 |
else
|
|
128 |
{
|
|
129 |
yytoken = saved_yytoken;
|
|
130 |
saved_yytoken = -1;
|
|
131 |
}
|
|
132 |
}
|
|
133 |
|
|
134 |
int act = t_action (state, yytoken);
|
|
135 |
|
|
136 |
if (act == ACCEPT_STATE)
|
|
137 |
return true;
|
|
138 |
|
|
139 |
else if (act > 0)
|
|
140 |
{
|
|
141 |
if (++tos == stack_size)
|
|
142 |
reallocateStack();
|
|
143 |
|
|
144 |
sym_stack [tos].dval = lexer->dval ();
|
|
145 |
state_stack [tos] = act;
|
|
146 |
location_stack [tos] = location(lexer);
|
|
147 |
yytoken = -1;
|
|
148 |
}
|
|
149 |
|
|
150 |
else if (act < 0)
|
|
151 |
{
|
|
152 |
int r = - act - 1;
|
|
153 |
|
|
154 |
tos -= rhs [r];
|
|
155 |
act = state_stack [tos++];
|
|
156 |
|
|
157 |
switch (r) {
|
|
158 |
|
|
159 |
case 0: {
|
|
160 |
sym(1).Node = QScript::makeAstNode<QScript::AST::ThisExpression> (driver->nodePool());
|
|
161 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
|
|
162 |
} break;
|
|
163 |
|
|
164 |
case 1: {
|
|
165 |
sym(1).Node = QScript::makeAstNode<QScript::AST::IdentifierExpression> (driver->nodePool(), sym(1).sval);
|
|
166 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
|
|
167 |
} break;
|
|
168 |
|
|
169 |
case 2: {
|
|
170 |
sym(1).Node = QScript::makeAstNode<QScript::AST::NullExpression> (driver->nodePool());
|
|
171 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
|
|
172 |
} break;
|
|
173 |
|
|
174 |
case 3: {
|
|
175 |
sym(1).Node = QScript::makeAstNode<QScript::AST::TrueLiteral> (driver->nodePool());
|
|
176 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
|
|
177 |
} break;
|
|
178 |
|
|
179 |
case 4: {
|
|
180 |
sym(1).Node = QScript::makeAstNode<QScript::AST::FalseLiteral> (driver->nodePool());
|
|
181 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
|
|
182 |
} break;
|
|
183 |
|
|
184 |
case 5: {
|
|
185 |
sym(1).Node = QScript::makeAstNode<QScript::AST::NumericLiteral> (driver->nodePool(), sym(1).dval);
|
|
186 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
|
|
187 |
} break;
|
|
188 |
|
|
189 |
case 6: {
|
|
190 |
sym(1).Node = QScript::makeAstNode<QScript::AST::StringLiteral> (driver->nodePool(), sym(1).sval);
|
|
191 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
|
|
192 |
} break;
|
|
193 |
|
|
194 |
case 7: {
|
|
195 |
bool rx = lexer->scanRegExp(QScript::Lexer::NoPrefix);
|
|
196 |
if (!rx) {
|
|
197 |
error_message = lexer->errorMessage();
|
|
198 |
error_lineno = lexer->startLineNo();
|
|
199 |
error_column = lexer->startColumnNo();
|
|
200 |
return false;
|
|
201 |
}
|
|
202 |
sym(1).Node = QScript::makeAstNode<QScript::AST::RegExpLiteral> (driver->nodePool(), lexer->pattern, lexer->flags);
|
|
203 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
|
|
204 |
} break;
|
|
205 |
|
|
206 |
case 8: {
|
|
207 |
bool rx = lexer->scanRegExp(QScript::Lexer::EqualPrefix);
|
|
208 |
if (!rx) {
|
|
209 |
error_message = lexer->errorMessage();
|
|
210 |
error_lineno = lexer->startLineNo();
|
|
211 |
error_column = lexer->startColumnNo();
|
|
212 |
return false;
|
|
213 |
}
|
|
214 |
sym(1).Node = QScript::makeAstNode<QScript::AST::RegExpLiteral> (driver->nodePool(), lexer->pattern, lexer->flags);
|
|
215 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
|
|
216 |
} break;
|
|
217 |
|
|
218 |
case 9: {
|
|
219 |
sym(1).Node = QScript::makeAstNode<QScript::AST::ArrayLiteral> (driver->nodePool(), sym(2).Elision);
|
|
220 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
|
221 |
} break;
|
|
222 |
|
|
223 |
case 10: {
|
|
224 |
sym(1).Node = QScript::makeAstNode<QScript::AST::ArrayLiteral> (driver->nodePool(), sym(2).ElementList->finish ());
|
|
225 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
|
226 |
} break;
|
|
227 |
|
|
228 |
case 11: {
|
|
229 |
sym(1).Node = QScript::makeAstNode<QScript::AST::ArrayLiteral> (driver->nodePool(), sym(2).ElementList->finish (), sym(4).Elision);
|
|
230 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(5));
|
|
231 |
} break;
|
|
232 |
|
|
233 |
case 12: {
|
|
234 |
if (sym(2).Node)
|
|
235 |
sym(1).Node = QScript::makeAstNode<QScript::AST::ObjectLiteral> (driver->nodePool(), sym(2).PropertyNameAndValueList->finish ());
|
|
236 |
else
|
|
237 |
sym(1).Node = QScript::makeAstNode<QScript::AST::ObjectLiteral> (driver->nodePool());
|
|
238 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
|
239 |
} break;
|
|
240 |
|
|
241 |
case 13: {
|
|
242 |
sym(1).Node = QScript::makeAstNode<QScript::AST::ObjectLiteral> (driver->nodePool(), sym(2).PropertyNameAndValueList->finish ());
|
|
243 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(4));
|
|
244 |
} break;
|
|
245 |
|
|
246 |
case 14: {
|
|
247 |
sym(1) = sym(2);
|
|
248 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
|
249 |
} break;
|
|
250 |
|
|
251 |
case 15: {
|
|
252 |
sym(1).Node = QScript::makeAstNode<QScript::AST::ElementList> (driver->nodePool(), sym(1).Elision, sym(2).Expression);
|
|
253 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
|
|
254 |
} break;
|
|
255 |
|
|
256 |
case 16: {
|
|
257 |
sym(1).Node = QScript::makeAstNode<QScript::AST::ElementList> (driver->nodePool(), sym(1).ElementList, sym(3).Elision, sym(4).Expression);
|
|
258 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(4));
|
|
259 |
} break;
|
|
260 |
|
|
261 |
case 17: {
|
|
262 |
sym(1).Node = QScript::makeAstNode<QScript::AST::Elision> (driver->nodePool());
|
|
263 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
|
|
264 |
} break;
|
|
265 |
|
|
266 |
case 18: {
|
|
267 |
sym(1).Node = QScript::makeAstNode<QScript::AST::Elision> (driver->nodePool(), sym(1).Elision);
|
|
268 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
|
|
269 |
} break;
|
|
270 |
|
|
271 |
case 19: {
|
|
272 |
sym(1).Node = 0;
|
|
273 |
} break;
|
|
274 |
|
|
275 |
case 20: {
|
|
276 |
sym(1).Elision = sym(1).Elision->finish ();
|
|
277 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
|
|
278 |
} break;
|
|
279 |
|
|
280 |
case 21: {
|
|
281 |
sym(1).Node = QScript::makeAstNode<QScript::AST::PropertyNameAndValueList> (driver->nodePool(), sym(1).PropertyName, sym(3).Expression);
|
|
282 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
|
283 |
} break;
|
|
284 |
|
|
285 |
case 22: {
|
|
286 |
sym(1).Node = QScript::makeAstNode<QScript::AST::PropertyNameAndValueList> (driver->nodePool(), sym(1).PropertyNameAndValueList, sym(3).PropertyName, sym(5).Expression);
|
|
287 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(5));
|
|
288 |
} break;
|
|
289 |
|
|
290 |
case 23: {
|
|
291 |
sym(1).Node = QScript::makeAstNode<QScript::AST::IdentifierPropertyName> (driver->nodePool(), sym(1).sval);
|
|
292 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
|
|
293 |
} break;
|
|
294 |
|
|
295 |
case 24: {
|
|
296 |
sym(1).Node = QScript::makeAstNode<QScript::AST::StringLiteralPropertyName> (driver->nodePool(), sym(1).sval);
|
|
297 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
|
|
298 |
} break;
|
|
299 |
|
|
300 |
case 25: {
|
|
301 |
sym(1).Node = QScript::makeAstNode<QScript::AST::NumericLiteralPropertyName> (driver->nodePool(), sym(1).dval);
|
|
302 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
|
|
303 |
} break;
|
|
304 |
|
|
305 |
case 26: {
|
|
306 |
sym(1).Node = QScript::makeAstNode<QScript::AST::IdentifierPropertyName> (driver->nodePool(), sym(1).sval);
|
|
307 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
|
|
308 |
} break;
|
|
309 |
|
|
310 |
case 27:
|
|
311 |
|
|
312 |
case 28:
|
|
313 |
|
|
314 |
case 29:
|
|
315 |
|
|
316 |
case 30:
|
|
317 |
|
|
318 |
case 31:
|
|
319 |
|
|
320 |
case 32:
|
|
321 |
|
|
322 |
case 33:
|
|
323 |
|
|
324 |
case 34:
|
|
325 |
|
|
326 |
case 35:
|
|
327 |
|
|
328 |
case 36:
|
|
329 |
|
|
330 |
case 37:
|
|
331 |
|
|
332 |
case 38:
|
|
333 |
|
|
334 |
case 39:
|
|
335 |
|
|
336 |
case 40:
|
|
337 |
|
|
338 |
case 41:
|
|
339 |
|
|
340 |
case 42:
|
|
341 |
|
|
342 |
case 43:
|
|
343 |
|
|
344 |
case 44:
|
|
345 |
|
|
346 |
case 45:
|
|
347 |
|
|
348 |
case 46:
|
|
349 |
|
|
350 |
case 47:
|
|
351 |
|
|
352 |
case 48:
|
|
353 |
|
|
354 |
case 49:
|
|
355 |
|
|
356 |
case 50:
|
|
357 |
|
|
358 |
case 51:
|
|
359 |
|
|
360 |
case 52:
|
|
361 |
|
|
362 |
case 53:
|
|
363 |
|
|
364 |
case 54:
|
|
365 |
|
|
366 |
case 55:
|
|
367 |
|
|
368 |
case 56:
|
|
369 |
|
|
370 |
case 57:
|
|
371 |
{
|
|
372 |
sym(1).sval = driver->intern(lexer->characterBuffer(), lexer->characterCount());
|
|
373 |
} break;
|
|
374 |
|
|
375 |
case 62: {
|
|
376 |
sym(1).Node = QScript::makeAstNode<QScript::AST::ArrayMemberExpression> (driver->nodePool(), sym(1).Expression, sym(3).Expression);
|
|
377 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(4));
|
|
378 |
} break;
|
|
379 |
|
|
380 |
case 63: {
|
|
381 |
sym(1).Node = QScript::makeAstNode<QScript::AST::FieldMemberExpression> (driver->nodePool(), sym(1).Expression, sym(3).sval);
|
|
382 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(4));
|
|
383 |
} break;
|
|
384 |
|
|
385 |
case 64: {
|
|
386 |
sym(1).Node = QScript::makeAstNode<QScript::AST::NewMemberExpression> (driver->nodePool(), sym(2).Expression, sym(3).ArgumentList);
|
|
387 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
|
388 |
} break;
|
|
389 |
|
|
390 |
case 66: {
|
|
391 |
sym(1).Node = QScript::makeAstNode<QScript::AST::NewExpression> (driver->nodePool(), sym(2).Expression);
|
|
392 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
|
|
393 |
} break;
|
|
394 |
|
|
395 |
case 67: {
|
|
396 |
sym(1).Node = QScript::makeAstNode<QScript::AST::CallExpression> (driver->nodePool(), sym(1).Expression, sym(2).ArgumentList);
|
|
397 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
|
|
398 |
} break;
|
|
399 |
|
|
400 |
case 68: {
|
|
401 |
sym(1).Node = QScript::makeAstNode<QScript::AST::CallExpression> (driver->nodePool(), sym(1).Expression, sym(2).ArgumentList);
|
|
402 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
|
|
403 |
} break;
|
|
404 |
|
|
405 |
case 69: {
|
|
406 |
sym(1).Node = QScript::makeAstNode<QScript::AST::ArrayMemberExpression> (driver->nodePool(), sym(1).Expression, sym(3).Expression);
|
|
407 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(4));
|
|
408 |
} break;
|
|
409 |
|
|
410 |
case 70: {
|
|
411 |
sym(1).Node = QScript::makeAstNode<QScript::AST::FieldMemberExpression> (driver->nodePool(), sym(1).Expression, sym(3).sval);
|
|
412 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
|
413 |
} break;
|
|
414 |
|
|
415 |
case 71: {
|
|
416 |
sym(1).Node = 0;
|
|
417 |
} break;
|
|
418 |
|
|
419 |
case 72: {
|
|
420 |
sym(1).Node = sym(2).ArgumentList->finish ();
|
|
421 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
|
422 |
} break;
|
|
423 |
|
|
424 |
case 73: {
|
|
425 |
sym(1).Node = QScript::makeAstNode<QScript::AST::ArgumentList> (driver->nodePool(), sym(1).Expression);
|
|
426 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
|
|
427 |
} break;
|
|
428 |
|
|
429 |
case 74: {
|
|
430 |
sym(1).Node = QScript::makeAstNode<QScript::AST::ArgumentList> (driver->nodePool(), sym(1).ArgumentList, sym(3).Expression);
|
|
431 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
|
432 |
} break;
|
|
433 |
|
|
434 |
case 78: {
|
|
435 |
sym(1).Node = QScript::makeAstNode<QScript::AST::PostIncrementExpression> (driver->nodePool(), sym(1).Expression);
|
|
436 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
|
|
437 |
} break;
|
|
438 |
|
|
439 |
case 79: {
|
|
440 |
sym(1).Node = QScript::makeAstNode<QScript::AST::PostDecrementExpression> (driver->nodePool(), sym(1).Expression);
|
|
441 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
|
|
442 |
} break;
|
|
443 |
|
|
444 |
case 81: {
|
|
445 |
sym(1).Node = QScript::makeAstNode<QScript::AST::DeleteExpression> (driver->nodePool(), sym(2).Expression);
|
|
446 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
|
|
447 |
} break;
|
|
448 |
|
|
449 |
case 82: {
|
|
450 |
sym(1).Node = QScript::makeAstNode<QScript::AST::VoidExpression> (driver->nodePool(), sym(2).Expression);
|
|
451 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
|
|
452 |
} break;
|
|
453 |
|
|
454 |
case 83: {
|
|
455 |
sym(1).Node = QScript::makeAstNode<QScript::AST::TypeOfExpression> (driver->nodePool(), sym(2).Expression);
|
|
456 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
|
|
457 |
} break;
|
|
458 |
|
|
459 |
case 84: {
|
|
460 |
sym(1).Node = QScript::makeAstNode<QScript::AST::PreIncrementExpression> (driver->nodePool(), sym(2).Expression);
|
|
461 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
|
|
462 |
} break;
|
|
463 |
|
|
464 |
case 85: {
|
|
465 |
sym(1).Node = QScript::makeAstNode<QScript::AST::PreDecrementExpression> (driver->nodePool(), sym(2).Expression);
|
|
466 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
|
|
467 |
} break;
|
|
468 |
|
|
469 |
case 86: {
|
|
470 |
sym(1).Node = QScript::makeAstNode<QScript::AST::UnaryPlusExpression> (driver->nodePool(), sym(2).Expression);
|
|
471 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
|
|
472 |
} break;
|
|
473 |
|
|
474 |
case 87: {
|
|
475 |
sym(1).Node = QScript::makeAstNode<QScript::AST::UnaryMinusExpression> (driver->nodePool(), sym(2).Expression);
|
|
476 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
|
|
477 |
} break;
|
|
478 |
|
|
479 |
case 88: {
|
|
480 |
sym(1).Node = QScript::makeAstNode<QScript::AST::TildeExpression> (driver->nodePool(), sym(2).Expression);
|
|
481 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
|
|
482 |
} break;
|
|
483 |
|
|
484 |
case 89: {
|
|
485 |
sym(1).Node = QScript::makeAstNode<QScript::AST::NotExpression> (driver->nodePool(), sym(2).Expression);
|
|
486 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
|
|
487 |
} break;
|
|
488 |
|
|
489 |
case 91: {
|
|
490 |
sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Mul, sym(3).Expression);
|
|
491 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
|
492 |
} break;
|
|
493 |
|
|
494 |
case 92: {
|
|
495 |
sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Div, sym(3).Expression);
|
|
496 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
|
497 |
} break;
|
|
498 |
|
|
499 |
case 93: {
|
|
500 |
sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Mod, sym(3).Expression);
|
|
501 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
|
502 |
} break;
|
|
503 |
|
|
504 |
case 95: {
|
|
505 |
sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Add, sym(3).Expression);
|
|
506 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
|
507 |
} break;
|
|
508 |
|
|
509 |
case 96: {
|
|
510 |
sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Sub, sym(3).Expression);
|
|
511 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
|
512 |
} break;
|
|
513 |
|
|
514 |
case 98: {
|
|
515 |
sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::LShift, sym(3).Expression);
|
|
516 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
|
517 |
} break;
|
|
518 |
|
|
519 |
case 99: {
|
|
520 |
sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::RShift, sym(3).Expression);
|
|
521 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
|
522 |
} break;
|
|
523 |
|
|
524 |
case 100: {
|
|
525 |
sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::URShift, sym(3).Expression);
|
|
526 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
|
527 |
} break;
|
|
528 |
|
|
529 |
case 102: {
|
|
530 |
sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Lt, sym(3).Expression);
|
|
531 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
|
532 |
} break;
|
|
533 |
|
|
534 |
case 103: {
|
|
535 |
sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Gt, sym(3).Expression);
|
|
536 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
|
537 |
} break;
|
|
538 |
|
|
539 |
case 104: {
|
|
540 |
sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Le, sym(3).Expression);
|
|
541 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
|
542 |
} break;
|
|
543 |
|
|
544 |
case 105: {
|
|
545 |
sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Ge, sym(3).Expression);
|
|
546 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
|
547 |
} break;
|
|
548 |
|
|
549 |
case 106: {
|
|
550 |
sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::InstanceOf, sym(3).Expression);
|
|
551 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
|
552 |
} break;
|
|
553 |
|
|
554 |
case 107: {
|
|
555 |
sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::In, sym(3).Expression);
|
|
556 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
|
557 |
} break;
|
|
558 |
|
|
559 |
case 109: {
|
|
560 |
sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Lt, sym(3).Expression);
|
|
561 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
|
562 |
} break;
|
|
563 |
|
|
564 |
case 110: {
|
|
565 |
sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Gt, sym(3).Expression);
|
|
566 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
|
567 |
} break;
|
|
568 |
|
|
569 |
case 111: {
|
|
570 |
sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Le, sym(3).Expression);
|
|
571 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
|
572 |
} break;
|
|
573 |
|
|
574 |
case 112: {
|
|
575 |
sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Ge, sym(3).Expression);
|
|
576 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
|
577 |
} break;
|
|
578 |
|
|
579 |
case 113: {
|
|
580 |
sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::InstanceOf, sym(3).Expression);
|
|
581 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
|
582 |
} break;
|
|
583 |
|
|
584 |
case 115: {
|
|
585 |
sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Equal, sym(3).Expression);
|
|
586 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
|
587 |
} break;
|
|
588 |
|
|
589 |
case 116: {
|
|
590 |
sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::NotEqual, sym(3).Expression);
|
|
591 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
|
592 |
} break;
|
|
593 |
|
|
594 |
case 117: {
|
|
595 |
sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::StrictEqual, sym(3).Expression);
|
|
596 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
|
597 |
} break;
|
|
598 |
|
|
599 |
case 118: {
|
|
600 |
sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::StrictNotEqual, sym(3).Expression);
|
|
601 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
|
602 |
} break;
|
|
603 |
|
|
604 |
case 120: {
|
|
605 |
sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Equal, sym(3).Expression);
|
|
606 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
|
607 |
} break;
|
|
608 |
|
|
609 |
case 121: {
|
|
610 |
sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::NotEqual, sym(3).Expression);
|
|
611 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
|
612 |
} break;
|
|
613 |
|
|
614 |
case 122: {
|
|
615 |
sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::StrictEqual, sym(3).Expression);
|
|
616 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
|
617 |
} break;
|
|
618 |
|
|
619 |
case 123: {
|
|
620 |
sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::StrictNotEqual, sym(3).Expression);
|
|
621 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
|
622 |
} break;
|
|
623 |
|
|
624 |
case 125: {
|
|
625 |
sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::BitAnd, sym(3).Expression);
|
|
626 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
|
627 |
} break;
|
|
628 |
|
|
629 |
case 127: {
|
|
630 |
sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::BitAnd, sym(3).Expression);
|
|
631 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
|
632 |
} break;
|
|
633 |
|
|
634 |
case 129: {
|
|
635 |
sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::BitXor, sym(3).Expression);
|
|
636 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
|
637 |
} break;
|
|
638 |
|
|
639 |
case 131: {
|
|
640 |
sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::BitXor, sym(3).Expression);
|
|
641 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
|
642 |
} break;
|
|
643 |
|
|
644 |
case 133: {
|
|
645 |
sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::BitOr, sym(3).Expression);
|
|
646 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
|
647 |
} break;
|
|
648 |
|
|
649 |
case 135: {
|
|
650 |
sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::BitOr, sym(3).Expression);
|
|
651 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
|
652 |
} break;
|
|
653 |
|
|
654 |
case 137: {
|
|
655 |
sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::And, sym(3).Expression);
|
|
656 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
|
657 |
} break;
|
|
658 |
|
|
659 |
case 139: {
|
|
660 |
sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::And, sym(3).Expression);
|
|
661 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
|
662 |
} break;
|
|
663 |
|
|
664 |
case 141: {
|
|
665 |
sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Or, sym(3).Expression);
|
|
666 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
|
667 |
} break;
|
|
668 |
|
|
669 |
case 143: {
|
|
670 |
sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Or, sym(3).Expression);
|
|
671 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
|
672 |
} break;
|
|
673 |
|
|
674 |
case 145: {
|
|
675 |
sym(1).Node = QScript::makeAstNode<QScript::AST::ConditionalExpression> (driver->nodePool(), sym(1).Expression, sym(3).Expression, sym(5).Expression);
|
|
676 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
|
677 |
} break;
|
|
678 |
|
|
679 |
case 147: {
|
|
680 |
sym(1).Node = QScript::makeAstNode<QScript::AST::ConditionalExpression> (driver->nodePool(), sym(1).Expression, sym(3).Expression, sym(5).Expression);
|
|
681 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
|
682 |
} break;
|
|
683 |
|
|
684 |
case 149: {
|
|
685 |
sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, sym(2).ival, sym(3).Expression);
|
|
686 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
|
687 |
} break;
|
|
688 |
|
|
689 |
case 151: {
|
|
690 |
sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, sym(2).ival, sym(3).Expression);
|
|
691 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
|
692 |
} break;
|
|
693 |
|
|
694 |
case 152: {
|
|
695 |
sym(1).ival = QSOperator::Assign;
|
|
696 |
} break;
|
|
697 |
|
|
698 |
case 153: {
|
|
699 |
sym(1).ival = QSOperator::InplaceMul;
|
|
700 |
} break;
|
|
701 |
|
|
702 |
case 154: {
|
|
703 |
sym(1).ival = QSOperator::InplaceDiv;
|
|
704 |
} break;
|
|
705 |
|
|
706 |
case 155: {
|
|
707 |
sym(1).ival = QSOperator::InplaceMod;
|
|
708 |
} break;
|
|
709 |
|
|
710 |
case 156: {
|
|
711 |
sym(1).ival = QSOperator::InplaceAdd;
|
|
712 |
} break;
|
|
713 |
|
|
714 |
case 157: {
|
|
715 |
sym(1).ival = QSOperator::InplaceSub;
|
|
716 |
} break;
|
|
717 |
|
|
718 |
case 158: {
|
|
719 |
sym(1).ival = QSOperator::InplaceLeftShift;
|
|
720 |
} break;
|
|
721 |
|
|
722 |
case 159: {
|
|
723 |
sym(1).ival = QSOperator::InplaceRightShift;
|
|
724 |
} break;
|
|
725 |
|
|
726 |
case 160: {
|
|
727 |
sym(1).ival = QSOperator::InplaceURightShift;
|
|
728 |
} break;
|
|
729 |
|
|
730 |
case 161: {
|
|
731 |
sym(1).ival = QSOperator::InplaceAnd;
|
|
732 |
} break;
|
|
733 |
|
|
734 |
case 162: {
|
|
735 |
sym(1).ival = QSOperator::InplaceXor;
|
|
736 |
} break;
|
|
737 |
|
|
738 |
case 163: {
|
|
739 |
sym(1).ival = QSOperator::InplaceOr;
|
|
740 |
} break;
|
|
741 |
|
|
742 |
case 165: {
|
|
743 |
sym(1).Node = QScript::makeAstNode<QScript::AST::Expression> (driver->nodePool(), sym(1).Expression, sym(3).Expression);
|
|
744 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
|
745 |
} break;
|
|
746 |
|
|
747 |
case 166: {
|
|
748 |
sym(1).Node = 0;
|
|
749 |
} break;
|
|
750 |
|
|
751 |
case 169: {
|
|
752 |
sym(1).Node = QScript::makeAstNode<QScript::AST::Expression> (driver->nodePool(), sym(1).Expression, sym(3).Expression);
|
|
753 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
|
754 |
} break;
|
|
755 |
|
|
756 |
case 170: {
|
|
757 |
sym(1).Node = 0;
|
|
758 |
} break;
|
|
759 |
|
|
760 |
case 187: {
|
|
761 |
sym(1).Node = QScript::makeAstNode<QScript::AST::Block> (driver->nodePool(), sym(2).StatementList);
|
|
762 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
|
763 |
} break;
|
|
764 |
|
|
765 |
case 188: {
|
|
766 |
sym(1).Node = QScript::makeAstNode<QScript::AST::StatementList> (driver->nodePool(), sym(1).Statement);
|
|
767 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
|
|
768 |
} break;
|
|
769 |
|
|
770 |
case 189: {
|
|
771 |
sym(1).Node = QScript::makeAstNode<QScript::AST::StatementList> (driver->nodePool(), sym(1).StatementList, sym(2).Statement);
|
|
772 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
|
|
773 |
} break;
|
|
774 |
|
|
775 |
case 190: {
|
|
776 |
sym(1).Node = 0;
|
|
777 |
} break;
|
|
778 |
|
|
779 |
case 191: {
|
|
780 |
sym(1).Node = sym(1).StatementList->finish ();
|
|
781 |
} break;
|
|
782 |
|
|
783 |
case 193: {
|
|
784 |
sym(1).Node = QScript::makeAstNode<QScript::AST::VariableStatement> (driver->nodePool(), sym(2).VariableDeclarationList->finish (/*readOnly=*/sym(1).ival == T_CONST));
|
|
785 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
|
786 |
} break;
|
|
787 |
|
|
788 |
case 194: {
|
|
789 |
sym(1).ival = T_CONST;
|
|
790 |
} break;
|
|
791 |
|
|
792 |
case 195: {
|
|
793 |
sym(1).ival = T_VAR;
|
|
794 |
} break;
|
|
795 |
|
|
796 |
case 196: {
|
|
797 |
sym(1).Node = QScript::makeAstNode<QScript::AST::VariableDeclarationList> (driver->nodePool(), sym(1).VariableDeclaration);
|
|
798 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
|
|
799 |
} break;
|
|
800 |
|
|
801 |
case 197: {
|
|
802 |
sym(1).Node = QScript::makeAstNode<QScript::AST::VariableDeclarationList> (driver->nodePool(), sym(1).VariableDeclarationList, sym(3).VariableDeclaration);
|
|
803 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
|
804 |
} break;
|
|
805 |
|
|
806 |
case 198: {
|
|
807 |
sym(1).Node = QScript::makeAstNode<QScript::AST::VariableDeclarationList> (driver->nodePool(), sym(1).VariableDeclaration);
|
|
808 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
|
|
809 |
} break;
|
|
810 |
|
|
811 |
case 199: {
|
|
812 |
sym(1).Node = QScript::makeAstNode<QScript::AST::VariableDeclarationList> (driver->nodePool(), sym(1).VariableDeclarationList, sym(3).VariableDeclaration);
|
|
813 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
|
814 |
} break;
|
|
815 |
|
|
816 |
case 200: {
|
|
817 |
sym(1).Node = QScript::makeAstNode<QScript::AST::VariableDeclaration> (driver->nodePool(), sym(1).sval, sym(2).Expression);
|
|
818 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
|
|
819 |
} break;
|
|
820 |
|
|
821 |
case 201: {
|
|
822 |
sym(1).Node = QScript::makeAstNode<QScript::AST::VariableDeclaration> (driver->nodePool(), sym(1).sval, sym(2).Expression);
|
|
823 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
|
|
824 |
} break;
|
|
825 |
|
|
826 |
case 202: {
|
|
827 |
sym(1) = sym(2);
|
|
828 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
|
|
829 |
} break;
|
|
830 |
|
|
831 |
case 203: {
|
|
832 |
sym(1).Node = 0;
|
|
833 |
} break;
|
|
834 |
|
|
835 |
case 205: {
|
|
836 |
sym(1) = sym(2);
|
|
837 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
|
|
838 |
} break;
|
|
839 |
|
|
840 |
case 206: {
|
|
841 |
sym(1).Node = 0;
|
|
842 |
} break;
|
|
843 |
|
|
844 |
case 208: {
|
|
845 |
sym(1).Node = QScript::makeAstNode<QScript::AST::EmptyStatement> (driver->nodePool());
|
|
846 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
|
|
847 |
} break;
|
|
848 |
|
|
849 |
case 210: {
|
|
850 |
sym(1).Node = QScript::makeAstNode<QScript::AST::ExpressionStatement> (driver->nodePool(), sym(1).Expression);
|
|
851 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
|
|
852 |
} break;
|
|
853 |
|
|
854 |
case 211: {
|
|
855 |
sym(1).Node = QScript::makeAstNode<QScript::AST::IfStatement> (driver->nodePool(), sym(3).Expression, sym(5).Statement, sym(7).Statement);
|
|
856 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(7));
|
|
857 |
} break;
|
|
858 |
|
|
859 |
case 212: {
|
|
860 |
sym(1).Node = QScript::makeAstNode<QScript::AST::IfStatement> (driver->nodePool(), sym(3).Expression, sym(5).Statement);
|
|
861 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(5));
|
|
862 |
} break;
|
|
863 |
|
|
864 |
case 214: {
|
|
865 |
sym(1).Node = QScript::makeAstNode<QScript::AST::DoWhileStatement> (driver->nodePool(), sym(2).Statement, sym(5).Expression);
|
|
866 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(7));
|
|
867 |
} break;
|
|
868 |
|
|
869 |
case 215: {
|
|
870 |
sym(1).Node = QScript::makeAstNode<QScript::AST::WhileStatement> (driver->nodePool(), sym(3).Expression, sym(5).Statement);
|
|
871 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(5));
|
|
872 |
} break;
|
|
873 |
|
|
874 |
case 216: {
|
|
875 |
sym(1).Node = QScript::makeAstNode<QScript::AST::ForStatement> (driver->nodePool(), sym(3).Expression, sym(5).Expression, sym(7).Expression, sym(9).Statement);
|
|
876 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(9));
|
|
877 |
} break;
|
|
878 |
|
|
879 |
case 217: {
|
|
880 |
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);
|
|
881 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(10));
|
|
882 |
} break;
|
|
883 |
|
|
884 |
case 218: {
|
|
885 |
sym(1).Node = QScript::makeAstNode<QScript::AST::ForEachStatement> (driver->nodePool(), sym(3).Expression, sym(5).Expression, sym(7).Statement);
|
|
886 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(7));
|
|
887 |
} break;
|
|
888 |
|
|
889 |
case 219: {
|
|
890 |
sym(1).Node = QScript::makeAstNode<QScript::AST::LocalForEachStatement> (driver->nodePool(), sym(4).VariableDeclaration, sym(6).Expression, sym(8).Statement);
|
|
891 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(8));
|
|
892 |
} break;
|
|
893 |
|
|
894 |
case 221: {
|
|
895 |
sym(1).Node = QScript::makeAstNode<QScript::AST::ContinueStatement> (driver->nodePool());
|
|
896 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
|
|
897 |
} break;
|
|
898 |
|
|
899 |
case 223: {
|
|
900 |
sym(1).Node = QScript::makeAstNode<QScript::AST::ContinueStatement> (driver->nodePool(), sym(2).sval);
|
|
901 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
|
902 |
} break;
|
|
903 |
|
|
904 |
case 225: {
|
|
905 |
sym(1).Node = QScript::makeAstNode<QScript::AST::BreakStatement> (driver->nodePool());
|
|
906 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
|
|
907 |
} break;
|
|
908 |
|
|
909 |
case 227: {
|
|
910 |
sym(1).Node = QScript::makeAstNode<QScript::AST::BreakStatement> (driver->nodePool(), sym(2).sval);
|
|
911 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
|
912 |
} break;
|
|
913 |
|
|
914 |
case 229: {
|
|
915 |
sym(1).Node = QScript::makeAstNode<QScript::AST::ReturnStatement> (driver->nodePool(), sym(2).Expression);
|
|
916 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
|
917 |
} break;
|
|
918 |
|
|
919 |
case 230: {
|
|
920 |
sym(1).Node = QScript::makeAstNode<QScript::AST::WithStatement> (driver->nodePool(), sym(3).Expression, sym(5).Statement);
|
|
921 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(5));
|
|
922 |
} break;
|
|
923 |
|
|
924 |
case 231: {
|
|
925 |
sym(1).Node = QScript::makeAstNode<QScript::AST::SwitchStatement> (driver->nodePool(), sym(3).Expression, sym(5).CaseBlock);
|
|
926 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(5));
|
|
927 |
} break;
|
|
928 |
|
|
929 |
case 232: {
|
|
930 |
sym(1).Node = QScript::makeAstNode<QScript::AST::CaseBlock> (driver->nodePool(), sym(2).CaseClauses);
|
|
931 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
|
932 |
} break;
|
|
933 |
|
|
934 |
case 233: {
|
|
935 |
sym(1).Node = QScript::makeAstNode<QScript::AST::CaseBlock> (driver->nodePool(), sym(2).CaseClauses, sym(3).DefaultClause, sym(4).CaseClauses);
|
|
936 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(5));
|
|
937 |
} break;
|
|
938 |
|
|
939 |
case 234: {
|
|
940 |
sym(1).Node = QScript::makeAstNode<QScript::AST::CaseClauses> (driver->nodePool(), sym(1).CaseClause);
|
|
941 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
|
|
942 |
} break;
|
|
943 |
|
|
944 |
case 235: {
|
|
945 |
sym(1).Node = QScript::makeAstNode<QScript::AST::CaseClauses> (driver->nodePool(), sym(1).CaseClauses, sym(2).CaseClause);
|
|
946 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
|
|
947 |
} break;
|
|
948 |
|
|
949 |
case 236: {
|
|
950 |
sym(1).Node = 0;
|
|
951 |
} break;
|
|
952 |
|
|
953 |
case 237: {
|
|
954 |
sym(1).Node = sym(1).CaseClauses->finish ();
|
|
955 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
|
|
956 |
} break;
|
|
957 |
|
|
958 |
case 238: {
|
|
959 |
sym(1).Node = QScript::makeAstNode<QScript::AST::CaseClause> (driver->nodePool(), sym(2).Expression, sym(4).StatementList);
|
|
960 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(4));
|
|
961 |
} break;
|
|
962 |
|
|
963 |
case 239: {
|
|
964 |
sym(1).Node = QScript::makeAstNode<QScript::AST::DefaultClause> (driver->nodePool(), sym(3).StatementList);
|
|
965 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
|
966 |
} break;
|
|
967 |
|
|
968 |
case 240: {
|
|
969 |
sym(1).Node = QScript::makeAstNode<QScript::AST::LabelledStatement> (driver->nodePool(), sym(1).sval, sym(3).Statement);
|
|
970 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
|
971 |
} break;
|
|
972 |
|
|
973 |
case 242: {
|
|
974 |
sym(1).Node = QScript::makeAstNode<QScript::AST::ThrowStatement> (driver->nodePool(), sym(2).Expression);
|
|
975 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
|
976 |
} break;
|
|
977 |
|
|
978 |
case 243: {
|
|
979 |
sym(1).Node = QScript::makeAstNode<QScript::AST::TryStatement> (driver->nodePool(), sym(2).Statement, sym(3).Catch);
|
|
980 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
|
981 |
} break;
|
|
982 |
|
|
983 |
case 244: {
|
|
984 |
sym(1).Node = QScript::makeAstNode<QScript::AST::TryStatement> (driver->nodePool(), sym(2).Statement, sym(3).Finally);
|
|
985 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
|
986 |
} break;
|
|
987 |
|
|
988 |
case 245: {
|
|
989 |
sym(1).Node = QScript::makeAstNode<QScript::AST::TryStatement> (driver->nodePool(), sym(2).Statement, sym(3).Catch, sym(4).Finally);
|
|
990 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(4));
|
|
991 |
} break;
|
|
992 |
|
|
993 |
case 246: {
|
|
994 |
sym(1).Node = QScript::makeAstNode<QScript::AST::Catch> (driver->nodePool(), sym(3).sval, sym(5).Statement);
|
|
995 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(5));
|
|
996 |
} break;
|
|
997 |
|
|
998 |
case 247: {
|
|
999 |
sym(1).Node = QScript::makeAstNode<QScript::AST::Finally> (driver->nodePool(), sym(2).Statement);
|
|
1000 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
|
|
1001 |
} break;
|
|
1002 |
|
|
1003 |
case 249: {
|
|
1004 |
sym(1).Node = QScript::makeAstNode<QScript::AST::DebuggerStatement> (driver->nodePool());
|
|
1005 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
|
|
1006 |
} break;
|
|
1007 |
|
|
1008 |
case 250: {
|
|
1009 |
sym(1).Node = QScript::makeAstNode<QScript::AST::FunctionDeclaration> (driver->nodePool(), sym(2).sval, sym(4).FormalParameterList, sym(7).FunctionBody);
|
|
1010 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(8));
|
|
1011 |
} break;
|
|
1012 |
|
|
1013 |
case 251: {
|
|
1014 |
sym(1).Node = QScript::makeAstNode<QScript::AST::FunctionExpression> (driver->nodePool(), sym(2).sval, sym(4).FormalParameterList, sym(7).FunctionBody);
|
|
1015 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(8));
|
|
1016 |
} break;
|
|
1017 |
|
|
1018 |
case 252: {
|
|
1019 |
sym(1).Node = QScript::makeAstNode<QScript::AST::FormalParameterList> (driver->nodePool(), sym(1).sval);
|
|
1020 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
|
|
1021 |
} break;
|
|
1022 |
|
|
1023 |
case 253: {
|
|
1024 |
sym(1).Node = QScript::makeAstNode<QScript::AST::FormalParameterList> (driver->nodePool(), sym(1).FormalParameterList, sym(3).sval);
|
|
1025 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
|
1026 |
} break;
|
|
1027 |
|
|
1028 |
case 254: {
|
|
1029 |
sym(1).Node = 0;
|
|
1030 |
} break;
|
|
1031 |
|
|
1032 |
case 255: {
|
|
1033 |
sym(1).Node = sym(1).FormalParameterList->finish ();
|
|
1034 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
|
|
1035 |
} break;
|
|
1036 |
|
|
1037 |
case 256: {
|
|
1038 |
sym(1).Node = 0;
|
|
1039 |
} break;
|
|
1040 |
|
|
1041 |
case 258: {
|
|
1042 |
sym(1).Node = QScript::makeAstNode<QScript::AST::FunctionBody> (driver->nodePool(), sym(1).SourceElements->finish ());
|
|
1043 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
|
|
1044 |
} break;
|
|
1045 |
|
|
1046 |
case 259: {
|
|
1047 |
sym(1).Node = QScript::makeAstNode<QScript::AST::Program> (driver->nodePool(), sym(1).SourceElements->finish ());
|
|
1048 |
driver->changeAbstractSyntaxTree(sym(1).Node);
|
|
1049 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
|
|
1050 |
} break;
|
|
1051 |
|
|
1052 |
case 260: {
|
|
1053 |
sym(1).Node = QScript::makeAstNode<QScript::AST::SourceElements> (driver->nodePool(), sym(1).SourceElement);
|
|
1054 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
|
|
1055 |
} break;
|
|
1056 |
|
|
1057 |
case 261: {
|
|
1058 |
sym(1).Node = QScript::makeAstNode<QScript::AST::SourceElements> (driver->nodePool(), sym(1).SourceElements, sym(2).SourceElement);
|
|
1059 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
|
|
1060 |
} break;
|
|
1061 |
|
|
1062 |
case 262: {
|
|
1063 |
sym(1).Node = QScript::makeAstNode<QScript::AST::StatementSourceElement> (driver->nodePool(), sym(1).Statement);
|
|
1064 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
|
|
1065 |
} break;
|
|
1066 |
|
|
1067 |
case 263: {
|
|
1068 |
sym(1).Node = QScript::makeAstNode<QScript::AST::FunctionSourceElement> (driver->nodePool(), sym(1).FunctionDeclaration);
|
|
1069 |
Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
|
|
1070 |
} break;
|
|
1071 |
|
|
1072 |
case 264: {
|
|
1073 |
sym(1).sval = 0;
|
|
1074 |
} break;
|
|
1075 |
|
|
1076 |
case 266: {
|
|
1077 |
sym(1).Node = 0;
|
|
1078 |
} break;
|
|
1079 |
|
|
1080 |
} // switch
|
|
1081 |
|
|
1082 |
state_stack [tos] = nt_action (act, lhs [r] - TERMINAL_COUNT);
|
|
1083 |
|
|
1084 |
if (rhs[r] > 1) {
|
|
1085 |
location_stack[tos - 1].endLine = location_stack[tos + rhs[r] - 2].endLine;
|
|
1086 |
location_stack[tos - 1].endColumn = location_stack[tos + rhs[r] - 2].endColumn;
|
|
1087 |
location_stack[tos] = location_stack[tos + rhs[r] - 1];
|
|
1088 |
}
|
|
1089 |
}
|
|
1090 |
|
|
1091 |
else
|
|
1092 |
{
|
|
1093 |
if (saved_yytoken == -1 && automatic (driver, yytoken) && t_action (state, T_AUTOMATIC_SEMICOLON) > 0)
|
|
1094 |
{
|
|
1095 |
saved_yytoken = yytoken;
|
|
1096 |
yytoken = T_SEMICOLON;
|
|
1097 |
continue;
|
|
1098 |
}
|
|
1099 |
|
|
1100 |
else if ((state == INITIAL_STATE) && (yytoken == 0)) {
|
|
1101 |
// accept empty input
|
|
1102 |
yytoken = T_SEMICOLON;
|
|
1103 |
continue;
|
|
1104 |
}
|
|
1105 |
|
|
1106 |
int ers = state;
|
|
1107 |
int shifts = 0;
|
|
1108 |
int reduces = 0;
|
|
1109 |
int expected_tokens [3];
|
|
1110 |
for (int tk = 0; tk < TERMINAL_COUNT; ++tk)
|
|
1111 |
{
|
|
1112 |
int k = t_action (ers, tk);
|
|
1113 |
|
|
1114 |
if (! k)
|
|
1115 |
continue;
|
|
1116 |
else if (k < 0)
|
|
1117 |
++reduces;
|
|
1118 |
else if (spell [tk])
|
|
1119 |
{
|
|
1120 |
if (shifts < 3)
|
|
1121 |
expected_tokens [shifts] = tk;
|
|
1122 |
++shifts;
|
|
1123 |
}
|
|
1124 |
}
|
|
1125 |
|
|
1126 |
error_message.clear ();
|
|
1127 |
if (shifts && shifts < 3)
|
|
1128 |
{
|
|
1129 |
bool first = true;
|
|
1130 |
|
|
1131 |
for (int s = 0; s < shifts; ++s)
|
|
1132 |
{
|
|
1133 |
if (first)
|
|
1134 |
error_message += QLatin1String ("Expected ");
|
|
1135 |
else
|
|
1136 |
error_message += QLatin1String (", ");
|
|
1137 |
|
|
1138 |
first = false;
|
|
1139 |
error_message += QLatin1Char('`');
|
|
1140 |
error_message += QLatin1String (spell [expected_tokens [s]]);
|
|
1141 |
error_message += QLatin1Char('\'');
|
|
1142 |
}
|
|
1143 |
}
|
|
1144 |
|
|
1145 |
if (error_message.isEmpty())
|
|
1146 |
error_message = lexer->errorMessage();
|
|
1147 |
|
|
1148 |
error_lineno = lexer->startLineNo();
|
|
1149 |
error_column = lexer->startColumnNo();
|
|
1150 |
|
|
1151 |
return false;
|
|
1152 |
}
|
|
1153 |
}
|
|
1154 |
|
|
1155 |
return false;
|
|
1156 |
}
|
|
1157 |
|
|
1158 |
QT_END_NAMESPACE
|