1 | ----------------------------------------------------------------------------
|
---|
2 | --
|
---|
3 | -- Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
|
---|
4 | -- All rights reserved.
|
---|
5 | -- Contact: Nokia Corporation ([email protected])
|
---|
6 | --
|
---|
7 | -- This file is part of the QtScript module of the Qt Toolkit.
|
---|
8 | --
|
---|
9 | -- $QT_BEGIN_LICENSE:LGPL-ONLY$
|
---|
10 | -- GNU Lesser General Public License Usage
|
---|
11 | -- This file may be used under the terms of the GNU Lesser
|
---|
12 | -- General Public License version 2.1 as published by the Free Software
|
---|
13 | -- Foundation and appearing in the file LICENSE.LGPL included in the
|
---|
14 | -- packaging of this file. Please review the following information to
|
---|
15 | -- ensure the GNU Lesser General Public License version 2.1 requirements
|
---|
16 | -- will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
---|
17 | --
|
---|
18 | -- If you have questions regarding the use of this file, please contact
|
---|
19 | -- Nokia at [email protected].
|
---|
20 | -- $QT_END_LICENSE$
|
---|
21 | --
|
---|
22 | ----------------------------------------------------------------------------
|
---|
23 |
|
---|
24 | %parser QScriptGrammar
|
---|
25 | %decl qscriptparser_p.h
|
---|
26 | %impl qscriptparser.cpp
|
---|
27 | %expect 3
|
---|
28 | %expect-rr 1
|
---|
29 |
|
---|
30 | %token T_AND "&" T_AND_AND "&&" T_AND_EQ "&="
|
---|
31 | %token T_BREAK "break" T_CASE "case" T_CATCH "catch"
|
---|
32 | %token T_COLON ":" T_COMMA ";" T_CONTINUE "continue"
|
---|
33 | %token T_DEFAULT "default" T_DELETE "delete" T_DIVIDE_ "/"
|
---|
34 | %token T_DIVIDE_EQ "/=" T_DO "do" T_DOT "."
|
---|
35 | %token T_ELSE "else" T_EQ "=" T_EQ_EQ "=="
|
---|
36 | %token T_EQ_EQ_EQ "===" T_FINALLY "finally" T_FOR "for"
|
---|
37 | %token T_FUNCTION "function" T_GE ">=" T_GT ">"
|
---|
38 | %token T_GT_GT ">>" T_GT_GT_EQ ">>=" T_GT_GT_GT ">>>"
|
---|
39 | %token T_GT_GT_GT_EQ ">>>=" T_IDENTIFIER "identifier" T_IF "if"
|
---|
40 | %token T_IN "in" T_INSTANCEOF "instanceof" T_LBRACE "{"
|
---|
41 | %token T_LBRACKET "[" T_LE "<=" T_LPAREN "("
|
---|
42 | %token T_LT "<" T_LT_LT "<<" T_LT_LT_EQ "<<="
|
---|
43 | %token T_MINUS "-" T_MINUS_EQ "-=" T_MINUS_MINUS "--"
|
---|
44 | %token T_NEW "new" T_NOT "!" T_NOT_EQ "!="
|
---|
45 | %token T_NOT_EQ_EQ "!==" T_NUMERIC_LITERAL "numeric literal" T_OR "|"
|
---|
46 | %token T_OR_EQ "|=" T_OR_OR "||" T_PLUS "+"
|
---|
47 | %token T_PLUS_EQ "+=" T_PLUS_PLUS "++" T_QUESTION "?"
|
---|
48 | %token T_RBRACE "}" T_RBRACKET "]" T_REMAINDER "%"
|
---|
49 | %token T_REMAINDER_EQ "%=" T_RETURN "return" T_RPAREN ")"
|
---|
50 | %token T_SEMICOLON ";" T_AUTOMATIC_SEMICOLON T_STAR "*"
|
---|
51 | %token T_STAR_EQ "*=" T_STRING_LITERAL "string literal"
|
---|
52 | %token T_SWITCH "switch" T_THIS "this" T_THROW "throw"
|
---|
53 | %token T_TILDE "~" T_TRY "try" T_TYPEOF "typeof"
|
---|
54 | %token T_VAR "var" T_VOID "void" T_WHILE "while"
|
---|
55 | %token T_WITH "with" T_XOR "^" T_XOR_EQ "^="
|
---|
56 | %token T_NULL "null" T_TRUE "true" T_FALSE "false"
|
---|
57 | %token T_CONST "const"
|
---|
58 | %token T_DEBUGGER "debugger"
|
---|
59 | %token T_RESERVED_WORD "reserved word"
|
---|
60 |
|
---|
61 | %start Program
|
---|
62 |
|
---|
63 | /./****************************************************************************
|
---|
64 | **
|
---|
65 | ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
|
---|
66 | ** All rights reserved.
|
---|
67 | ** Contact: Nokia Corporation ([email protected])
|
---|
68 | **
|
---|
69 | ** This file is part of the QtScript module of the Qt Toolkit.
|
---|
70 | **
|
---|
71 | ** $QT_BEGIN_LICENSE:LGPL$
|
---|
72 | ** Commercial Usage
|
---|
73 | ** Licensees holding valid Qt Commercial licenses may use this file in
|
---|
74 | ** accordance with the Qt Commercial License Agreement provided with the
|
---|
75 | ** Software or, alternatively, in accordance with the terms contained in
|
---|
76 | ** a written agreement between you and Nokia.
|
---|
77 | **
|
---|
78 | ** GNU Lesser General Public License Usage
|
---|
79 | ** Alternatively, this file may be used under the terms of the GNU Lesser
|
---|
80 | ** General Public License version 2.1 as published by the Free Software
|
---|
81 | ** Foundation and appearing in the file LICENSE.LGPL included in the
|
---|
82 | ** packaging of this file. Please review the following information to
|
---|
83 | ** ensure the GNU Lesser General Public License version 2.1 requirements
|
---|
84 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
---|
85 | **
|
---|
86 | ** In addition, as a special exception, Nokia gives you certain additional
|
---|
87 | ** rights. These rights are described in the Nokia Qt LGPL Exception
|
---|
88 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
---|
89 | **
|
---|
90 | ** GNU General Public License Usage
|
---|
91 | ** Alternatively, this file may be used under the terms of the GNU
|
---|
92 | ** General Public License version 3.0 as published by the Free Software
|
---|
93 | ** Foundation and appearing in the file LICENSE.GPL included in the
|
---|
94 | ** packaging of this file. Please review the following information to
|
---|
95 | ** ensure the GNU General Public License version 3.0 requirements will be
|
---|
96 | ** met: http://www.gnu.org/copyleft/gpl.html.
|
---|
97 | **
|
---|
98 | ** If you have questions regarding the use of this file, please contact
|
---|
99 | ** Nokia at [email protected].
|
---|
100 | ** $QT_END_LICENSE$
|
---|
101 | **
|
---|
102 | ****************************************************************************/
|
---|
103 |
|
---|
104 | // This file was generated by qlalr - DO NOT EDIT!
|
---|
105 |
|
---|
106 |
|
---|
107 | #include <QtCore/QtDebug>
|
---|
108 |
|
---|
109 | #include <string.h>
|
---|
110 |
|
---|
111 | #define Q_SCRIPT_UPDATE_POSITION(node, startloc, endloc) do { \
|
---|
112 | node->startLine = startloc.startLine; \
|
---|
113 | node->startColumn = startloc.startColumn; \
|
---|
114 | node->endLine = endloc.endLine; \
|
---|
115 | node->endColumn = endloc.endColumn; \
|
---|
116 | } while (0)
|
---|
117 |
|
---|
118 | ./
|
---|
119 |
|
---|
120 | /:/****************************************************************************
|
---|
121 | **
|
---|
122 | ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
|
---|
123 | ** All rights reserved.
|
---|
124 | ** Contact: Nokia Corporation ([email protected])
|
---|
125 | **
|
---|
126 | ** This file is part of the QtScript module of the Qt Toolkit.
|
---|
127 | **
|
---|
128 | ** $QT_BEGIN_LICENSE:LGPL$
|
---|
129 | ** Commercial Usage
|
---|
130 | ** Licensees holding valid Qt Commercial licenses may use this file in
|
---|
131 | ** accordance with the Qt Commercial License Agreement provided with the
|
---|
132 | ** Software or, alternatively, in accordance with the terms contained in
|
---|
133 | ** a written agreement between you and Nokia.
|
---|
134 | **
|
---|
135 | ** GNU Lesser General Public License Usage
|
---|
136 | ** Alternatively, this file may be used under the terms of the GNU Lesser
|
---|
137 | ** General Public License version 2.1 as published by the Free Software
|
---|
138 | ** Foundation and appearing in the file LICENSE.LGPL included in the
|
---|
139 | ** packaging of this file. Please review the following information to
|
---|
140 | ** ensure the GNU Lesser General Public License version 2.1 requirements
|
---|
141 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
---|
142 | **
|
---|
143 | ** In addition, as a special exception, Nokia gives you certain additional
|
---|
144 | ** rights. These rights are described in the Nokia Qt LGPL Exception
|
---|
145 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
---|
146 | **
|
---|
147 | ** GNU General Public License Usage
|
---|
148 | ** Alternatively, this file may be used under the terms of the GNU
|
---|
149 | ** General Public License version 3.0 as published by the Free Software
|
---|
150 | ** Foundation and appearing in the file LICENSE.GPL included in the
|
---|
151 | ** packaging of this file. Please review the following information to
|
---|
152 | ** ensure the GNU General Public License version 3.0 requirements will be
|
---|
153 | ** met: http://www.gnu.org/copyleft/gpl.html.
|
---|
154 | **
|
---|
155 | ** If you have questions regarding the use of this file, please contact
|
---|
156 | ** Nokia at [email protected].
|
---|
157 | ** $QT_END_LICENSE$
|
---|
158 | **
|
---|
159 | ****************************************************************************/
|
---|
160 |
|
---|
161 | // This file was generated by qlalr - DO NOT EDIT!
|
---|
162 |
|
---|
163 |
|
---|
164 | //
|
---|
165 | // W A R N I N G
|
---|
166 | // -------------
|
---|
167 | //
|
---|
168 | // This file is not part of the Qt API. It exists purely as an
|
---|
169 | // implementation detail. This header file may change from version to
|
---|
170 | // version without notice, or even be removed.
|
---|
171 | //
|
---|
172 | // We mean it.
|
---|
173 | //
|
---|
174 |
|
---|
175 | //
|
---|
176 | // This file is automatically generated from qscript.g.
|
---|
177 | // Changes will be lost.
|
---|
178 | //
|
---|
179 |
|
---|
180 | #ifndef QSCRIPTPARSER_P_H
|
---|
181 | #define QSCRIPTPARSER_P_H
|
---|
182 |
|
---|
183 | #include "qscriptgrammar_p.h"
|
---|
184 |
|
---|
185 | #include "qscriptastfwd_p.h"
|
---|
186 |
|
---|
187 | QT_BEGIN_NAMESPACE
|
---|
188 |
|
---|
189 | class QString;
|
---|
190 | class QScriptEnginePrivate;
|
---|
191 | class QScriptNameIdImpl;
|
---|
192 |
|
---|
193 | class QScriptParser: protected $table
|
---|
194 | {
|
---|
195 | public:
|
---|
196 | union Value {
|
---|
197 | int ival;
|
---|
198 | double dval;
|
---|
199 | QScriptNameIdImpl *sval;
|
---|
200 | QScript::AST::ArgumentList *ArgumentList;
|
---|
201 | QScript::AST::CaseBlock *CaseBlock;
|
---|
202 | QScript::AST::CaseClause *CaseClause;
|
---|
203 | QScript::AST::CaseClauses *CaseClauses;
|
---|
204 | QScript::AST::Catch *Catch;
|
---|
205 | QScript::AST::DefaultClause *DefaultClause;
|
---|
206 | QScript::AST::ElementList *ElementList;
|
---|
207 | QScript::AST::Elision *Elision;
|
---|
208 | QScript::AST::ExpressionNode *Expression;
|
---|
209 | QScript::AST::Finally *Finally;
|
---|
210 | QScript::AST::FormalParameterList *FormalParameterList;
|
---|
211 | QScript::AST::FunctionBody *FunctionBody;
|
---|
212 | QScript::AST::FunctionDeclaration *FunctionDeclaration;
|
---|
213 | QScript::AST::Node *Node;
|
---|
214 | QScript::AST::PropertyName *PropertyName;
|
---|
215 | QScript::AST::PropertyNameAndValueList *PropertyNameAndValueList;
|
---|
216 | QScript::AST::SourceElement *SourceElement;
|
---|
217 | QScript::AST::SourceElements *SourceElements;
|
---|
218 | QScript::AST::Statement *Statement;
|
---|
219 | QScript::AST::StatementList *StatementList;
|
---|
220 | QScript::AST::VariableDeclaration *VariableDeclaration;
|
---|
221 | QScript::AST::VariableDeclarationList *VariableDeclarationList;
|
---|
222 | };
|
---|
223 |
|
---|
224 | struct Location {
|
---|
225 | int startLine;
|
---|
226 | int startColumn;
|
---|
227 | int endLine;
|
---|
228 | int endColumn;
|
---|
229 | };
|
---|
230 |
|
---|
231 | public:
|
---|
232 | QScriptParser();
|
---|
233 | ~QScriptParser();
|
---|
234 |
|
---|
235 | bool parse(QScriptEnginePrivate *driver);
|
---|
236 |
|
---|
237 | inline QString errorMessage() const
|
---|
238 | { return error_message; }
|
---|
239 | inline int errorLineNumber() const
|
---|
240 | { return error_lineno; }
|
---|
241 | inline int errorColumnNumber() const
|
---|
242 | { return error_column; }
|
---|
243 |
|
---|
244 | protected:
|
---|
245 | inline void reallocateStack();
|
---|
246 |
|
---|
247 | inline Value &sym(int index)
|
---|
248 | { return sym_stack [tos + index - 1]; }
|
---|
249 |
|
---|
250 | inline Location &loc(int index)
|
---|
251 | { return location_stack [tos + index - 2]; }
|
---|
252 |
|
---|
253 | protected:
|
---|
254 | int tos;
|
---|
255 | int stack_size;
|
---|
256 | Value *sym_stack;
|
---|
257 | int *state_stack;
|
---|
258 | Location *location_stack;
|
---|
259 | QString error_message;
|
---|
260 | int error_lineno;
|
---|
261 | int error_column;
|
---|
262 | };
|
---|
263 |
|
---|
264 | inline void QScriptParser::reallocateStack()
|
---|
265 | {
|
---|
266 | if (! stack_size)
|
---|
267 | stack_size = 128;
|
---|
268 | else
|
---|
269 | stack_size <<= 1;
|
---|
270 |
|
---|
271 | sym_stack = reinterpret_cast<Value*> (qRealloc(sym_stack, stack_size * sizeof(Value)));
|
---|
272 | state_stack = reinterpret_cast<int*> (qRealloc(state_stack, stack_size * sizeof(int)));
|
---|
273 | location_stack = reinterpret_cast<Location*> (qRealloc(location_stack, stack_size * sizeof(Location)));
|
---|
274 | }
|
---|
275 |
|
---|
276 | :/
|
---|
277 |
|
---|
278 |
|
---|
279 | /.
|
---|
280 |
|
---|
281 | #include "qscriptparser_p.h"
|
---|
282 |
|
---|
283 | //
|
---|
284 | // This file is automatically generated from qscript.g.
|
---|
285 | // Changes will be lost.
|
---|
286 | //
|
---|
287 |
|
---|
288 | QT_BEGIN_NAMESPACE
|
---|
289 |
|
---|
290 | inline static bool automatic(QScriptEnginePrivate *driver, int token)
|
---|
291 | {
|
---|
292 | return token == $table::T_RBRACE
|
---|
293 | || token == 0
|
---|
294 | || driver->lexer()->prevTerminator();
|
---|
295 | }
|
---|
296 |
|
---|
297 |
|
---|
298 | QScriptParser::QScriptParser():
|
---|
299 | tos(0),
|
---|
300 | stack_size(0),
|
---|
301 | sym_stack(0),
|
---|
302 | state_stack(0),
|
---|
303 | location_stack(0)
|
---|
304 | {
|
---|
305 | }
|
---|
306 |
|
---|
307 | QScriptParser::~QScriptParser()
|
---|
308 | {
|
---|
309 | if (stack_size) {
|
---|
310 | qFree(sym_stack);
|
---|
311 | qFree(state_stack);
|
---|
312 | qFree(location_stack);
|
---|
313 | }
|
---|
314 | }
|
---|
315 |
|
---|
316 | static inline QScriptParser::Location location(QScript::Lexer *lexer)
|
---|
317 | {
|
---|
318 | QScriptParser::Location loc;
|
---|
319 | loc.startLine = lexer->startLineNo();
|
---|
320 | loc.startColumn = lexer->startColumnNo();
|
---|
321 | loc.endLine = lexer->endLineNo();
|
---|
322 | loc.endColumn = lexer->endColumnNo();
|
---|
323 | return loc;
|
---|
324 | }
|
---|
325 |
|
---|
326 | bool QScriptParser::parse(QScriptEnginePrivate *driver)
|
---|
327 | {
|
---|
328 | const int INITIAL_STATE = 0;
|
---|
329 | QScript::Lexer *lexer = driver->lexer();
|
---|
330 |
|
---|
331 | int yytoken = -1;
|
---|
332 | int saved_yytoken = -1;
|
---|
333 |
|
---|
334 | reallocateStack();
|
---|
335 |
|
---|
336 | tos = 0;
|
---|
337 | state_stack[++tos] = INITIAL_STATE;
|
---|
338 |
|
---|
339 | while (true)
|
---|
340 | {
|
---|
341 | const int state = state_stack [tos];
|
---|
342 | if (yytoken == -1 && - TERMINAL_COUNT != action_index [state])
|
---|
343 | {
|
---|
344 | if (saved_yytoken == -1)
|
---|
345 | {
|
---|
346 | yytoken = lexer->lex();
|
---|
347 | location_stack [tos] = location(lexer);
|
---|
348 | }
|
---|
349 | else
|
---|
350 | {
|
---|
351 | yytoken = saved_yytoken;
|
---|
352 | saved_yytoken = -1;
|
---|
353 | }
|
---|
354 | }
|
---|
355 |
|
---|
356 | int act = t_action (state, yytoken);
|
---|
357 |
|
---|
358 | if (act == ACCEPT_STATE)
|
---|
359 | return true;
|
---|
360 |
|
---|
361 | else if (act > 0)
|
---|
362 | {
|
---|
363 | if (++tos == stack_size)
|
---|
364 | reallocateStack();
|
---|
365 |
|
---|
366 | sym_stack [tos].dval = lexer->dval ();
|
---|
367 | state_stack [tos] = act;
|
---|
368 | location_stack [tos] = location(lexer);
|
---|
369 | yytoken = -1;
|
---|
370 | }
|
---|
371 |
|
---|
372 | else if (act < 0)
|
---|
373 | {
|
---|
374 | int r = - act - 1;
|
---|
375 |
|
---|
376 | tos -= rhs [r];
|
---|
377 | act = state_stack [tos++];
|
---|
378 |
|
---|
379 | switch (r) {
|
---|
380 | ./
|
---|
381 |
|
---|
382 | PrimaryExpression: T_THIS ;
|
---|
383 | /.
|
---|
384 | case $rule_number: {
|
---|
385 | sym(1).Node = QScript::makeAstNode<QScript::AST::ThisExpression> (driver->nodePool());
|
---|
386 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
|
---|
387 | } break;
|
---|
388 | ./
|
---|
389 |
|
---|
390 | PrimaryExpression: T_IDENTIFIER ;
|
---|
391 | /.
|
---|
392 | case $rule_number: {
|
---|
393 | sym(1).Node = QScript::makeAstNode<QScript::AST::IdentifierExpression> (driver->nodePool(), sym(1).sval);
|
---|
394 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
|
---|
395 | } break;
|
---|
396 | ./
|
---|
397 |
|
---|
398 | PrimaryExpression: T_NULL ;
|
---|
399 | /.
|
---|
400 | case $rule_number: {
|
---|
401 | sym(1).Node = QScript::makeAstNode<QScript::AST::NullExpression> (driver->nodePool());
|
---|
402 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
|
---|
403 | } break;
|
---|
404 | ./
|
---|
405 |
|
---|
406 | PrimaryExpression: T_TRUE ;
|
---|
407 | /.
|
---|
408 | case $rule_number: {
|
---|
409 | sym(1).Node = QScript::makeAstNode<QScript::AST::TrueLiteral> (driver->nodePool());
|
---|
410 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
|
---|
411 | } break;
|
---|
412 | ./
|
---|
413 |
|
---|
414 | PrimaryExpression: T_FALSE ;
|
---|
415 | /.
|
---|
416 | case $rule_number: {
|
---|
417 | sym(1).Node = QScript::makeAstNode<QScript::AST::FalseLiteral> (driver->nodePool());
|
---|
418 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
|
---|
419 | } break;
|
---|
420 | ./
|
---|
421 |
|
---|
422 | PrimaryExpression: T_NUMERIC_LITERAL ;
|
---|
423 | /.
|
---|
424 | case $rule_number: {
|
---|
425 | sym(1).Node = QScript::makeAstNode<QScript::AST::NumericLiteral> (driver->nodePool(), sym(1).dval);
|
---|
426 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
|
---|
427 | } break;
|
---|
428 | ./
|
---|
429 |
|
---|
430 | PrimaryExpression: T_STRING_LITERAL ;
|
---|
431 | /.
|
---|
432 | case $rule_number: {
|
---|
433 | sym(1).Node = QScript::makeAstNode<QScript::AST::StringLiteral> (driver->nodePool(), sym(1).sval);
|
---|
434 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
|
---|
435 | } break;
|
---|
436 | ./
|
---|
437 |
|
---|
438 | PrimaryExpression: T_DIVIDE_ ;
|
---|
439 | /:
|
---|
440 | #define Q_SCRIPT_REGEXPLITERAL_RULE1 $rule_number
|
---|
441 | :/
|
---|
442 | /.
|
---|
443 | case $rule_number: {
|
---|
444 | bool rx = lexer->scanRegExp(QScript::Lexer::NoPrefix);
|
---|
445 | if (!rx) {
|
---|
446 | error_message = lexer->errorMessage();
|
---|
447 | error_lineno = lexer->startLineNo();
|
---|
448 | error_column = lexer->startColumnNo();
|
---|
449 | return false;
|
---|
450 | }
|
---|
451 | sym(1).Node = QScript::makeAstNode<QScript::AST::RegExpLiteral> (driver->nodePool(), lexer->pattern, lexer->flags);
|
---|
452 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
|
---|
453 | } break;
|
---|
454 | ./
|
---|
455 |
|
---|
456 | PrimaryExpression: T_DIVIDE_EQ ;
|
---|
457 | /:
|
---|
458 | #define Q_SCRIPT_REGEXPLITERAL_RULE2 $rule_number
|
---|
459 | :/
|
---|
460 | /.
|
---|
461 | case $rule_number: {
|
---|
462 | bool rx = lexer->scanRegExp(QScript::Lexer::EqualPrefix);
|
---|
463 | if (!rx) {
|
---|
464 | error_message = lexer->errorMessage();
|
---|
465 | error_lineno = lexer->startLineNo();
|
---|
466 | error_column = lexer->startColumnNo();
|
---|
467 | return false;
|
---|
468 | }
|
---|
469 | sym(1).Node = QScript::makeAstNode<QScript::AST::RegExpLiteral> (driver->nodePool(), lexer->pattern, lexer->flags);
|
---|
470 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
|
---|
471 | } break;
|
---|
472 | ./
|
---|
473 |
|
---|
474 | PrimaryExpression: T_LBRACKET ElisionOpt T_RBRACKET ;
|
---|
475 | /.
|
---|
476 | case $rule_number: {
|
---|
477 | sym(1).Node = QScript::makeAstNode<QScript::AST::ArrayLiteral> (driver->nodePool(), sym(2).Elision);
|
---|
478 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
---|
479 | } break;
|
---|
480 | ./
|
---|
481 |
|
---|
482 | PrimaryExpression: T_LBRACKET ElementList T_RBRACKET ;
|
---|
483 | /.
|
---|
484 | case $rule_number: {
|
---|
485 | sym(1).Node = QScript::makeAstNode<QScript::AST::ArrayLiteral> (driver->nodePool(), sym(2).ElementList->finish ());
|
---|
486 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
---|
487 | } break;
|
---|
488 | ./
|
---|
489 |
|
---|
490 | PrimaryExpression: T_LBRACKET ElementList T_COMMA ElisionOpt T_RBRACKET ;
|
---|
491 | /.
|
---|
492 | case $rule_number: {
|
---|
493 | sym(1).Node = QScript::makeAstNode<QScript::AST::ArrayLiteral> (driver->nodePool(), sym(2).ElementList->finish (), sym(4).Elision);
|
---|
494 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(5));
|
---|
495 | } break;
|
---|
496 | ./
|
---|
497 |
|
---|
498 | -- PrimaryExpression: T_LBRACE T_RBRACE ;
|
---|
499 | -- /.
|
---|
500 | -- case $rule_number: {
|
---|
501 | -- sym(1).Node = QScript::makeAstNode<QScript::AST::ObjectLiteral> (driver->nodePool());
|
---|
502 | -- Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
|
---|
503 | -- } break;
|
---|
504 | -- ./
|
---|
505 |
|
---|
506 | PrimaryExpression: T_LBRACE PropertyNameAndValueListOpt T_RBRACE ;
|
---|
507 | /.
|
---|
508 | case $rule_number: {
|
---|
509 | if (sym(2).Node)
|
---|
510 | sym(1).Node = QScript::makeAstNode<QScript::AST::ObjectLiteral> (driver->nodePool(), sym(2).PropertyNameAndValueList->finish ());
|
---|
511 | else
|
---|
512 | sym(1).Node = QScript::makeAstNode<QScript::AST::ObjectLiteral> (driver->nodePool());
|
---|
513 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
---|
514 | } break;
|
---|
515 | ./
|
---|
516 |
|
---|
517 | PrimaryExpression: T_LBRACE PropertyNameAndValueList T_COMMA T_RBRACE ;
|
---|
518 | /.
|
---|
519 | case $rule_number: {
|
---|
520 | sym(1).Node = QScript::makeAstNode<QScript::AST::ObjectLiteral> (driver->nodePool(), sym(2).PropertyNameAndValueList->finish ());
|
---|
521 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(4));
|
---|
522 | } break;
|
---|
523 | ./
|
---|
524 |
|
---|
525 | PrimaryExpression: T_LPAREN Expression T_RPAREN ;
|
---|
526 | /.
|
---|
527 | case $rule_number: {
|
---|
528 | sym(1) = sym(2);
|
---|
529 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
---|
530 | } break;
|
---|
531 | ./
|
---|
532 |
|
---|
533 | ElementList: ElisionOpt AssignmentExpression ;
|
---|
534 | /.
|
---|
535 | case $rule_number: {
|
---|
536 | sym(1).Node = QScript::makeAstNode<QScript::AST::ElementList> (driver->nodePool(), sym(1).Elision, sym(2).Expression);
|
---|
537 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
|
---|
538 | } break;
|
---|
539 | ./
|
---|
540 |
|
---|
541 | ElementList: ElementList T_COMMA ElisionOpt AssignmentExpression ;
|
---|
542 | /.
|
---|
543 | case $rule_number: {
|
---|
544 | sym(1).Node = QScript::makeAstNode<QScript::AST::ElementList> (driver->nodePool(), sym(1).ElementList, sym(3).Elision, sym(4).Expression);
|
---|
545 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(4));
|
---|
546 | } break;
|
---|
547 | ./
|
---|
548 |
|
---|
549 | Elision: T_COMMA ;
|
---|
550 | /.
|
---|
551 | case $rule_number: {
|
---|
552 | sym(1).Node = QScript::makeAstNode<QScript::AST::Elision> (driver->nodePool());
|
---|
553 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
|
---|
554 | } break;
|
---|
555 | ./
|
---|
556 |
|
---|
557 | Elision: Elision T_COMMA ;
|
---|
558 | /.
|
---|
559 | case $rule_number: {
|
---|
560 | sym(1).Node = QScript::makeAstNode<QScript::AST::Elision> (driver->nodePool(), sym(1).Elision);
|
---|
561 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
|
---|
562 | } break;
|
---|
563 | ./
|
---|
564 |
|
---|
565 | ElisionOpt: ;
|
---|
566 | /.
|
---|
567 | case $rule_number: {
|
---|
568 | sym(1).Node = 0;
|
---|
569 | } break;
|
---|
570 | ./
|
---|
571 |
|
---|
572 | ElisionOpt: Elision ;
|
---|
573 | /.
|
---|
574 | case $rule_number: {
|
---|
575 | sym(1).Elision = sym(1).Elision->finish ();
|
---|
576 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
|
---|
577 | } break;
|
---|
578 | ./
|
---|
579 |
|
---|
580 | PropertyNameAndValueList: PropertyName T_COLON AssignmentExpression ;
|
---|
581 | /.
|
---|
582 | case $rule_number: {
|
---|
583 | sym(1).Node = QScript::makeAstNode<QScript::AST::PropertyNameAndValueList> (driver->nodePool(), sym(1).PropertyName, sym(3).Expression);
|
---|
584 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
---|
585 | } break;
|
---|
586 | ./
|
---|
587 |
|
---|
588 | PropertyNameAndValueList: PropertyNameAndValueList T_COMMA PropertyName T_COLON AssignmentExpression ;
|
---|
589 | /.
|
---|
590 | case $rule_number: {
|
---|
591 | sym(1).Node = QScript::makeAstNode<QScript::AST::PropertyNameAndValueList> (driver->nodePool(), sym(1).PropertyNameAndValueList, sym(3).PropertyName, sym(5).Expression);
|
---|
592 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(5));
|
---|
593 | } break;
|
---|
594 | ./
|
---|
595 |
|
---|
596 | PropertyName: T_IDENTIFIER ;
|
---|
597 | /.
|
---|
598 | case $rule_number: {
|
---|
599 | sym(1).Node = QScript::makeAstNode<QScript::AST::IdentifierPropertyName> (driver->nodePool(), sym(1).sval);
|
---|
600 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
|
---|
601 | } break;
|
---|
602 | ./
|
---|
603 |
|
---|
604 | PropertyName: T_STRING_LITERAL ;
|
---|
605 | /.
|
---|
606 | case $rule_number: {
|
---|
607 | sym(1).Node = QScript::makeAstNode<QScript::AST::StringLiteralPropertyName> (driver->nodePool(), sym(1).sval);
|
---|
608 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
|
---|
609 | } break;
|
---|
610 | ./
|
---|
611 |
|
---|
612 | PropertyName: T_NUMERIC_LITERAL ;
|
---|
613 | /.
|
---|
614 | case $rule_number: {
|
---|
615 | sym(1).Node = QScript::makeAstNode<QScript::AST::NumericLiteralPropertyName> (driver->nodePool(), sym(1).dval);
|
---|
616 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
|
---|
617 | } break;
|
---|
618 | ./
|
---|
619 |
|
---|
620 | PropertyName: ReservedIdentifier ;
|
---|
621 | /.
|
---|
622 | case $rule_number: {
|
---|
623 | sym(1).Node = QScript::makeAstNode<QScript::AST::IdentifierPropertyName> (driver->nodePool(), sym(1).sval);
|
---|
624 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
|
---|
625 | } break;
|
---|
626 | ./
|
---|
627 |
|
---|
628 | ReservedIdentifier: T_BREAK ;
|
---|
629 | /.
|
---|
630 | case $rule_number:
|
---|
631 | ./
|
---|
632 | ReservedIdentifier: T_CASE ;
|
---|
633 | /.
|
---|
634 | case $rule_number:
|
---|
635 | ./
|
---|
636 | ReservedIdentifier: T_CATCH ;
|
---|
637 | /.
|
---|
638 | case $rule_number:
|
---|
639 | ./
|
---|
640 | ReservedIdentifier: T_CONTINUE ;
|
---|
641 | /.
|
---|
642 | case $rule_number:
|
---|
643 | ./
|
---|
644 | ReservedIdentifier: T_DEFAULT ;
|
---|
645 | /.
|
---|
646 | case $rule_number:
|
---|
647 | ./
|
---|
648 | ReservedIdentifier: T_DELETE ;
|
---|
649 | /.
|
---|
650 | case $rule_number:
|
---|
651 | ./
|
---|
652 | ReservedIdentifier: T_DO ;
|
---|
653 | /.
|
---|
654 | case $rule_number:
|
---|
655 | ./
|
---|
656 | ReservedIdentifier: T_ELSE ;
|
---|
657 | /.
|
---|
658 | case $rule_number:
|
---|
659 | ./
|
---|
660 | ReservedIdentifier: T_FALSE ;
|
---|
661 | /.
|
---|
662 | case $rule_number:
|
---|
663 | ./
|
---|
664 | ReservedIdentifier: T_FINALLY ;
|
---|
665 | /.
|
---|
666 | case $rule_number:
|
---|
667 | ./
|
---|
668 | ReservedIdentifier: T_FOR ;
|
---|
669 | /.
|
---|
670 | case $rule_number:
|
---|
671 | ./
|
---|
672 | ReservedIdentifier: T_FUNCTION ;
|
---|
673 | /.
|
---|
674 | case $rule_number:
|
---|
675 | ./
|
---|
676 | ReservedIdentifier: T_IF ;
|
---|
677 | /.
|
---|
678 | case $rule_number:
|
---|
679 | ./
|
---|
680 | ReservedIdentifier: T_IN ;
|
---|
681 | /.
|
---|
682 | case $rule_number:
|
---|
683 | ./
|
---|
684 | ReservedIdentifier: T_INSTANCEOF ;
|
---|
685 | /.
|
---|
686 | case $rule_number:
|
---|
687 | ./
|
---|
688 | ReservedIdentifier: T_NEW ;
|
---|
689 | /.
|
---|
690 | case $rule_number:
|
---|
691 | ./
|
---|
692 | ReservedIdentifier: T_NULL ;
|
---|
693 | /.
|
---|
694 | case $rule_number:
|
---|
695 | ./
|
---|
696 | ReservedIdentifier: T_RETURN ;
|
---|
697 | /.
|
---|
698 | case $rule_number:
|
---|
699 | ./
|
---|
700 | ReservedIdentifier: T_SWITCH ;
|
---|
701 | /.
|
---|
702 | case $rule_number:
|
---|
703 | ./
|
---|
704 | ReservedIdentifier: T_THIS ;
|
---|
705 | /.
|
---|
706 | case $rule_number:
|
---|
707 | ./
|
---|
708 | ReservedIdentifier: T_THROW ;
|
---|
709 | /.
|
---|
710 | case $rule_number:
|
---|
711 | ./
|
---|
712 | ReservedIdentifier: T_TRUE ;
|
---|
713 | /.
|
---|
714 | case $rule_number:
|
---|
715 | ./
|
---|
716 | ReservedIdentifier: T_TRY ;
|
---|
717 | /.
|
---|
718 | case $rule_number:
|
---|
719 | ./
|
---|
720 | ReservedIdentifier: T_TYPEOF ;
|
---|
721 | /.
|
---|
722 | case $rule_number:
|
---|
723 | ./
|
---|
724 | ReservedIdentifier: T_VAR ;
|
---|
725 | /.
|
---|
726 | case $rule_number:
|
---|
727 | ./
|
---|
728 | ReservedIdentifier: T_VOID ;
|
---|
729 | /.
|
---|
730 | case $rule_number:
|
---|
731 | ./
|
---|
732 | ReservedIdentifier: T_WHILE ;
|
---|
733 | /.
|
---|
734 | case $rule_number:
|
---|
735 | ./
|
---|
736 | ReservedIdentifier: T_CONST ;
|
---|
737 | /.
|
---|
738 | case $rule_number:
|
---|
739 | ./
|
---|
740 | ReservedIdentifier: T_DEBUGGER ;
|
---|
741 | /.
|
---|
742 | case $rule_number:
|
---|
743 | ./
|
---|
744 | ReservedIdentifier: T_RESERVED_WORD ;
|
---|
745 | /.
|
---|
746 | case $rule_number:
|
---|
747 | ./
|
---|
748 | ReservedIdentifier: T_WITH ;
|
---|
749 | /.
|
---|
750 | case $rule_number:
|
---|
751 | {
|
---|
752 | sym(1).sval = driver->intern(lexer->characterBuffer(), lexer->characterCount());
|
---|
753 | } break;
|
---|
754 | ./
|
---|
755 |
|
---|
756 | PropertyIdentifier: T_IDENTIFIER ;
|
---|
757 | PropertyIdentifier: ReservedIdentifier ;
|
---|
758 |
|
---|
759 | MemberExpression: PrimaryExpression ;
|
---|
760 | MemberExpression: FunctionExpression ;
|
---|
761 |
|
---|
762 | MemberExpression: MemberExpression T_LBRACKET Expression T_RBRACKET ;
|
---|
763 | /.
|
---|
764 | case $rule_number: {
|
---|
765 | sym(1).Node = QScript::makeAstNode<QScript::AST::ArrayMemberExpression> (driver->nodePool(), sym(1).Expression, sym(3).Expression);
|
---|
766 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(4));
|
---|
767 | } break;
|
---|
768 | ./
|
---|
769 |
|
---|
770 | MemberExpression: MemberExpression T_DOT PropertyIdentifier ;
|
---|
771 | /.
|
---|
772 | case $rule_number: {
|
---|
773 | sym(1).Node = QScript::makeAstNode<QScript::AST::FieldMemberExpression> (driver->nodePool(), sym(1).Expression, sym(3).sval);
|
---|
774 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(4));
|
---|
775 | } break;
|
---|
776 | ./
|
---|
777 |
|
---|
778 | MemberExpression: T_NEW MemberExpression Arguments ;
|
---|
779 | /.
|
---|
780 | case $rule_number: {
|
---|
781 | sym(1).Node = QScript::makeAstNode<QScript::AST::NewMemberExpression> (driver->nodePool(), sym(2).Expression, sym(3).ArgumentList);
|
---|
782 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
---|
783 | } break;
|
---|
784 | ./
|
---|
785 |
|
---|
786 | NewExpression: MemberExpression ;
|
---|
787 |
|
---|
788 | NewExpression: T_NEW NewExpression ;
|
---|
789 | /.
|
---|
790 | case $rule_number: {
|
---|
791 | sym(1).Node = QScript::makeAstNode<QScript::AST::NewExpression> (driver->nodePool(), sym(2).Expression);
|
---|
792 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
|
---|
793 | } break;
|
---|
794 | ./
|
---|
795 |
|
---|
796 | CallExpression: MemberExpression Arguments ;
|
---|
797 | /.
|
---|
798 | case $rule_number: {
|
---|
799 | sym(1).Node = QScript::makeAstNode<QScript::AST::CallExpression> (driver->nodePool(), sym(1).Expression, sym(2).ArgumentList);
|
---|
800 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
|
---|
801 | } break;
|
---|
802 | ./
|
---|
803 |
|
---|
804 | CallExpression: CallExpression Arguments ;
|
---|
805 | /.
|
---|
806 | case $rule_number: {
|
---|
807 | sym(1).Node = QScript::makeAstNode<QScript::AST::CallExpression> (driver->nodePool(), sym(1).Expression, sym(2).ArgumentList);
|
---|
808 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
|
---|
809 | } break;
|
---|
810 | ./
|
---|
811 |
|
---|
812 | CallExpression: CallExpression T_LBRACKET Expression T_RBRACKET ;
|
---|
813 | /.
|
---|
814 | case $rule_number: {
|
---|
815 | sym(1).Node = QScript::makeAstNode<QScript::AST::ArrayMemberExpression> (driver->nodePool(), sym(1).Expression, sym(3).Expression);
|
---|
816 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(4));
|
---|
817 | } break;
|
---|
818 | ./
|
---|
819 |
|
---|
820 | CallExpression: CallExpression T_DOT PropertyIdentifier ;
|
---|
821 | /.
|
---|
822 | case $rule_number: {
|
---|
823 | sym(1).Node = QScript::makeAstNode<QScript::AST::FieldMemberExpression> (driver->nodePool(), sym(1).Expression, sym(3).sval);
|
---|
824 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
---|
825 | } break;
|
---|
826 | ./
|
---|
827 |
|
---|
828 | Arguments: T_LPAREN T_RPAREN ;
|
---|
829 | /.
|
---|
830 | case $rule_number: {
|
---|
831 | sym(1).Node = 0;
|
---|
832 | } break;
|
---|
833 | ./
|
---|
834 |
|
---|
835 | Arguments: T_LPAREN ArgumentList T_RPAREN ;
|
---|
836 | /.
|
---|
837 | case $rule_number: {
|
---|
838 | sym(1).Node = sym(2).ArgumentList->finish ();
|
---|
839 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
---|
840 | } break;
|
---|
841 | ./
|
---|
842 |
|
---|
843 | ArgumentList: AssignmentExpression ;
|
---|
844 | /.
|
---|
845 | case $rule_number: {
|
---|
846 | sym(1).Node = QScript::makeAstNode<QScript::AST::ArgumentList> (driver->nodePool(), sym(1).Expression);
|
---|
847 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(1));
|
---|
848 | } break;
|
---|
849 | ./
|
---|
850 |
|
---|
851 | ArgumentList: ArgumentList T_COMMA AssignmentExpression ;
|
---|
852 | /.
|
---|
853 | case $rule_number: {
|
---|
854 | sym(1).Node = QScript::makeAstNode<QScript::AST::ArgumentList> (driver->nodePool(), sym(1).ArgumentList, sym(3).Expression);
|
---|
855 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
---|
856 | } break;
|
---|
857 | ./
|
---|
858 |
|
---|
859 | LeftHandSideExpression: NewExpression ;
|
---|
860 | LeftHandSideExpression: CallExpression ;
|
---|
861 | PostfixExpression: LeftHandSideExpression ;
|
---|
862 |
|
---|
863 | PostfixExpression: LeftHandSideExpression T_PLUS_PLUS ;
|
---|
864 | /.
|
---|
865 | case $rule_number: {
|
---|
866 | sym(1).Node = QScript::makeAstNode<QScript::AST::PostIncrementExpression> (driver->nodePool(), sym(1).Expression);
|
---|
867 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
|
---|
868 | } break;
|
---|
869 | ./
|
---|
870 |
|
---|
871 | PostfixExpression: LeftHandSideExpression T_MINUS_MINUS ;
|
---|
872 | /.
|
---|
873 | case $rule_number: {
|
---|
874 | sym(1).Node = QScript::makeAstNode<QScript::AST::PostDecrementExpression> (driver->nodePool(), sym(1).Expression);
|
---|
875 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
|
---|
876 | } break;
|
---|
877 | ./
|
---|
878 |
|
---|
879 | UnaryExpression: PostfixExpression ;
|
---|
880 |
|
---|
881 | UnaryExpression: T_DELETE UnaryExpression ;
|
---|
882 | /.
|
---|
883 | case $rule_number: {
|
---|
884 | sym(1).Node = QScript::makeAstNode<QScript::AST::DeleteExpression> (driver->nodePool(), sym(2).Expression);
|
---|
885 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
|
---|
886 | } break;
|
---|
887 | ./
|
---|
888 |
|
---|
889 | UnaryExpression: T_VOID UnaryExpression ;
|
---|
890 | /.
|
---|
891 | case $rule_number: {
|
---|
892 | sym(1).Node = QScript::makeAstNode<QScript::AST::VoidExpression> (driver->nodePool(), sym(2).Expression);
|
---|
893 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
|
---|
894 | } break;
|
---|
895 | ./
|
---|
896 |
|
---|
897 | UnaryExpression: T_TYPEOF UnaryExpression ;
|
---|
898 | /.
|
---|
899 | case $rule_number: {
|
---|
900 | sym(1).Node = QScript::makeAstNode<QScript::AST::TypeOfExpression> (driver->nodePool(), sym(2).Expression);
|
---|
901 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
|
---|
902 | } break;
|
---|
903 | ./
|
---|
904 |
|
---|
905 | UnaryExpression: T_PLUS_PLUS UnaryExpression ;
|
---|
906 | /.
|
---|
907 | case $rule_number: {
|
---|
908 | sym(1).Node = QScript::makeAstNode<QScript::AST::PreIncrementExpression> (driver->nodePool(), sym(2).Expression);
|
---|
909 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
|
---|
910 | } break;
|
---|
911 | ./
|
---|
912 |
|
---|
913 | UnaryExpression: T_MINUS_MINUS UnaryExpression ;
|
---|
914 | /.
|
---|
915 | case $rule_number: {
|
---|
916 | sym(1).Node = QScript::makeAstNode<QScript::AST::PreDecrementExpression> (driver->nodePool(), sym(2).Expression);
|
---|
917 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
|
---|
918 | } break;
|
---|
919 | ./
|
---|
920 |
|
---|
921 | UnaryExpression: T_PLUS UnaryExpression ;
|
---|
922 | /.
|
---|
923 | case $rule_number: {
|
---|
924 | sym(1).Node = QScript::makeAstNode<QScript::AST::UnaryPlusExpression> (driver->nodePool(), sym(2).Expression);
|
---|
925 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
|
---|
926 | } break;
|
---|
927 | ./
|
---|
928 |
|
---|
929 | UnaryExpression: T_MINUS UnaryExpression ;
|
---|
930 | /.
|
---|
931 | case $rule_number: {
|
---|
932 | sym(1).Node = QScript::makeAstNode<QScript::AST::UnaryMinusExpression> (driver->nodePool(), sym(2).Expression);
|
---|
933 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
|
---|
934 | } break;
|
---|
935 | ./
|
---|
936 |
|
---|
937 | UnaryExpression: T_TILDE UnaryExpression ;
|
---|
938 | /.
|
---|
939 | case $rule_number: {
|
---|
940 | sym(1).Node = QScript::makeAstNode<QScript::AST::TildeExpression> (driver->nodePool(), sym(2).Expression);
|
---|
941 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
|
---|
942 | } break;
|
---|
943 | ./
|
---|
944 |
|
---|
945 | UnaryExpression: T_NOT UnaryExpression ;
|
---|
946 | /.
|
---|
947 | case $rule_number: {
|
---|
948 | sym(1).Node = QScript::makeAstNode<QScript::AST::NotExpression> (driver->nodePool(), sym(2).Expression);
|
---|
949 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(2));
|
---|
950 | } break;
|
---|
951 | ./
|
---|
952 |
|
---|
953 | MultiplicativeExpression: UnaryExpression ;
|
---|
954 |
|
---|
955 | MultiplicativeExpression: MultiplicativeExpression T_STAR UnaryExpression ;
|
---|
956 | /.
|
---|
957 | case $rule_number: {
|
---|
958 | sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Mul, sym(3).Expression);
|
---|
959 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
---|
960 | } break;
|
---|
961 | ./
|
---|
962 |
|
---|
963 | MultiplicativeExpression: MultiplicativeExpression T_DIVIDE_ UnaryExpression ;
|
---|
964 | /.
|
---|
965 | case $rule_number: {
|
---|
966 | sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Div, sym(3).Expression);
|
---|
967 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
---|
968 | } break;
|
---|
969 | ./
|
---|
970 |
|
---|
971 | MultiplicativeExpression: MultiplicativeExpression T_REMAINDER UnaryExpression ;
|
---|
972 | /.
|
---|
973 | case $rule_number: {
|
---|
974 | sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Mod, sym(3).Expression);
|
---|
975 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
---|
976 | } break;
|
---|
977 | ./
|
---|
978 |
|
---|
979 | AdditiveExpression: MultiplicativeExpression ;
|
---|
980 |
|
---|
981 | AdditiveExpression: AdditiveExpression T_PLUS MultiplicativeExpression ;
|
---|
982 | /.
|
---|
983 | case $rule_number: {
|
---|
984 | sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Add, sym(3).Expression);
|
---|
985 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
---|
986 | } break;
|
---|
987 | ./
|
---|
988 |
|
---|
989 | AdditiveExpression: AdditiveExpression T_MINUS MultiplicativeExpression ;
|
---|
990 | /.
|
---|
991 | case $rule_number: {
|
---|
992 | sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Sub, sym(3).Expression);
|
---|
993 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
---|
994 | } break;
|
---|
995 | ./
|
---|
996 |
|
---|
997 | ShiftExpression: AdditiveExpression ;
|
---|
998 |
|
---|
999 | ShiftExpression: ShiftExpression T_LT_LT AdditiveExpression ;
|
---|
1000 | /.
|
---|
1001 | case $rule_number: {
|
---|
1002 | sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::LShift, sym(3).Expression);
|
---|
1003 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
---|
1004 | } break;
|
---|
1005 | ./
|
---|
1006 |
|
---|
1007 | ShiftExpression: ShiftExpression T_GT_GT AdditiveExpression ;
|
---|
1008 | /.
|
---|
1009 | case $rule_number: {
|
---|
1010 | sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::RShift, sym(3).Expression);
|
---|
1011 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
---|
1012 | } break;
|
---|
1013 | ./
|
---|
1014 |
|
---|
1015 | ShiftExpression: ShiftExpression T_GT_GT_GT AdditiveExpression ;
|
---|
1016 | /.
|
---|
1017 | case $rule_number: {
|
---|
1018 | sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::URShift, sym(3).Expression);
|
---|
1019 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
---|
1020 | } break;
|
---|
1021 | ./
|
---|
1022 |
|
---|
1023 | RelationalExpression: ShiftExpression ;
|
---|
1024 |
|
---|
1025 | RelationalExpression: RelationalExpression T_LT ShiftExpression ;
|
---|
1026 | /.
|
---|
1027 | case $rule_number: {
|
---|
1028 | sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Lt, sym(3).Expression);
|
---|
1029 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
---|
1030 | } break;
|
---|
1031 | ./
|
---|
1032 |
|
---|
1033 | RelationalExpression: RelationalExpression T_GT ShiftExpression ;
|
---|
1034 | /.
|
---|
1035 | case $rule_number: {
|
---|
1036 | sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Gt, sym(3).Expression);
|
---|
1037 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
---|
1038 | } break;
|
---|
1039 | ./
|
---|
1040 |
|
---|
1041 | RelationalExpression: RelationalExpression T_LE ShiftExpression ;
|
---|
1042 | /.
|
---|
1043 | case $rule_number: {
|
---|
1044 | sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Le, sym(3).Expression);
|
---|
1045 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
---|
1046 | } break;
|
---|
1047 | ./
|
---|
1048 |
|
---|
1049 | RelationalExpression: RelationalExpression T_GE ShiftExpression ;
|
---|
1050 | /.
|
---|
1051 | case $rule_number: {
|
---|
1052 | sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Ge, sym(3).Expression);
|
---|
1053 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
---|
1054 | } break;
|
---|
1055 | ./
|
---|
1056 |
|
---|
1057 | RelationalExpression: RelationalExpression T_INSTANCEOF ShiftExpression ;
|
---|
1058 | /.
|
---|
1059 | case $rule_number: {
|
---|
1060 | sym(1).Node = QScript::makeAstNode<QScript::AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::InstanceOf, sym(3).Expression);
|
---|
1061 | Q_SCRIPT_UPDATE_POSITION(sym(1).Node, loc(1), loc(3));
|
---|
1062 | } break;
|
---|
1063 | ./
|
---|
1064 |
|
---|
1065 | RelationalExpression: RelationalExpression T_IN ShiftExpression ;
|
---|
1066 | /.
|
---|
1067 | case $rule_number: {
|
---|
|
---|