1 | ----------------------------------------------------------------------------
|
---|
2 | --
|
---|
3 | -- Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
---|
4 | -- Contact: Qt Software Information ([email protected])
|
---|
5 | --
|
---|
6 | -- This file is part of the QtScript module of the Qt Toolkit.
|
---|
7 | --
|
---|
8 | -- $QT_BEGIN_LICENSE:LGPL$
|
---|
9 | -- Commercial Usage
|
---|
10 | -- Licensees holding valid Qt Commercial licenses may use this file in
|
---|
11 | -- accordance with the Qt Commercial License Agreement provided with the
|
---|
12 | -- Software or, alternatively, in accordance with the terms contained in
|
---|
13 | -- a written agreement between you and Nokia.
|
---|
14 | --
|
---|
15 | -- GNU Lesser General Public License Usage
|
---|
16 | -- Alternatively, this file may be used under the terms of the GNU Lesser
|
---|
17 | -- General Public License version 2.1 as published by the Free Software
|
---|
18 | -- Foundation and appearing in the file LICENSE.LGPL included in the
|
---|
19 | -- packaging of this file. Please review the following information to
|
---|
20 | -- ensure the GNU Lesser General Public License version 2.1 requirements
|
---|
21 | -- will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
---|
22 | --
|
---|
23 | -- In addition, as a special exception, Nokia gives you certain
|
---|
24 | -- additional rights. These rights are described in the Nokia Qt LGPL
|
---|
25 | -- Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
|
---|
26 | -- package.
|
---|
27 | --
|
---|
28 | -- GNU General Public License Usage
|
---|
29 | -- Alternatively, this file may be used under the terms of the GNU
|
---|
30 | -- General Public License version 3.0 as published by the Free Software
|
---|
31 | -- Foundation and appearing in the file LICENSE.GPL included in the
|
---|
32 | -- packaging of this file. Please review the following information to
|
---|
33 | -- ensure the GNU General Public License version 3.0 requirements will be
|
---|
34 | -- met: http://www.gnu.org/copyleft/gpl.html.
|
---|
35 | --
|
---|
36 | -- If you are unsure which license is appropriate for your use, please
|
---|
37 | -- contact the sales department at [email protected].
|
---|
38 | -- $QT_END_LICENSE$
|
---|
39 | --
|
---|
40 | -- This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
---|
41 | -- WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
---|
42 | --
|
---|
43 | ----------------------------------------------------------------------------
|
---|
44 |
|
---|
45 | %parser QScriptGrammar
|
---|
46 | %decl qscriptparser_p.h
|
---|
47 | %impl qscriptparser.cpp
|
---|
48 | %expect 3
|
---|
49 | %expect-rr 1
|
---|
50 |
|
---|
51 | %token T_AND "&" T_AND_AND "&&" T_AND_EQ "&="
|
---|
52 | %token T_BREAK "break" T_CASE "case" T_CATCH "catch"
|
---|
53 | %token T_COLON ":" T_COMMA ";" T_CONTINUE "continue"
|
---|
54 | %token T_DEFAULT "default" T_DELETE "delete" T_DIVIDE_ "/"
|
---|
55 | %token T_DIVIDE_EQ "/=" T_DO "do" T_DOT "."
|
---|
56 | %token T_ELSE "else" T_EQ "=" T_EQ_EQ "=="
|
---|
57 | %token T_EQ_EQ_EQ "===" T_FINALLY "finally" T_FOR "for"
|
---|
58 | %token T_FUNCTION "function" T_GE ">=" T_GT ">"
|
---|
59 | %token T_GT_GT ">>" T_GT_GT_EQ ">>=" T_GT_GT_GT ">>>"
|
---|
60 | %token T_GT_GT_GT_EQ ">>>=" T_IDENTIFIER "identifier" T_IF "if"
|
---|
61 | %token T_IN "in" T_INSTANCEOF "instanceof" T_LBRACE "{"
|
---|
62 | %token T_LBRACKET "[" T_LE "<=" T_LPAREN "("
|
---|
63 | %token T_LT "<" T_LT_LT "<<" T_LT_LT_EQ "<<="
|
---|
64 | %token T_MINUS "-" T_MINUS_EQ "-=" T_MINUS_MINUS "--"
|
---|
65 | %token T_NEW "new" T_NOT "!" T_NOT_EQ "!="
|
---|
66 | %token T_NOT_EQ_EQ "!==" T_NUMERIC_LITERAL "numeric literal" T_OR "|"
|
---|
67 | %token T_OR_EQ "|=" T_OR_OR "||" T_PLUS "+"
|
---|
68 | %token T_PLUS_EQ "+=" T_PLUS_PLUS "++" T_QUESTION "?"
|
---|
69 | %token T_RBRACE "}" T_RBRACKET "]" T_REMAINDER "%"
|
---|
70 | %token T_REMAINDER_EQ "%=" T_RETURN "return" T_RPAREN ")"
|
---|
71 | %token T_SEMICOLON ";" T_AUTOMATIC_SEMICOLON T_STAR "*"
|
---|
72 | %token T_STAR_EQ "*=" T_STRING_LITERAL "string literal"
|
---|
73 | %token T_SWITCH "switch" T_THIS "this" T_THROW "throw"
|
---|
74 | %token T_TILDE "~" T_TRY "try" T_TYPEOF "typeof"
|
---|
75 | %token T_VAR "var" T_VOID "void" T_WHILE "while"
|
---|
76 | %token T_WITH "with" T_XOR "^" T_XOR_EQ "^="
|
---|
77 | %token T_NULL "null" T_TRUE "true" T_FALSE "false"
|
---|
78 | %token T_CONST "const"
|
---|
79 | %token T_DEBUGGER "debugger"
|
---|
80 | %token T_RESERVED_WORD "reserved word"
|
---|
81 |
|
---|
82 | %start Program
|
---|
83 |
|
---|
84 | /.
|
---|
85 | /****************************************************************************
|
---|
86 | **
|
---|
87 | ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
---|
88 | ** Contact: Qt Software Information ([email protected])
|
---|
89 | **
|
---|
90 | ** This file is part of the QtScript module of the Qt Toolkit.
|
---|
91 | **
|
---|
92 | ** $QT_BEGIN_LICENSE:LGPL$
|
---|
93 | ** Commercial Usage
|
---|
94 | ** Licensees holding valid Qt Commercial licenses may use this file in
|
---|
95 | ** accordance with the Qt Commercial License Agreement provided with the
|
---|
96 | ** Software or, alternatively, in accordance with the terms contained in
|
---|
97 | ** a written agreement between you and Nokia.
|
---|
98 | **
|
---|
99 | ** GNU Lesser General Public License Usage
|
---|
100 | ** Alternatively, this file may be used under the terms of the GNU Lesser
|
---|
101 | ** General Public License version 2.1 as published by the Free Software
|
---|
102 | ** Foundation and appearing in the file LICENSE.LGPL included in the
|
---|
103 | ** packaging of this file. Please review the following information to
|
---|
104 | ** ensure the GNU Lesser General Public License version 2.1 requirements
|
---|
105 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
---|
106 | **
|
---|
107 | ** In addition, as a special exception, Nokia gives you certain
|
---|
108 | ** additional rights. These rights are described in the Nokia Qt LGPL
|
---|
109 | ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
|
---|
110 | ** package.
|
---|
111 | **
|
---|
112 | ** GNU General Public License Usage
|
---|
113 | ** Alternatively, this file may be used under the terms of the GNU
|
---|
114 | ** General Public License version 3.0 as published by the Free Software
|
---|
115 | ** Foundation and appearing in the file LICENSE.GPL included in the
|
---|
116 | ** packaging of this file. Please review the following information to
|
---|
117 | ** ensure the GNU General Public License version 3.0 requirements will be
|
---|
118 | ** met: http://www.gnu.org/copyleft/gpl.html.
|
---|
119 | **
|
---|
120 | ** If you are unsure which license is appropriate for your use, please
|
---|
121 | ** contact the sales department at [email protected].
|
---|
122 | ** $QT_END_LICENSE$
|
---|
123 | **
|
---|
124 | ****************************************************************************/
|
---|
125 |
|
---|
126 | #include <QtCore/QtDebug>
|
---|
127 |
|
---|
128 | #ifndef QT_NO_SCRIPT
|
---|
129 |
|
---|
130 | #include <string.h>
|
---|
131 |
|
---|
132 | #include "qscriptengine.h"
|
---|
133 | #include "qscriptengine_p.h"
|
---|
134 | #include "qscriptvalueimpl_p.h"
|
---|
135 | #include "qscriptcontext_p.h"
|
---|
136 | #include "qscriptmember_p.h"
|
---|
137 | #include "qscriptobject_p.h"
|
---|
138 | #include "qscriptlexer_p.h"
|
---|
139 | #include "qscriptast_p.h"
|
---|
140 | #include "qscriptnodepool_p.h"
|
---|
141 |
|
---|
142 | #define Q_SCRIPT_UPDATE_POSITION(node, startloc, endloc) do { \
|
---|
143 | node->startLine = startloc.startLine; \
|
---|
144 | node->startColumn = startloc.startColumn; \
|
---|
145 | node->endLine = endloc.endLine; \
|
---|
146 | node->endColumn = endloc.endColumn; \
|
---|
147 | } while (0)
|
---|
148 |
|
---|
149 | ./
|
---|
150 |
|
---|
151 | /:
|
---|
152 | /****************************************************************************
|
---|
153 | **
|
---|
154 | ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
---|
155 | ** Contact: Qt Software Information ([email protected])
|
---|
156 | **
|
---|
157 | ** This file is part of the QtScript module of the Qt Toolkit.
|
---|
158 | **
|
---|
159 | ** $QT_BEGIN_LICENSE:LGPL$
|
---|
160 | ** Commercial Usage
|
---|
161 | ** Licensees holding valid Qt Commercial licenses may use this file in
|
---|
162 | ** accordance with the Qt Commercial License Agreement provided with the
|
---|
163 | ** Software or, alternatively, in accordance with the terms contained in
|
---|
164 | ** a written agreement between you and Nokia.
|
---|
165 | **
|
---|
166 | ** GNU Lesser General Public License Usage
|
---|
167 | ** Alternatively, this file may be used under the terms of the GNU Lesser
|
---|
168 | ** General Public License version 2.1 as published by the Free Software
|
---|
169 | ** Foundation and appearing in the file LICENSE.LGPL included in the
|
---|
170 | ** packaging of this file. Please review the following information to
|
---|
171 | ** ensure the GNU Lesser General Public License version 2.1 requirements
|
---|
172 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
---|
173 | **
|
---|
174 | ** In addition, as a special exception, Nokia gives you certain
|
---|
175 | ** additional rights. These rights are described in the Nokia Qt LGPL
|
---|
176 | ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
|
---|
177 | ** package.
|
---|
178 | **
|
---|
179 | ** GNU General Public License Usage
|
---|
180 | ** Alternatively, this file may be used under the terms of the GNU
|
---|
181 | ** General Public License version 3.0 as published by the Free Software
|
---|
182 | ** Foundation and appearing in the file LICENSE.GPL included in the
|
---|
183 | ** packaging of this file. Please review the following information to
|
---|
184 | ** ensure the GNU General Public License version 3.0 requirements will be
|
---|
185 | ** met: http://www.gnu.org/copyleft/gpl.html.
|
---|
186 | **
|
---|
187 | ** If you are unsure which license is appropriate for your use, please
|
---|
188 | ** contact the sales department at [email protected].
|
---|
189 | ** $QT_END_LICENSE$
|
---|
190 | **
|
---|
191 | ****************************************************************************/
|
---|
192 |
|
---|
193 | //
|
---|
194 | // W A R N I N G
|
---|
195 | // -------------
|
---|
196 | //
|
---|
197 | // This file is not part of the Qt API. It exists purely as an
|
---|
198 | // implementation detail. This header file may change from version to
|
---|
199 | // version without notice, or even be removed.
|
---|
200 | //
|
---|
201 | // We mean it.
|
---|
202 | //
|
---|
203 |
|
---|
204 | //
|
---|
205 | // This file is automatically generated from qscript.g.
|
---|
206 | // Changes will be lost.
|
---|
207 | //
|
---|
208 |
|
---|
209 | #ifndef QSCRIPTPARSER_P_H
|
---|
210 | #define QSCRIPTPARSER_P_H
|
---|
211 |
|
---|
212 | #include "qscriptgrammar_p.h"
|
---|
213 |
|
---|
214 | #ifndef QT_NO_SCRIPT
|
---|
215 |
|
---|
216 | #include "qscriptastfwd_p.h"
|
---|
217 |
|
---|
218 | QT_BEGIN_NAMESPACE
|
---|
219 |
|
---|
220 | class QString;
|
---|
221 | class QScriptEnginePrivate;
|
---|
222 | class QScriptNameIdImpl;
|
---|
223 |
|
---|
224 | class QScriptParser: protected $table
|
---|
225 | {
|
---|
226 | public:
|
---|
227 | union Value {
|
---|
228 | int ival;
|
---|
229 | double dval;
|
---|
230 | QScriptNameIdImpl *sval;
|
---|
231 | QScript::AST::ArgumentList *ArgumentList;
|
---|
232 | QScript::AST::CaseBlock *CaseBlock;
|
---|
233 | QScript::AST::CaseClause *CaseClause;
|
---|
234 | QScript::AST::CaseClauses *CaseClauses;
|
---|
235 | QScript::AST::Catch *Catch;
|
---|
236 | QScript::AST::DefaultClause *DefaultClause;
|
---|
237 | QScript::AST::ElementList *ElementList;
|
---|
238 | QScript::AST::Elision *Elision;
|
---|
239 | QScript::AST::ExpressionNode *Expression;
|
---|
240 | QScript::AST::Finally *Finally;
|
---|
241 | QScript::AST::FormalParameterList *FormalParameterList;
|
---|
242 | QScript::AST::FunctionBody *FunctionBody;
|
---|
243 | QScript::AST::FunctionDeclaration *FunctionDeclaration;
|
---|
244 | QScript::AST::Node *Node;
|
---|
245 | QScript::AST::PropertyName *PropertyName;
|
---|
246 | QScript::AST::PropertyNameAndValueList *PropertyNameAndValueList;
|
---|
247 | QScript::AST::SourceElement *SourceElement;
|
---|
248 | QScript::AST::SourceElements *SourceElements;
|
---|
249 | QScript::AST::Statement *Statement;
|
---|
250 | QScript::AST::StatementList *StatementList;
|
---|
251 | QScript::AST::VariableDeclaration *VariableDeclaration;
|
---|
252 | QScript::AST::VariableDeclarationList *VariableDeclarationList;
|
---|
253 | };
|
---|
254 |
|
---|
255 | struct Location {
|
---|
256 | int startLine;
|
---|
257 | int startColumn;
|
---|
258 | int endLine;
|
---|
259 | int endColumn;
|
---|
260 | };
|
---|
261 |
|
---|
262 | public:
|
---|
263 | QScriptParser();
|
---|
264 | ~QScriptParser();
|
---|
265 |
|
---|
266 | bool parse(QScriptEnginePrivate *driver);
|
---|
267 |
|
---|
268 | inline QString errorMessage() const
|
---|
269 | { return error_message; }
|
---|
270 | inline int errorLineNumber() const
|
---|
271 | { return error_lineno; }
|
---|
272 | inline int errorColumnNumber() const
|
---|
273 | { return error_column; }
|
---|
274 |
|
---|
275 | protected:
|
---|
276 | inline void reallocateStack();
|
---|
277 |
|
---|
278 | inline Value &sym(int index)
|
---|
279 | { return sym_stack [tos + index - 1]; }
|
---|
280 |
|
---|
281 | inline Location &loc(int index)
|
---|
282 | { return location_stack [tos + index - 2]; }
|
---|
283 |
|
---|
284 | protected:
|
---|
285 | int tos;
|
---|
286 | int stack_size;
|
---|
287 | Value *sym_stack;
|
---|
288 | int *state_stack;
|
---|
289 | Location *location_stack;
|
---|
290 | QString error_message;
|
---|
291 | int error_lineno;
|
---|
292 | int error_column;
|
---|
293 | };
|
---|
294 |
|
---|
295 | inline void QScriptParser::reallocateStack()
|
---|
296 | {
|
---|
297 | if (! stack_size)
|
---|
298 | stack_size = 128;
|
---|
299 | else
|
---|
300 | stack_size <<= 1;
|
---|
301 |
|
---|
302 | sym_stack = reinterpret_cast<Value*> (qRealloc(sym_stack, stack_size * sizeof(Value)));
|
---|
303 | state_stack = reinterpret_cast<int*> (qRealloc(state_stack, stack_size * sizeof(int)));
|
---|
304 | location_stack = reinterpret_cast<Location*> (qRealloc(location_stack, stack_size * sizeof(Location)));
|
---|
305 | }
|
---|
306 |
|
---|
307 | :/
|
---|
308 |
|
---|
309 |
|
---|
310 | /.
|
---|
311 |
|
---|
312 | #include "qscriptparser_p.h"
|
---|
313 |
|
---|
314 | //
|
---|
315 | // This file is automatically generated from qscript.g.
|
---|
316 | // Changes will be lost.
|
---|
317 | //
|
---|
318 |
|
---|
319 | QT_BEGIN_NAMESPACE
|
---|
320 |
|
---|
321 | inline static bool automatic(QScriptEnginePrivate *driver, int token)
|
---|
322 | {
|
---|
323 | return token == $table::T_RBRACE
|
---|
324 | || token == 0
|
---|
325 | || driver->lexer()->prevTerminator();
|
---|
326 | }
|
---|
327 |
|
---|
328 |
|
---|
329 | QScriptParser::QScriptParser():
|
---|
330 | tos(0),
|
---|
331 | stack_size(0),
|
---|
332 | sym_stack(0),
|
---|
333 | state_stack(0),
|
---|
334 | location_stack(0),
|
---|
335 | error_lineno(0),
|
---|
336 | error_column(0)
|
---|
337 | {
|
---|
338 | }
|
---|
339 |
|
---|
340 | QScriptParser::~QScriptParser()
|
---|
341 | {
|
---|
342 | if (stack_size) {
|
---|
343 | qFree(sym_stack);
|
---|
344 | qFree(state_stack);
|
---|
345 | qFree(location_stack);
|
---|
346 | }
|
---|
347 | }
|
---|
348 |
|
---|
349 | static inline QScriptParser::Location location(QScript::Lexer *lexer)
|
---|
350 | {
|
---|
351 | QScriptParser::Location loc;
|
---|
352 | loc.startLine = lexer->startLineNo();
|
---|
353 | loc.startColumn = lexer->startColumnNo();
|
---|
354 | loc.endLine = lexer->endLineNo();
|
---|
355 | loc.endColumn = lexer->endColumnNo();
|
---|
356 | return loc;
|
---|
357 | }
|
---|
358 |
|
---|
359 | bool QScriptParser::parse(QScriptEnginePrivate *driver)
|
---|
360 | {
|
---|
361 | const int INITIAL_STATE = 0;
|
---|
362 | QScript::Lexer *lexer = driver->lexer();
|
---|
363 |
|
---|
364 | int yytoken = -1;
|
---|
365 | int saved_yytoken = -1;
|
---|
366 |
|
---|
367 | reallocateStack();
|
---|
368 |
|
---|
369 | tos = 0;
|
---|
370 | state_stack[++tos] = INITIAL_STATE;
|
---|
371 |
|
---|
372 | while (true)
|
---|
373 | {
|
---|
374 | const int state = state_stack [tos];
|
---|
375 | if (yytoken == -1 && - TERMINAL_COUNT != action_index [state])
|
---|
376 | {
|
---|
377 | if (saved_yytoken == -1)
|
---|
378 | {
|
---|
379 | yytoken = lexer->lex();
|
---|
380 | location_stack [tos] = location(lexer);
|
---|
381 | }
|
---|
382 | else
|
---|
383 | {
|
---|
384 | yytoken = saved_yytoken;
|
---|
385 | saved_yytoken = -1;
|
---|
386 | }
|
---|
387 | }
|
---|
388 |
|
---|
389 | int act = t_action (state, yytoken);
|
---|
390 |
|
---|
391 | if (act == ACCEPT_STATE)
|
---|
392 | return true;
|
---|
393 |
|
---|
394 | else if (act > 0)
|
---|
395 | {
|
---|
396 | if (++tos == stack_size)
|
---|
397 | reallocateStack();
|
---|
398 |
|
---|
399 | sym_stack [tos].dval = lexer->dval ();
|
---|
400 | state_stack [tos] = act;
|
---|
401 | location_stack [tos] = location(lexer);
|
---|
402 | yytoken = -1;
|
---|
403 | }
|
---|
404 |
|
---|
405 | else if (act < 0)
|
---|
406 | {
|
---|
407 | int r = - act - 1;
|
---|
408 |
|
---|
409 | tos -= rhs [r];
|
---|
410 | act = state_stack [tos++];
|
---|
411 |
|
---|
412 | switch (r) {
|
---|
413 | ./
|
---|
414 |
|
---|
415 | PrimaryExpression: T_THIS ;
|
---|
416 | /.
|
---|
417 | case $rule_number: {
|
---|
418 | sym(1).Node = QScript::makeAstNode<QScript::AST::ThisExpression> (driver->nodePool());
|
---|
419 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
|
---|
420 | } break;
|
---|
421 | ./
|
---|
422 |
|
---|
423 | PrimaryExpression: T_IDENTIFIER ;
|
---|
424 | /.
|
---|
425 | case $rule_number: {
|
---|
426 | sym(1).Node = QScript::makeAstNode<QScript::AST::IdentifierExpression> (driver->nodePool(), sym(1).sval);
|
---|
427 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
|
---|
428 | } break;
|
---|
429 | ./
|
---|
430 |
|
---|
431 | PrimaryExpression: T_NULL ;
|
---|
432 | /.
|
---|
433 | case $rule_number: {
|
---|
434 | sym(1).Node = QScript::makeAstNode<QScript::AST::NullExpression> (driver->nodePool());
|
---|
435 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
|
---|
436 | } break;
|
---|
437 | ./
|
---|
438 |
|
---|
439 | PrimaryExpression: T_TRUE ;
|
---|
440 | /.
|
---|
441 | case $rule_number: {
|
---|
442 | sym(1).Node = QScript::makeAstNode<QScript::AST::TrueLiteral> (driver->nodePool());
|
---|
443 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
|
---|
444 | } break;
|
---|
445 | ./
|
---|
446 |
|
---|
447 | PrimaryExpression: T_FALSE ;
|
---|
448 | /.
|
---|
449 | case $rule_number: {
|
---|
450 | sym(1).Node = QScript::makeAstNode<QScript::AST::FalseLiteral> (driver->nodePool());
|
---|
451 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
|
---|
452 | } break;
|
---|
453 | ./
|
---|
454 |
|
---|
455 | PrimaryExpression: T_NUMERIC_LITERAL ;
|
---|
456 | /.
|
---|
457 | case $rule_number: {
|
---|
458 | sym(1).Node = QScript::makeAstNode<QScript::AST::NumericLiteral> (driver->nodePool(), sym(1).dval);
|
---|
459 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
|
---|
460 | } break;
|
---|
461 | ./
|
---|
462 |
|
---|
463 | PrimaryExpression: T_STRING_LITERAL ;
|
---|
464 | /.
|
---|
465 | case $rule_number: {
|
---|
466 | sym(1).Node = QScript::makeAstNode<QScript::AST::StringLiteral> (driver->nodePool(), sym(1).sval);
|
---|
467 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
|
---|
468 | } break;
|
---|
469 | ./
|
---|
470 |
|
---|
471 | PrimaryExpression: T_DIVIDE_ ;
|
---|
472 | /:
|
---|
473 | #define Q_SCRIPT_REGEXPLITERAL_RULE1 $rule_number
|
---|
474 | :/
|
---|
475 | /.
|
---|
476 | case $rule_number: {
|
---|
477 | bool rx = lexer->scanRegExp(QScript::Lexer::NoPrefix);
|
---|
478 | if (!rx) {
|
---|
479 | error_message = lexer->errorMessage();
|
---|
480 | error_lineno = lexer->startLineNo();
|
---|
481 | error_column = lexer->startColumnNo();
|
---|
482 | return false;
|
---|
483 | }
|
---|
484 | sym(1).Node = QScript::makeAstNode<QScript::AST::RegExpLiteral> (driver->nodePool(), lexer->pattern, lexer->flags);
|
---|
485 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
|
---|
486 | } break;
|
---|
487 | ./
|
---|
488 |
|
---|
489 | PrimaryExpression: T_DIVIDE_EQ ;
|
---|
490 | /:
|
---|
491 | #define Q_SCRIPT_REGEXPLITERAL_RULE2 $rule_number
|
---|
492 | :/
|
---|
493 | /.
|
---|
494 | case $rule_number: {
|
---|
495 | bool rx = lexer->scanRegExp(QScript::Lexer::EqualPrefix);
|
---|
496 | if (!rx) {
|
---|
497 | error_message = lexer->errorMessage();
|
---|
498 | error_lineno = lexer->startLineNo();
|
---|
499 | error_column = lexer->startColumnNo();
|
---|
500 | return false;
|
---|
501 | }
|
---|
502 | sym(1).Node = QScript::makeAstNode<QScript::AST::RegExpLiteral> (driver->nodePool(), lexer->pattern, lexer->flags);
|
---|
503 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
|
---|
504 | } break;
|
---|
505 | ./
|
---|
506 |
|
---|
507 | PrimaryExpression: T_LBRACKET ElisionOpt T_RBRACKET ;
|
---|
508 | /.
|
---|
509 | case $rule_number: {
|
---|
510 | sym(1).Node = QScript::makeAstNode<QScript::AST::ArrayLiteral> (driver->nodePool(), sym(2).Elision);
|
---|
511 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
---|
512 | } break;
|
---|
513 | ./
|
---|
514 |
|
---|
515 | PrimaryExpression: T_LBRACKET ElementList T_RBRACKET ;
|
---|
516 | /.
|
---|
517 | case $rule_number: {
|
---|
518 | sym(1).Node = QScript::makeAstNode<QScript::AST::ArrayLiteral> (driver->nodePool(), sym(2).ElementList->finish ());
|
---|
519 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
---|
520 | } break;
|
---|
521 | ./
|
---|
522 |
|
---|
523 | PrimaryExpression: T_LBRACKET ElementList T_COMMA ElisionOpt T_RBRACKET ;
|
---|
524 | /.
|
---|
525 | case $rule_number: {
|
---|
526 | sym(1).Node = QScript::makeAstNode<QScript::AST::ArrayLiteral> (driver->nodePool(), sym(2).ElementList->finish (), sym(4).Elision);
|
---|
527 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(5));
|
---|
528 | } break;
|
---|
529 | ./
|
---|
530 |
|
---|
531 | -- PrimaryExpression: T_LBRACE T_RBRACE ;
|
---|
532 | -- /.
|
---|
533 | -- case $rule_number: {
|
---|
534 | -- sym(1).Node = QScript::makeAstNode<QScript::AST::ObjectLiteral> (driver->nodePool());
|
---|
535 | -- Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
|
---|
536 | -- } break;
|
---|
537 | -- ./
|
---|
538 |
|
---|
539 | PrimaryExpression: T_LBRACE PropertyNameAndValueListOpt T_RBRACE ;
|
---|
540 | /.
|
---|
541 | case $rule_number: {
|
---|
542 | if (sym(2).Node)
|
---|
543 | sym(1).Node = QScript::makeAstNode<QScript::AST::ObjectLiteral> (driver->nodePool(), sym(2).PropertyNameAndValueList->finish ());
|
---|
544 | else
|
---|
545 | sym(1).Node = QScript::makeAstNode<QScript::AST::ObjectLiteral> (driver->nodePool());
|
---|
546 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
---|
547 | } break;
|
---|
548 | ./
|
---|
549 |
|
---|
550 | PrimaryExpression: T_LBRACE PropertyNameAndValueList T_COMMA T_RBRACE ;
|
---|
551 | /.
|
---|
552 | case $rule_number: {
|
---|
553 | sym(1).Node = QScript::makeAstNode<QScript::AST::ObjectLiteral> (driver->nodePool(), sym(2).PropertyNameAndValueList->finish ());
|
---|
554 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(4));
|
---|
555 | } break;
|
---|
556 | ./
|
---|
557 |
|
---|
558 | PrimaryExpression: T_LPAREN Expression T_RPAREN ;
|
---|
559 | /.
|
---|
560 | case $rule_number: {
|
---|
561 | sym(1) = sym(2);
|
---|
562 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
---|
563 | } break;
|
---|
564 | ./
|
---|
565 |
|
---|
566 | ElementList: ElisionOpt AssignmentExpression ;
|
---|
567 | /.
|
---|
568 | case $rule_number: {
|
---|
569 | sym(1).Node = QScript::makeAstNode<QScript::AST::ElementList> (driver->nodePool(), sym(1).Elision, sym(2).Expression);
|
---|
570 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
|
---|
571 | } break;
|
---|
572 | ./
|
---|
573 |
|
---|
574 | ElementList: ElementList T_COMMA ElisionOpt AssignmentExpression ;
|
---|
575 | /.
|
---|
576 | case $rule_number: {
|
---|
577 | sym(1).Node = QScript::makeAstNode<QScript::AST::ElementList> (driver->nodePool(), sym(1).ElementList, sym(3).Elision, sym(4).Expression);
|
---|
578 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(4));
|
---|
579 | } break;
|
---|
580 | ./
|
---|
581 |
|
---|
582 | Elision: T_COMMA ;
|
---|
583 | /.
|
---|
584 | case $rule_number: {
|
---|
585 | sym(1).Node = QScript::makeAstNode<QScript::AST::Elision> (driver->nodePool());
|
---|
586 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
|
---|
587 | } break;
|
---|
588 | ./
|
---|
589 |
|
---|
590 | Elision: Elision T_COMMA ;
|
---|
591 | /.
|
---|
592 | case $rule_number: {
|
---|
593 | sym(1).Node = QScript::makeAstNode<QScript::AST::Elision> (driver->nodePool(), sym(1).Elision);
|
---|
594 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
|
---|
595 | } break;
|
---|
596 | ./
|
---|
597 |
|
---|
598 | ElisionOpt: ;
|
---|
599 | /.
|
---|
600 | case $rule_number: {
|
---|
601 | sym(1).Node = 0;
|
---|
602 | } break;
|
---|
603 | ./
|
---|
604 |
|
---|
605 | ElisionOpt: Elision ;
|
---|
606 | /.
|
---|
607 | case $rule_number: {
|
---|
608 | sym(1).Elision = sym(1).Elision->finish ();
|
---|
609 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
|
---|
610 | } break;
|
---|
611 | ./
|
---|
612 |
|
---|
613 | PropertyNameAndValueList: PropertyName T_COLON AssignmentExpression ;
|
---|
614 | /.
|
---|
615 | case $rule_number: {
|
---|
616 | sym(1).Node = QScript::makeAstNode<QScript::AST::PropertyNameAndValueList> (driver->nodePool(), sym(1).PropertyName, sym(3).Expression);
|
---|
617 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
---|
618 | } break;
|
---|
619 | ./
|
---|
620 |
|
---|
621 | PropertyNameAndValueList: PropertyNameAndValueList T_COMMA PropertyName T_COLON AssignmentExpression ;
|
---|
622 | /.
|
---|
623 | case $rule_number: {
|
---|
624 | sym(1).Node = QScript::makeAstNode<QScript::AST::PropertyNameAndValueList> (driver->nodePool(), sym(1).PropertyNameAndValueList, sym(3).PropertyName, sym(5).Expression);
|
---|
625 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(5));
|
---|
626 | } break;
|
---|
627 | ./
|
---|
628 |
|
---|
629 | PropertyName: T_IDENTIFIER ;
|
---|
630 | /.
|
---|
631 | case $rule_number: {
|
---|
632 | sym(1).Node = QScript::makeAstNode<QScript::AST::IdentifierPropertyName> (driver->nodePool(), sym(1).sval);
|
---|
633 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
|
---|
634 | } break;
|
---|
635 | ./
|
---|
636 |
|
---|
637 | PropertyName: T_STRING_LITERAL ;
|
---|
638 | /.
|
---|
639 | case $rule_number: {
|
---|
640 | sym(1).Node = QScript::makeAstNode<QScript::AST::StringLiteralPropertyName> (driver->nodePool(), sym(1).sval);
|
---|
641 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
|
---|
642 | } break;
|
---|
643 | ./
|
---|
644 |
|
---|
645 | PropertyName: T_NUMERIC_LITERAL ;
|
---|
646 | /.
|
---|
647 | case $rule_number: {
|
---|
648 | sym(1).Node = QScript::makeAstNode<QScript::AST::NumericLiteralPropertyName> (driver->nodePool(), sym(1).dval);
|
---|
649 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
|
---|
650 | } break;
|
---|
651 | ./
|
---|
652 |
|
---|
653 | PropertyName: ReservedIdentifier ;
|
---|
654 | /.
|
---|
655 | case $rule_number: {
|
---|
656 | sym(1).Node = QScript::makeAstNode<QScript::AST::IdentifierPropertyName> (driver->nodePool(), sym(1).sval);
|
---|
657 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
|
---|
658 | } break;
|
---|
659 | ./
|
---|
660 |
|
---|
661 | ReservedIdentifier: T_BREAK ;
|
---|
662 | /.
|
---|
663 | case $rule_number:
|
---|
664 | ./
|
---|
665 | ReservedIdentifier: T_CASE ;
|
---|
666 | /.
|
---|
667 | case $rule_number:
|
---|
668 | ./
|
---|
669 | ReservedIdentifier: T_CATCH ;
|
---|
670 | /.
|
---|
671 | case $rule_number:
|
---|
672 | ./
|
---|
673 | ReservedIdentifier: T_CONTINUE ;
|
---|
674 | /.
|
---|
675 | case $rule_number:
|
---|
676 | ./
|
---|
677 | ReservedIdentifier: T_DEFAULT ;
|
---|
678 | /.
|
---|
679 | case $rule_number:
|
---|
680 | ./
|
---|
681 | ReservedIdentifier: T_DELETE ;
|
---|
682 | /.
|
---|
683 | case $rule_number:
|
---|
684 | ./
|
---|
685 | ReservedIdentifier: T_DO ;
|
---|
686 | /.
|
---|
687 | case $rule_number:
|
---|
688 | ./
|
---|
689 | ReservedIdentifier: T_ELSE ;
|
---|
690 | /.
|
---|
691 | case $rule_number:
|
---|
692 | ./
|
---|
693 | ReservedIdentifier: T_FALSE ;
|
---|
694 | /.
|
---|
695 | case $rule_number:
|
---|
696 | ./
|
---|
697 | ReservedIdentifier: T_FINALLY ;
|
---|
698 | /.
|
---|
699 | case $rule_number:
|
---|
700 | ./
|
---|
701 | ReservedIdentifier: T_FOR ;
|
---|
702 | /.
|
---|
703 | case $rule_number:
|
---|
704 | ./
|
---|
705 | ReservedIdentifier: T_FUNCTION ;
|
---|
706 | /.
|
---|
707 | case $rule_number:
|
---|
708 | ./
|
---|
709 | ReservedIdentifier: T_IF ;
|
---|
710 | /.
|
---|
711 | case $rule_number:
|
---|
712 | ./
|
---|
713 | ReservedIdentifier: T_IN ;
|
---|
714 | /.
|
---|
715 | case $rule_number:
|
---|
716 | ./
|
---|
717 | ReservedIdentifier: T_INSTANCEOF ;
|
---|
718 | /.
|
---|
719 | case $rule_number:
|
---|
720 | ./
|
---|
721 | ReservedIdentifier: T_NEW ;
|
---|
722 | /.
|
---|
723 | case $rule_number:
|
---|
724 | ./
|
---|
725 | ReservedIdentifier: T_NULL ;
|
---|
726 | /.
|
---|
727 | case $rule_number:
|
---|
728 | ./
|
---|
729 | ReservedIdentifier: T_RETURN ;
|
---|
730 | /.
|
---|
731 | case $rule_number:
|
---|
732 | ./
|
---|
733 | ReservedIdentifier: T_SWITCH ;
|
---|
734 | /.
|
---|
735 | case $rule_number:
|
---|
736 | ./
|
---|
737 | ReservedIdentifier: T_THIS ;
|
---|
738 | /.
|
---|
739 | case $rule_number:
|
---|
740 | ./
|
---|
741 | ReservedIdentifier: T_THROW ;
|
---|
742 | /.
|
---|
743 | case $rule_number:
|
---|
744 | ./
|
---|
745 | ReservedIdentifier: T_TRUE ;
|
---|
746 | /.
|
---|
747 | case $rule_number:
|
---|
748 | ./
|
---|
749 | ReservedIdentifier: T_TRY ;
|
---|
750 | /.
|
---|
751 | case $rule_number:
|
---|
752 | ./
|
---|
753 | ReservedIdentifier: T_TYPEOF ;
|
---|
754 | /.
|
---|
755 | case $rule_number:
|
---|
756 | ./
|
---|
757 | ReservedIdentifier: T_VAR ;
|
---|
758 | /.
|
---|
759 | case $rule_number:
|
---|
760 | ./
|
---|
761 | ReservedIdentifier: T_VOID ;
|
---|
762 | /.
|
---|
763 | case $rule_number:
|
---|
764 | ./
|
---|
765 | ReservedIdentifier: T_WHILE ;
|
---|
766 | /.
|
---|
767 | case $rule_number:
|
---|
768 | ./
|
---|
769 | ReservedIdentifier: T_CONST ;
|
---|
770 | /.
|
---|
771 | case $rule_number:
|
---|
772 | ./
|
---|
773 | ReservedIdentifier: T_DEBUGGER ;
|
---|
774 | /.
|
---|
775 | case $rule_number:
|
---|
776 | ./
|
---|
777 | ReservedIdentifier: T_RESERVED_WORD ;
|
---|
778 | /.
|
---|
779 | case $rule_number:
|
---|
780 | ./
|
---|
781 | ReservedIdentifier: T_WITH ;
|
---|
782 | /.
|
---|
783 | case $rule_number:
|
---|
784 | {
|
---|
785 | sym(1).sval = driver->intern(lexer->characterBuffer(), lexer->characterCount());
|
---|
786 | } break;
|
---|
787 | ./
|
---|
788 |
|
---|
789 | PropertyIdentifier: T_IDENTIFIER ;
|
---|
790 | PropertyIdentifier: ReservedIdentifier ;
|
---|
791 |
|
---|
792 | MemberExpression: PrimaryExpression ;
|
---|
793 | MemberExpression: FunctionExpression ;
|
---|
794 |
|
---|
795 | MemberExpression: MemberExpression T_LBRACKET Expression T_RBRACKET ;
|
---|
796 | /.
|
---|
797 | case $rule_number: {
|
---|
798 | sym(1).Node = QScript::makeAstNode<QScript::AST::ArrayMemberExpression> (driver->nodePool(), sym(1).Expression, sym(3).Expression);
|
---|
799 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(4));
|
---|
800 | } break;
|
---|
801 | ./
|
---|
802 |
|
---|
803 | MemberExpression: MemberExpression T_DOT PropertyIdentifier ;
|
---|
804 | /.
|
---|
805 | case $rule_number: {
|
---|
806 | sym(1).Node = QScript::makeAstNode<QScript::AST::FieldMemberExpression> (driver->nodePool(), sym(1).Expression, sym(3).sval);
|
---|
807 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(4));
|
---|
808 | } break;
|
---|
809 | ./
|
---|
810 |
|
---|
811 | MemberExpression: T_NEW MemberExpression Arguments ;
|
---|
812 | /.
|
---|
813 | case $rule_number: {
|
---|
814 | sym(1).Node = QScript::makeAstNode<QScript::AST::NewMemberExpression> (driver->nodePool(), sym(2).Expression, sym(3).ArgumentList);
|
---|
815 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
---|
816 | } break;
|
---|
817 | ./
|
---|
818 |
|
---|
819 | NewExpression: MemberExpression ;
|
---|
820 |
|
---|
821 | NewExpression: T_NEW NewExpression ;
|
---|
822 | /.
|
---|
823 | case $rule_number: {
|
---|
824 | sym(1).Node = QScript::makeAstNode<QScript::AST::NewExpression> (driver->nodePool(), sym(2).Expression);
|
---|
825 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
|
---|
826 | } break;
|
---|
827 | ./
|
---|
828 |
|
---|
829 | CallExpression: MemberExpression Arguments ;
|
---|
830 | /.
|
---|
831 | case $rule_number: {
|
---|
832 | sym(1).Node = QScript::makeAstNode<QScript::AST::CallExpression> (driver->nodePool(), sym(1).Expression, sym(2).ArgumentList);
|
---|
833 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
|
---|
834 | } break;
|
---|
835 | ./
|
---|
836 |
|
---|
837 | CallExpression: CallExpression Arguments ;
|
---|
838 | /.
|
---|
839 | case $rule_number: {
|
---|
840 | sym(1).Node = QScript::makeAstNode<QScript::AST::CallExpression> (driver->nodePool(), sym(1).Expression, sym(2).ArgumentList);
|
---|
841 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
|
---|
842 | } break;
|
---|
843 | ./
|
---|
844 |
|
---|
845 | CallExpression: CallExpression T_LBRACKET Expression T_RBRACKET ;
|
---|
846 | /.
|
---|
847 | case $rule_number: {
|
---|
848 | sym(1).Node = QScript::makeAstNode<QScript::AST::ArrayMemberExpression> (driver->nodePool(), sym(1).Expression, sym(3).Expression);
|
---|
849 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(4));
|
---|
850 | } break;
|
---|
851 | ./
|
---|
852 |
|
---|
853 | CallExpression: CallExpression T_DOT PropertyIdentifier ;
|
---|
854 | /.
|
---|
855 | case $rule_number: {
|
---|
856 | sym(1).Node = QScript::makeAstNode<QScript::AST::FieldMemberExpression> (driver->nodePool(), sym(1).Expression, sym(3).sval);
|
---|
857 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
---|
858 | } break;
|
---|
859 | ./
|
---|
860 |
|
---|
861 | Arguments: T_LPAREN T_RPAREN ;
|
---|
862 | /.
|
---|
863 | case $rule_number: {
|
---|
864 | sym(1).Node = 0;
|
---|
865 | } break;
|
---|
866 | ./
|
---|
867 |
|
---|
868 | Arguments: T_LPAREN ArgumentList T_RPAREN ;
|
---|
869 | /.
|
---|
870 | case $rule_number: {
|
---|
871 | sym(1).Node = sym(2).ArgumentList->finish ();
|
---|
872 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
---|
873 | } break;
|
---|
874 | ./
|
---|
875 |
|
---|
876 | ArgumentList: AssignmentExpression ;
|
---|
877 | /.
|
---|
878 | case $rule_number: {
|
---|
879 | sym(1).Node = QScript::makeAstNode<QScript::AST::ArgumentList> (driver->nodePool(), sym(1).Expression);
|
---|
880 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
|
---|
881 | } break;
|
---|
882 | ./
|
---|
883 |
|
---|
884 | ArgumentList: ArgumentList T_COMMA AssignmentExpression ;
|
---|
885 | /.
|
---|
886 | case $rule_number: {
|
---|
887 | sym(1).Node = QScript::makeAstNode<QScript::AST::ArgumentList> (driver->nodePool(), sym(1).ArgumentList, sym(3).Expression);
|
---|
888 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
---|
889 | } break;
|
---|
890 | ./
|
---|
891 |
|
---|
892 | LeftHandSideExpression: NewExpression ;
|
---|
893 | LeftHandSideExpression: CallExpression ;
|
---|
894 | PostfixExpression: LeftHandSideExpression ;
|
---|
895 |
|
---|
896 | PostfixExpression: LeftHandSideExpression T_PLUS_PLUS ;
|
---|
897 | /.
|
---|
898 | case $rule_number: {
|
---|
899 | sym(1).Node = QScript::makeAstNode<QScript::AST::PostIncrementExpression> (driver->nodePool(), sym(1).Expression);
|
---|
900 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
|
---|
901 | } break;
|
---|
902 | ./
|
---|
903 |
|
---|
904 | PostfixExpression: LeftHandSideExpression T_MINUS_MINUS ;
|
---|
905 | /.
|
---|
906 | case $rule_number: {
|
---|
907 | sym(1).Node = QScript::makeAstNode<QScript::AST::PostDecrementExpression> (driver->nodePool(), sym(1).Expression);
|
---|
908 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
|
---|
909 | } break;
|
---|
910 | ./
|
---|
911 |
|
---|
912 | UnaryExpression: PostfixExpression ;
|
---|
913 |
|
---|
914 | UnaryExpression: T_DELETE UnaryExpression ;
|
---|
915 | /.
|
---|
916 | case $rule_number: {
|
---|
917 | sym(1).Node = QScript::makeAstNode<QScript::AST::DeleteExpression> (driver->nodePool(), sym(2).Expression);
|
---|
918 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
|
---|
919 | } break;
|
---|
920 | ./
|
---|
921 |
|
---|
922 | UnaryExpression: T_VOID UnaryExpression ;
|
---|
923 | /.
|
---|
924 | case $rule_number: {
|
---|
925 | sym(1).Node = QScript::makeAstNode<QScript::AST::VoidExpression> (driver->nodePool(), sym(2).Expression);
|
---|
926 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
|
---|
927 | } break;
|
---|
928 | ./
|
---|
929 |
|
---|
930 | UnaryExpression: T_TYPEOF UnaryExpression ;
|
---|
931 | /.
|
---|
932 | case $rule_number: {
|
---|
933 | sym(1).Node = QScript::makeAstNode<QScript::AST::TypeOfExpression> (driver->nodePool(), sym(2).Expression);
|
---|
934 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
|
---|
935 | } break;
|
---|
936 | ./
|
---|
937 |
|
---|
938 | UnaryExpression: T_PLUS_PLUS UnaryExpression ;
|
---|
939 | /.
|
---|
940 | case $rule_number: {
|
---|
941 | sym(1).Node = QScript::makeAstNode<QScript::AST::PreIncrementExpression> (driver->nodePool(), sym(2).Expression);
|
---|
942 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
|
---|
943 | } break;
|
---|
944 | ./
|
---|
945 |
|
---|
946 | UnaryExpression: T_MINUS_MINUS UnaryExpression ;
|
---|
947 | /.
|
---|
948 | case $rule_number: {
|
---|
949 | sym(1).Node = QScript::makeAstNode<QScript::AST::PreDecrementExpression> (driver->nodePool(), sym(2).Expression);
|
---|
950 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
|
---|
951 | } break;
|
---|
952 | ./
|
---|
953 |
|
---|
954 | UnaryExpression: T_PLUS UnaryExpression ;
|
---|
955 | /.
|
---|
956 | case $rule_number: {
|
---|
957 | sym(1).Node = QScript::makeAstNode<QScript::AST::UnaryPlusExpression> (driver->nodePool(), sym(2).Expression);
|
---|
958 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
|
---|
959 | } break;
|
---|
960 | ./
|
---|
961 |
|
---|
962 | UnaryExpression: T_MINUS UnaryExpression ;
|
---|
963 | /.
|
---|
964 | case $rule_number: {
|
---|
965 | sym(1).Node = QScript::makeAstNode<QScript::AST::UnaryMinusExpression> (driver->nodePool(), sym(2).Expression);
|
---|
966 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
|
---|
967 | } break;
|
---|
968 | ./
|
---|
969 |
|
---|
970 | UnaryExpression: T_TILDE UnaryExpression ;
|
---|
971 | /.
|
---|
972 | case $rule_number: {
|
---|
973 | sym(1).Node = QScript::makeAstNode<QScript::AST::TildeExpression> (driver->nodePool(), sym(2).Expression);
|
---|
974 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
|
---|
975 | } break;
|
---|
976 | ./
|
---|
977 |
|
---|
978 | UnaryExpression: T_NOT UnaryExpression ;
|
---|
979 | /.
|
---|
980 | case $rule_number: {
|
---|
981 | sym(1).Node = QScript::makeAstNode<QScript::AST::NotExpression> (driver->nodePool(), sym(2).Expression);
|
---|
982 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
|
---|
983 | } break;
|
---|
984 | ./
|
---|
985 |
|
---|
986 | MultiplicativeExpression: UnaryExpression ;
|
---|
987 |
|
---|
988 | MultiplicativeExpression: MultiplicativeExpression T_STAR UnaryExpression ;
|
---|
989 | /.
|
---|
990 | case $rule_number: {
|
---|
991 | sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Mul, sym(3).Expression);
|
---|
992 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
---|
993 | } break;
|
---|
994 | ./
|
---|
995 |
|
---|
996 | MultiplicativeExpression: MultiplicativeExpression T_DIVIDE_ UnaryExpression ;
|
---|
997 | /.
|
---|
998 | case $rule_number: {
|
---|
999 | sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Div, sym(3).Expression);
|
---|
1000 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
---|
1001 | } break;
|
---|
1002 | ./
|
---|
1003 |
|
---|
1004 | MultiplicativeExpression: MultiplicativeExpression T_REMAINDER UnaryExpression ;
|
---|
1005 | /.
|
---|
1006 | case $rule_number: {
|
---|
1007 | sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Mod, sym(3).Expression);
|
---|
1008 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
---|
1009 | } break;
|
---|
1010 | ./
|
---|
1011 |
|
---|
1012 | AdditiveExpression: MultiplicativeExpression ;
|
---|
1013 |
|
---|
1014 | AdditiveExpression: AdditiveExpression T_PLUS MultiplicativeExpression ;
|
---|
1015 | /.
|
---|
1016 | case $rule_number: {
|
---|
1017 | sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Add, sym(3).Expression);
|
---|
1018 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
---|
1019 | } break;
|
---|
1020 | ./
|
---|
1021 |
|
---|
1022 | AdditiveExpression: AdditiveExpression T_MINUS MultiplicativeExpression ;
|
---|
1023 | /.
|
---|
1024 | case $rule_number: {
|
---|
1025 | sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Sub, sym(3).Expression);
|
---|
1026 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
---|
1027 | } break;
|
---|
1028 | ./
|
---|
1029 |
|
---|
1030 | ShiftExpression: AdditiveExpression ;
|
---|
1031 |
|
---|
1032 | ShiftExpression: ShiftExpression T_LT_LT AdditiveExpression ;
|
---|
1033 | /.
|
---|
1034 | case $rule_number: {
|
---|
1035 | sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::LShift, sym(3).Expression);
|
---|
1036 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
---|
1037 | } break;
|
---|
1038 | ./
|
---|
1039 |
|
---|
1040 | ShiftExpression: ShiftExpression T_GT_GT AdditiveExpression ;
|
---|
1041 | /.
|
---|
1042 | case $rule_number: {
|
---|
1043 | sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::RShift, sym(3).Expression);
|
---|
1044 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
---|
1045 | } break;
|
---|
1046 | ./
|
---|
1047 |
|
---|
1048 | ShiftExpression: ShiftExpression T_GT_GT_GT AdditiveExpression ;
|
---|
1049 | /.
|
---|
1050 | case $rule_number: {
|
---|
1051 | sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::URShift, sym(3).Expression);
|
---|
1052 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
---|
1053 | } break;
|
---|
1054 | ./
|
---|
1055 |
|
---|
1056 | RelationalExpression: ShiftExpression ;
|
---|
1057 |
|
---|
1058 | RelationalExpression: RelationalExpression T_LT ShiftExpression ;
|
---|
1059 | /.
|
---|
1060 | case $rule_number: {
|
---|
1061 | sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Lt, sym(3).Expression);
|
---|
1062 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
---|
1063 | } break;
|
---|
1064 | ./
|
---|
1065 |
|
---|
1066 | RelationalExpression: RelationalExpression T_GT ShiftExpression ;
|
---|
1067 | /.
|
---|
1068 | case $rule_number: {
|
---|
1069 | sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Gt, sym(3).Expression);
|
---|
1070 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
---|
1071 | } break;
|
---|
1072 | ./
|
---|
1073 |
|
---|
1074 | RelationalExpression: RelationalExpression T_LE ShiftExpression ;
|
---|
1075 | /.
|
---|
1076 | case $rule_number: {
|
---|
1077 | sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Le, sym(3).Expression);
|
---|
1078 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
---|
1079 | } break;
|
---|
1080 | ./
|
---|
1081 |
|
---|
1082 | RelationalExpression: RelationalExpression T_GE ShiftExpression ;
|
---|
1083 | /.
|
---|
1084 | case $rule_number: {
|
---|
1085 | sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Ge, sym(3).Expression);
|
---|
1086 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
---|
1087 | } break;
|
---|
1088 | ./
|
---|
1089 |
|
---|
1090 | RelationalExpression: RelationalExpression T_INSTANCEOF ShiftExpression ;
|
---|
1091 | /.
|
---|
1092 | case $rule_number: {
|
---|
1093 | sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::InstanceOf, sym(3).Expression);
|
---|
1094 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
---|
1095 | } break;
|
---|
1096 | ./
|
---|
1097 |
|
---|
1098 | RelationalExpression: RelationalExpression T_IN ShiftExpression ;
|
---|
1099 | /.
|
---|
1100 | case $rule_number: {
|
---|
1101 | sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::In, sym(3).Expression);
|
---|
1102 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
---|
1103 | } break;
|
---|
1104 | ./
|
---|
1105 |
|
---|
1106 | RelationalExpressionNotIn: ShiftExpression ;
|
---|
1107 |
|
---|
1108 | RelationalExpressionNotIn: RelationalExpressionNotIn T_LT ShiftExpression ;
|
---|
1109 | /.
|
---|
1110 | case $rule_number: {
|
---|
1111 | sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Lt, sym(3).Expression);
|
---|
1112 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
---|
1113 | } break;
|
---|
1114 | ./
|
---|
1115 |
|
---|
1116 | RelationalExpressionNotIn: RelationalExpressionNotIn T_GT ShiftExpression ;
|
---|
1117 | /.
|
---|
1118 | case $rule_number: {
|
---|
1119 | sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Gt, sym(3).Expression);
|
---|
1120 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
---|
1121 | } break;
|
---|
1122 | ./
|
---|
1123 |
|
---|
1124 | RelationalExpressionNotIn: RelationalExpressionNotIn T_LE ShiftExpression ;
|
---|
1125 | /.
|
---|
1126 | case $rule_number: {
|
---|
1127 | sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Le, sym(3).Expression);
|
---|
1128 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
---|
1129 | } break;
|
---|
1130 | ./
|
---|
1131 |
|
---|
1132 | RelationalExpressionNotIn: RelationalExpressionNotIn T_GE ShiftExpression ;
|
---|
1133 | /.
|
---|
1134 | case $rule_number: {
|
---|
1135 | sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Ge, sym(3).Expression);
|
---|
1136 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
---|
1137 | } break;
|
---|
1138 | ./
|
---|
1139 |
|
---|
1140 | RelationalExpressionNotIn: RelationalExpressionNotIn T_INSTANCEOF ShiftExpression ;
|
---|
1141 | /.
|
---|
1142 | case $rule_number: {
|
---|
1143 | sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::InstanceOf, sym(3).Expression);
|
---|
1144 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
---|
1145 | } break;
|
---|
1146 | ./
|
---|
1147 |
|
---|
1148 | EqualityExpression: RelationalExpression ;
|
---|
1149 |
|
---|
1150 | EqualityExpression: EqualityExpression T_EQ_EQ RelationalExpression ;
|
---|
1151 | /.
|
---|
1152 | case $rule_number: {
|
---|
1153 | sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Equal, sym(3).Expression);
|
---|
1154 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
---|
1155 | } break;
|
---|
1156 | ./
|
---|
1157 |
|
---|
1158 | EqualityExpression: EqualityExpression T_NOT_EQ RelationalExpression ;
|
---|
1159 | /.
|
---|
1160 | case $rule_number: {
|
---|
1161 | sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::NotEqual, sym(3).Expression);
|
---|
1162 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
---|
1163 | } break;
|
---|
1164 | ./
|
---|
1165 |
|
---|
1166 | EqualityExpression: EqualityExpression T_EQ_EQ_EQ RelationalExpression ;
|
---|
1167 | /.
|
---|
1168 | case $rule_number: {
|
---|
1169 | sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::StrictEqual, sym(3).Expression);
|
---|
1170 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
---|
1171 | } break;
|
---|
1172 | ./
|
---|
1173 |
|
---|
1174 | EqualityExpression: EqualityExpression T_NOT_EQ_EQ RelationalExpression ;
|
---|
1175 | /.
|
---|
1176 | case $rule_number: {
|
---|
1177 | sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::StrictNotEqual, sym(3).Expression);
|
---|
1178 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
---|
1179 | } break;
|
---|
1180 | ./
|
---|
1181 |
|
---|
1182 | EqualityExpressionNotIn: RelationalExpressionNotIn ;
|
---|
1183 |
|
---|
1184 | EqualityExpressionNotIn: EqualityExpressionNotIn T_EQ_EQ RelationalExpressionNotIn ;
|
---|
1185 | /.
|
---|
1186 | case $rule_number: {
|
---|
1187 | sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Equal, sym(3).Expression);
|
---|
1188 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
---|
1189 | } break;
|
---|
1190 | ./
|
---|
1191 |
|
---|
1192 | EqualityExpressionNotIn: EqualityExpressionNotIn T_NOT_EQ RelationalExpressionNotIn;
|
---|
1193 | /.
|
---|
1194 | case $rule_number: {
|
---|
1195 | sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::NotEqual, sym(3).Expression);
|
---|
1196 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
---|
1197 | } break;
|
---|
1198 | ./
|
---|
1199 |
|
---|
1200 | EqualityExpressionNotIn: EqualityExpressionNotIn T_EQ_EQ_EQ RelationalExpressionNotIn ;
|
---|
1201 | /.
|
---|
1202 | case $rule_number: {
|
---|
1203 | sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::StrictEqual, sym(3).Expression);
|
---|
1204 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
---|
1205 | } break;
|
---|
1206 | ./
|
---|
1207 |
|
---|
1208 | EqualityExpressionNotIn: EqualityExpressionNotIn T_NOT_EQ_EQ RelationalExpressionNotIn ;
|
---|
1209 | /.
|
---|
1210 | case $rule_number: {
|
---|
1211 | sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::StrictNotEqual, sym(3).Expression);
|
---|
1212 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
---|
1213 | } break;
|
---|
1214 | ./
|
---|
1215 |
|
---|
1216 | BitwiseANDExpression: EqualityExpression ;
|
---|
1217 |
|
---|
1218 | BitwiseANDExpression: BitwiseANDExpression T_AND EqualityExpression ;
|
---|
1219 | /.
|
---|
1220 | case $rule_number: {
|
---|
1221 | sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::BitAnd, sym(3).Expression);
|
---|
1222 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
---|
1223 | } break;
|
---|
1224 | ./
|
---|
1225 |
|
---|
1226 | BitwiseANDExpressionNotIn: EqualityExpressionNotIn ;
|
---|
1227 |
|
---|
1228 | BitwiseANDExpressionNotIn: BitwiseANDExpressionNotIn T_AND EqualityExpressionNotIn ;
|
---|
1229 | /.
|
---|
1230 | case $rule_number: {
|
---|
1231 | sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::BitAnd, sym(3).Expression);
|
---|
1232 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
---|
1233 | } break;
|
---|
1234 | ./
|
---|
1235 |
|
---|
1236 | BitwiseXORExpression: BitwiseANDExpression ;
|
---|
1237 |
|
---|
1238 | BitwiseXORExpression: BitwiseXORExpression T_XOR BitwiseANDExpression ;
|
---|
1239 | /.
|
---|
1240 | case $rule_number: {
|
---|
1241 | sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::BitXor, sym(3).Expression);
|
---|
1242 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
---|
1243 | } break;
|
---|
1244 | ./
|
---|
1245 |
|
---|
1246 | BitwiseXORExpressionNotIn: BitwiseANDExpressionNotIn ;
|
---|
1247 |
|
---|
1248 | BitwiseXORExpressionNotIn: BitwiseXORExpressionNotIn T_XOR BitwiseANDExpressionNotIn ;
|
---|
1249 | /.
|
---|
1250 | case $rule_number: {
|
---|
1251 | sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::BitXor, sym(3).Expression);
|
---|
1252 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
---|
1253 | } break;
|
---|
1254 | ./
|
---|
1255 |
|
---|
1256 | BitwiseORExpression: BitwiseXORExpression ;
|
---|
1257 |
|
---|
1258 | BitwiseORExpression: BitwiseORExpression T_OR BitwiseXORExpression ;
|
---|
1259 | /.
|
---|
1260 | case $rule_number: {
|
---|
1261 | sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::BitOr, sym(3).Expression);
|
---|
1262 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
---|
1263 | } break;
|
---|
1264 | ./
|
---|
1265 |
|
---|
1266 | BitwiseORExpressionNotIn: BitwiseXORExpressionNotIn ;
|
---|
1267 |
|
---|
1268 | BitwiseORExpressionNotIn: BitwiseORExpressionNotIn T_OR BitwiseXORExpressionNotIn ;
|
---|
1269 | /.
|
---|
1270 | case $rule_number: {
|
---|
1271 | sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::BitOr, sym(3).Expression);
|
---|
1272 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
---|
1273 | } break;
|
---|
1274 | ./
|
---|
1275 |
|
---|
1276 | LogicalANDExpression: BitwiseORExpression ;
|
---|
1277 |
|
---|
1278 | LogicalANDExpression: LogicalANDExpression T_AND_AND BitwiseORExpression ;
|
---|
1279 | /.
|
---|
1280 | case $rule_number: {
|
---|
1281 | sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::And, sym(3).Expression);
|
---|
1282 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
---|
1283 | } break;
|
---|
1284 | ./
|
---|
1285 |
|
---|
1286 | LogicalANDExpressionNotIn: BitwiseORExpressionNotIn ;
|
---|
1287 |
|
---|
1288 | LogicalANDExpressionNotIn: LogicalANDExpressionNotIn T_AND_AND BitwiseORExpressionNotIn ;
|
---|
1289 | /.
|
---|
1290 | case $rule_number: {
|
---|
1291 | sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::And, sym(3).Expression);
|
---|
1292 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
---|
1293 | } break;
|
---|
1294 | ./
|
---|
1295 |
|
---|
1296 | LogicalORExpression: LogicalANDExpression ;
|
---|
1297 |
|
---|
1298 | LogicalORExpression: LogicalORExpression T_OR_OR LogicalANDExpression ;
|
---|
1299 | /.
|
---|
1300 | case $rule_number: {
|
---|
1301 | sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Or, sym(3).Expression);
|
---|
1302 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
---|
1303 | } break;
|
---|
1304 | ./
|
---|
1305 |
|
---|
1306 | LogicalORExpressionNotIn: LogicalANDExpressionNotIn ;
|
---|
1307 |
|
---|
1308 | LogicalORExpressionNotIn: LogicalORExpressionNotIn T_OR_OR LogicalANDExpressionNotIn ;
|
---|
1309 | /.
|
---|
1310 | case $rule_number: {
|
---|
1311 | sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Or, sym(3).Expression);
|
---|
1312 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
---|
1313 | } break;
|
---|
1314 | ./
|
---|
1315 |
|
---|
1316 | ConditionalExpression: LogicalORExpression ;
|
---|
1317 |
|
---|
1318 | ConditionalExpression: LogicalORExpression T_QUESTION AssignmentExpression T_COLON AssignmentExpression ;
|
---|
1319 | /.
|
---|
1320 | case $rule_number: {
|
---|
1321 | sym(1).Node = QScript::makeAstNode<QScript::AST::ConditionalExpression> (driver->nodePool(), sym(1).Expression, sym(3).Expression, sym(5).Expression);
|
---|
1322 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
---|
1323 | } break;
|
---|
1324 | ./
|
---|
1325 |
|
---|
1326 | ConditionalExpressionNotIn: LogicalORExpressionNotIn ;
|
---|
1327 |
|
---|
1328 | ConditionalExpressionNotIn: LogicalORExpressionNotIn T_QUESTION AssignmentExpressionNotIn T_COLON AssignmentExpressionNotIn ;
|
---|
1329 | /.
|
---|
1330 | case $rule_number: {
|
---|
1331 | sym(1).Node = QScript::makeAstNode<QScript::AST::ConditionalExpression> (driver->nodePool(), sym(1).Expression, sym(3).Expression, sym(5).Expression);
|
---|
1332 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
---|
1333 | } break;
|
---|
1334 | ./
|
---|
1335 |
|
---|
1336 | AssignmentExpression: ConditionalExpression ;
|
---|
1337 |
|
---|
1338 | AssignmentExpression: LeftHandSideExpression AssignmentOperator AssignmentExpression ;
|
---|
1339 | /.
|
---|
1340 | case $rule_number: {
|
---|
1341 | sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, sym(2).ival, sym(3).Expression);
|
---|
1342 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
---|
1343 | } break;
|
---|
1344 | ./
|
---|
1345 |
|
---|
1346 | AssignmentExpressionNotIn: ConditionalExpressionNotIn ;
|
---|
1347 |
|
---|
1348 | AssignmentExpressionNotIn: LeftHandSideExpression AssignmentOperator AssignmentExpressionNotIn ;
|
---|
1349 | /.
|
---|
1350 | case $rule_number: {
|
---|
1351 | sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, sym(2).ival, sym(3).Expression);
|
---|
1352 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
---|
1353 | } break;
|
---|
1354 | ./
|
---|
1355 |
|
---|
1356 | AssignmentOperator: T_EQ ;
|
---|
1357 | /.
|
---|
1358 | case $rule_number: {
|
---|
1359 | sym(1).ival = QSOperator::Assign;
|
---|
1360 | } break;
|
---|
1361 | ./
|
---|
1362 |
|
---|
1363 | AssignmentOperator: T_STAR_EQ ;
|
---|
1364 | /.
|
---|
1365 | case $rule_number: {
|
---|
1366 | sym(1).ival = QSOperator::InplaceMul;
|
---|
1367 | } break;
|
---|
1368 | ./
|
---|
1369 |
|
---|
1370 | AssignmentOperator: T_DIVIDE_EQ ;
|
---|
1371 | /.
|
---|
1372 | case $rule_number: {
|
---|
1373 | sym(1).ival = QSOperator::InplaceDiv;
|
---|
1374 | } break;
|
---|
1375 | ./
|
---|
1376 |
|
---|
1377 | AssignmentOperator: T_REMAINDER_EQ ;
|
---|
1378 | /.
|
---|
1379 | case $rule_number: {
|
---|
1380 | sym(1).ival = QSOperator::InplaceMod;
|
---|
1381 | } break;
|
---|
1382 | ./
|
---|
1383 |
|
---|
1384 | AssignmentOperator: T_PLUS_EQ ;
|
---|
1385 | /.
|
---|
1386 | case $rule_number: {
|
---|
1387 | sym(1).ival = QSOperator::InplaceAdd;
|
---|
1388 | } break;
|
---|
1389 | ./
|
---|
1390 |
|
---|
1391 | AssignmentOperator: T_MINUS_EQ ;
|
---|
1392 | /.
|
---|
1393 | case $rule_number: {
|
---|
1394 | sym(1).ival = QSOperator::InplaceSub;
|
---|
1395 | } break;
|
---|
1396 | ./
|
---|
1397 |
|
---|
1398 | AssignmentOperator: T_LT_LT_EQ ;
|
---|
1399 | /.
|
---|
1400 | case $rule_number: {
|
---|
1401 | sym(1).ival = QSOperator::InplaceLeftShift;
|
---|
1402 | } break;
|
---|
1403 | ./
|
---|
1404 |
|
---|
1405 | AssignmentOperator: T_GT_GT_EQ ;
|
---|
1406 | /.
|
---|
1407 | case $rule_number: {
|
---|
1408 | sym(1).ival = QSOperator::InplaceRightShift;
|
---|
1409 | } break;
|
---|
1410 | ./
|
---|
1411 |
|
---|
1412 | AssignmentOperator: T_GT_GT_GT_EQ ;
|
---|
1413 | /.
|
---|
1414 | case $rule_number: {
|
---|
1415 | sym(1).ival = QSOperator::InplaceURightShift;
|
---|
1416 | } break;
|
---|
1417 | ./
|
---|
1418 |
|
---|
1419 | AssignmentOperator: T_AND_EQ ;
|
---|
1420 | /.
|
---|
1421 | case $rule_number: {
|
---|
1422 | sym(1).ival = QSOperator::InplaceAnd;
|
---|
1423 | } break;
|
---|
1424 | ./
|
---|
1425 |
|
---|
1426 | AssignmentOperator: T_XOR_EQ ;
|
---|
1427 | /.
|
---|
1428 | case $rule_number: {
|
---|
1429 | sym(1).ival = QSOperator::InplaceXor;
|
---|
1430 | } break;
|
---|
1431 | ./
|
---|
1432 |
|
---|
1433 | AssignmentOperator: T_OR_EQ ;
|
---|
1434 | /.
|
---|
1435 | case $rule_number: {
|
---|
|
---|