| 
									
										
										
										
											2012-10-02 09:12:39 +02:00
										 |  |  | /****************************************************************************
 | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | ** | 
					
						
							| 
									
										
										
										
											2013-01-28 17:12:19 +01:00
										 |  |  | ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). | 
					
						
							| 
									
										
										
										
											2012-10-02 09:12:39 +02:00
										 |  |  | ** Contact: http://www.qt-project.org/legal
 | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | ** | 
					
						
							| 
									
										
										
										
											2012-10-02 09:12:39 +02:00
										 |  |  | ** This file is part of Qt Creator. | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | ** | 
					
						
							| 
									
										
										
										
											2012-10-02 09:12:39 +02:00
										 |  |  | ** Commercial License Usage | 
					
						
							|  |  |  | ** Licensees holding valid commercial Qt licenses may use this file in | 
					
						
							|  |  |  | ** accordance with the commercial license agreement provided with the | 
					
						
							|  |  |  | ** Software or, alternatively, in accordance with the terms contained in | 
					
						
							|  |  |  | ** a written agreement between you and Digia.  For licensing terms and | 
					
						
							|  |  |  | ** conditions see http://qt.digia.com/licensing.  For further information
 | 
					
						
							|  |  |  | ** use the contact form at http://qt.digia.com/contact-us.
 | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | ** | 
					
						
							|  |  |  | ** GNU Lesser General Public License Usage | 
					
						
							| 
									
										
										
										
											2012-10-02 09:12:39 +02:00
										 |  |  | ** Alternatively, this file may be used under the terms of the GNU Lesser | 
					
						
							|  |  |  | ** General Public License version 2.1 as published by the Free Software | 
					
						
							|  |  |  | ** Foundation and appearing in the file LICENSE.LGPL included in the | 
					
						
							|  |  |  | ** packaging of this file.  Please review the following information to | 
					
						
							|  |  |  | ** ensure the GNU Lesser General Public License version 2.1 requirements | 
					
						
							|  |  |  | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
 | 
					
						
							|  |  |  | ** | 
					
						
							|  |  |  | ** In addition, as a special exception, Digia gives you certain additional | 
					
						
							|  |  |  | ** rights.  These rights are described in the Digia Qt LGPL Exception | 
					
						
							| 
									
										
										
										
											2010-12-17 16:01:08 +01:00
										 |  |  | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. | 
					
						
							|  |  |  | ** | 
					
						
							| 
									
										
										
										
											2012-10-02 09:12:39 +02:00
										 |  |  | ****************************************************************************/ | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-15 11:52:39 +01:00
										 |  |  | #include "qmljsevaluate.h"
 | 
					
						
							| 
									
										
										
										
											2011-07-01 13:51:53 +02:00
										 |  |  | #include "qmljscontext.h"
 | 
					
						
							| 
									
										
										
										
											2011-07-12 14:55:27 +02:00
										 |  |  | #include "qmljsscopechain.h"
 | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | #include "parser/qmljsast_p.h"
 | 
					
						
							| 
									
										
										
										
											2012-02-15 10:42:41 +01:00
										 |  |  | #include <QDebug>
 | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | using namespace QmlJS; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-11-24 11:40:37 +01:00
										 |  |  | /*!
 | 
					
						
							|  |  |  |     \class QmlJS::Evaluate | 
					
						
							| 
									
										
										
										
											2013-06-05 14:29:24 +02:00
										 |  |  |     \brief The Evaluate class evaluates \l{AST::Node}s to \l{Value}s. | 
					
						
							| 
									
										
										
										
											2011-11-24 11:40:37 +01:00
										 |  |  |     \sa Value ScopeChain | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     The Evaluate visitor is constructed with a ScopeChain and accepts JavaScript | 
					
						
							|  |  |  |     expressions as well as some other AST::Nodes. It evaluates the expression in | 
					
						
							|  |  |  |     the given ScopeChain and returns a Value representing the result. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     Example: Pass in the AST for "1 + 2" and NumberValue will be returned. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     In normal cases only the call operator (or the equivalent value() method) | 
					
						
							|  |  |  |     will be used. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     The reference() method has the special behavior of not resolving \l{Reference}s | 
					
						
							|  |  |  |     which can be useful when interested in the identity of a variable instead | 
					
						
							|  |  |  |     of its value. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     Example: In a scope where "var a = 1" | 
					
						
							|  |  |  |     \list | 
					
						
							| 
									
										
										
										
											2013-02-06 08:50:23 +01:00
										 |  |  |     \li value(Identifier-a) will return NumberValue | 
					
						
							|  |  |  |     \li reference(Identifier-a) will return the ASTVariableReference for the declaration of "a" | 
					
						
							| 
									
										
										
										
											2011-11-24 11:40:37 +01:00
										 |  |  |     \endlist | 
					
						
							|  |  |  | */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-09-12 11:48:33 +02:00
										 |  |  | Evaluate::Evaluate(const ScopeChain *scopeChain, ReferenceContext *referenceContext) | 
					
						
							| 
									
										
										
										
											2011-07-12 14:55:27 +02:00
										 |  |  |     : _valueOwner(scopeChain->context()->valueOwner()), | 
					
						
							|  |  |  |       _context(scopeChain->context()), | 
					
						
							| 
									
										
										
										
											2011-09-12 11:48:33 +02:00
										 |  |  |       _referenceContext(referenceContext), | 
					
						
							| 
									
										
										
										
											2011-07-12 14:55:27 +02:00
										 |  |  |       _scopeChain(scopeChain), | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  |       _result(0) | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | { | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-15 11:52:39 +01:00
										 |  |  | Evaluate::~Evaluate() | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | { | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-08-08 12:47:49 +02:00
										 |  |  | const Value *Evaluate::operator()(AST::Node *ast) | 
					
						
							| 
									
										
										
										
											2011-08-08 10:54:48 +02:00
										 |  |  | { | 
					
						
							|  |  |  |     return value(ast); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-08-08 12:47:49 +02:00
										 |  |  | const Value *Evaluate::value(AST::Node *ast) | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2010-02-08 12:50:10 +01:00
										 |  |  |     const Value *result = reference(ast); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-10-10 10:55:37 +02:00
										 |  |  |     if (const Reference *ref = value_cast<Reference>(result)) { | 
					
						
							| 
									
										
										
										
											2011-09-12 11:48:33 +02:00
										 |  |  |         if (_referenceContext) | 
					
						
							|  |  |  |             result = _referenceContext->lookupReference(ref); | 
					
						
							|  |  |  |         else | 
					
						
							|  |  |  |             result = _context->lookupReference(ref); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2010-02-08 12:50:10 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-10-10 12:53:28 +02:00
										 |  |  |     // if evaluation fails, return an unknown value
 | 
					
						
							| 
									
										
										
										
											2010-02-08 12:50:10 +01:00
										 |  |  |     if (! result) | 
					
						
							| 
									
										
										
										
											2011-10-10 12:53:28 +02:00
										 |  |  |         result = _valueOwner->unknownValue(); | 
					
						
							| 
									
										
										
										
											2010-02-08 12:50:10 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |     return result; | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-08-08 12:47:49 +02:00
										 |  |  | const Value *Evaluate::reference(AST::Node *ast) | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2010-02-03 10:24:25 +01:00
										 |  |  |     // save the result
 | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  |     const Value *previousResult = switchResult(0); | 
					
						
							| 
									
										
										
										
											2010-02-03 10:24:25 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |     // process the expression
 | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  |     accept(ast); | 
					
						
							| 
									
										
										
										
											2010-02-03 10:24:25 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |     // restore the previous result
 | 
					
						
							| 
									
										
										
										
											2010-02-08 12:50:10 +01:00
										 |  |  |     return switchResult(previousResult); | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-08-08 12:47:49 +02:00
										 |  |  | const Value *Evaluate::switchResult(const Value *result) | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2011-08-08 12:47:49 +02:00
										 |  |  |     const Value *previousResult = _result; | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  |     _result = result; | 
					
						
							|  |  |  |     return previousResult; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-15 11:52:39 +01:00
										 |  |  | void Evaluate::accept(AST::Node *node) | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     AST::Node::accept(node, this); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-15 11:52:39 +01:00
										 |  |  | bool Evaluate::visit(AST::UiProgram *) | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  |     return false; | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-15 11:52:39 +01:00
										 |  |  | bool Evaluate::visit(AST::UiImportList *) | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  |     return false; | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-15 11:52:39 +01:00
										 |  |  | bool Evaluate::visit(AST::UiImport *) | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  |     return false; | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-15 11:52:39 +01:00
										 |  |  | bool Evaluate::visit(AST::UiPublicMember *) | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  |     return false; | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-15 11:52:39 +01:00
										 |  |  | bool Evaluate::visit(AST::UiSourceElement *) | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  |     return false; | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-15 11:52:39 +01:00
										 |  |  | bool Evaluate::visit(AST::UiObjectDefinition *) | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  |     return false; | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-15 11:52:39 +01:00
										 |  |  | bool Evaluate::visit(AST::UiObjectInitializer *) | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  |     return false; | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-15 11:52:39 +01:00
										 |  |  | bool Evaluate::visit(AST::UiObjectBinding *) | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  |     return false; | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-15 11:52:39 +01:00
										 |  |  | bool Evaluate::visit(AST::UiScriptBinding *) | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  |     return false; | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-15 11:52:39 +01:00
										 |  |  | bool Evaluate::visit(AST::UiArrayBinding *) | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  |     return false; | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-15 11:52:39 +01:00
										 |  |  | bool Evaluate::visit(AST::UiObjectMemberList *) | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  |     return false; | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-15 11:52:39 +01:00
										 |  |  | bool Evaluate::visit(AST::UiArrayMemberList *) | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  |     return false; | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-15 11:52:39 +01:00
										 |  |  | bool Evaluate::visit(AST::UiQualifiedId *ast) | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2011-09-13 09:57:24 +02:00
										 |  |  |     if (ast->name.isEmpty()) | 
					
						
							| 
									
										
										
										
											2010-02-02 15:01:42 +01:00
										 |  |  |          return false; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-09-13 09:57:24 +02:00
										 |  |  |     const Value *value = _scopeChain->lookup(ast->name.toString()); | 
					
						
							| 
									
										
										
										
											2010-02-02 15:01:42 +01:00
										 |  |  |     if (! ast->next) { | 
					
						
							|  |  |  |         _result = value; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     } else { | 
					
						
							| 
									
										
										
										
											2011-10-10 10:55:37 +02:00
										 |  |  |         const ObjectValue *base = value_cast<ObjectValue>(value); | 
					
						
							| 
									
										
										
										
											2010-02-02 15:01:42 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |         for (AST::UiQualifiedId *it = ast->next; base && it; it = it->next) { | 
					
						
							| 
									
										
										
										
											2011-09-13 09:57:24 +02:00
										 |  |  |             const QString &name = it->name.toString(); | 
					
						
							|  |  |  |             if (name.isEmpty()) | 
					
						
							| 
									
										
										
										
											2010-02-02 15:01:42 +01:00
										 |  |  |                 break; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-09-13 09:57:24 +02:00
										 |  |  |             const Value *value = base->lookupMember(name, _context); | 
					
						
							| 
									
										
										
										
											2010-02-02 15:01:42 +01:00
										 |  |  |             if (! it->next) | 
					
						
							|  |  |  |                 _result = value; | 
					
						
							|  |  |  |             else | 
					
						
							| 
									
										
										
										
											2011-10-10 10:55:37 +02:00
										 |  |  |                 base = value_cast<ObjectValue>(value); | 
					
						
							| 
									
										
										
										
											2010-02-02 15:01:42 +01:00
										 |  |  |         } | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  |     return false; | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-15 11:52:39 +01:00
										 |  |  | bool Evaluate::visit(AST::ThisExpression *) | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  |     return false; | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-15 11:52:39 +01:00
										 |  |  | bool Evaluate::visit(AST::IdentifierExpression *ast) | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2011-09-13 09:57:24 +02:00
										 |  |  |     if (ast->name.isEmpty()) | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  |         return false; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-09-13 09:57:24 +02:00
										 |  |  |     _result = _scopeChain->lookup(ast->name.toString()); | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  |     return false; | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-15 11:52:39 +01:00
										 |  |  | bool Evaluate::visit(AST::NullExpression *) | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2011-07-01 12:11:02 +02:00
										 |  |  |     _result = _valueOwner->nullValue(); | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  |     return false; | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-15 11:52:39 +01:00
										 |  |  | bool Evaluate::visit(AST::TrueLiteral *) | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2011-07-01 12:11:02 +02:00
										 |  |  |     _result = _valueOwner->booleanValue(); | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  |     return false; | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-15 11:52:39 +01:00
										 |  |  | bool Evaluate::visit(AST::FalseLiteral *) | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2011-07-01 12:11:02 +02:00
										 |  |  |     _result = _valueOwner->booleanValue(); | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  |     return false; | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-15 11:52:39 +01:00
										 |  |  | bool Evaluate::visit(AST::StringLiteral *) | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2011-07-01 12:11:02 +02:00
										 |  |  |     _result = _valueOwner->stringValue(); | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  |     return false; | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-15 11:52:39 +01:00
										 |  |  | bool Evaluate::visit(AST::NumericLiteral *) | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2011-07-01 12:11:02 +02:00
										 |  |  |     _result = _valueOwner->numberValue(); | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  |     return false; | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-15 11:52:39 +01:00
										 |  |  | bool Evaluate::visit(AST::RegExpLiteral *) | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2011-11-21 14:51:03 +01:00
										 |  |  |     _result = _valueOwner->regexpCtor()->returnValue(); | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  |     return false; | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-15 11:52:39 +01:00
										 |  |  | bool Evaluate::visit(AST::ArrayLiteral *) | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2011-11-21 14:51:03 +01:00
										 |  |  |     _result = _valueOwner->arrayCtor()->returnValue(); | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  |     return false; | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-15 11:52:39 +01:00
										 |  |  | bool Evaluate::visit(AST::ObjectLiteral *) | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2011-09-12 10:44:11 +02:00
										 |  |  |     // ### properties
 | 
					
						
							|  |  |  |     _result = _valueOwner->newObject(); | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  |     return false; | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-15 11:52:39 +01:00
										 |  |  | bool Evaluate::visit(AST::ElementList *) | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  |     return false; | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-15 11:52:39 +01:00
										 |  |  | bool Evaluate::visit(AST::Elision *) | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  |     return false; | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-15 11:52:39 +01:00
										 |  |  | bool Evaluate::visit(AST::PropertyNameAndValueList *) | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  |     return false; | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-15 11:52:39 +01:00
										 |  |  | bool Evaluate::visit(AST::NestedExpression *) | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  |     return true; // visit the child expression
 | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-15 11:52:39 +01:00
										 |  |  | bool Evaluate::visit(AST::IdentifierPropertyName *) | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  |     return false; | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-15 11:52:39 +01:00
										 |  |  | bool Evaluate::visit(AST::StringLiteralPropertyName *) | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  |     return false; | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-15 11:52:39 +01:00
										 |  |  | bool Evaluate::visit(AST::NumericLiteralPropertyName *) | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  |     return false; | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-15 11:52:39 +01:00
										 |  |  | bool Evaluate::visit(AST::ArrayMemberExpression *) | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  |     return false; | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-15 11:52:39 +01:00
										 |  |  | bool Evaluate::visit(AST::FieldMemberExpression *ast) | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2011-09-13 09:57:24 +02:00
										 |  |  |     if (ast->name.isEmpty()) | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  |         return false; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-08-08 12:47:49 +02:00
										 |  |  |     if (const Value *base = _valueOwner->convertToObject(value(ast->base))) { | 
					
						
							| 
									
										
										
											
												Remove braces for single lines of conditions
#!/usr/bin/env ruby
Dir.glob('**/*.cpp') { |file|
  # skip ast (excluding paste, astpath, and canv'ast'imer)
  next if file =~ /ast[^eip]|keywords\.|qualifiers|preprocessor|names.cpp/i
  s = File.read(file)
  next if s.include?('qlalr')
  orig = s.dup
  s.gsub!(/\n *if [^\n]*{\n[^\n]*\n\s+}(\s+else if [^\n]* {\n[^\n]*\n\s+})*(\s+else {\n[^\n]*\n\s+})?\n/m) { |m|
    res = $&
    if res =~ /^\s*(\/\/|[A-Z_]{3,})/ # C++ comment or macro (Q_UNUSED, SDEBUG), do not touch braces
      res
    else
      res.gsub!('} else', 'else')
      res.gsub!(/\n +} *\n/m, "\n")
      res.gsub(/ *{$/, '')
    end
  }
  s.gsub!(/ *$/, '')
  File.open(file, 'wb').write(s) if s != orig
}
Change-Id: I3b30ee60df0986f66c02132c65fc38a3fbb6bbdc
Reviewed-by: hjk <qthjk@ovi.com>
											
										 
											2013-01-08 03:32:53 +02:00
										 |  |  |         if (const ObjectValue *obj = base->asObjectValue()) | 
					
						
							| 
									
										
										
										
											2011-09-13 09:57:24 +02:00
										 |  |  |             _result = obj->lookupMember(ast->name.toString(), _context); | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     return false; | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-15 11:52:39 +01:00
										 |  |  | bool Evaluate::visit(AST::NewMemberExpression *ast) | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
											
												Remove braces for single lines of conditions
#!/usr/bin/env ruby
Dir.glob('**/*.cpp') { |file|
  # skip ast (excluding paste, astpath, and canv'ast'imer)
  next if file =~ /ast[^eip]|keywords\.|qualifiers|preprocessor|names.cpp/i
  s = File.read(file)
  next if s.include?('qlalr')
  orig = s.dup
  s.gsub!(/\n *if [^\n]*{\n[^\n]*\n\s+}(\s+else if [^\n]* {\n[^\n]*\n\s+})*(\s+else {\n[^\n]*\n\s+})?\n/m) { |m|
    res = $&
    if res =~ /^\s*(\/\/|[A-Z_]{3,})/ # C++ comment or macro (Q_UNUSED, SDEBUG), do not touch braces
      res
    else
      res.gsub!('} else', 'else')
      res.gsub!(/\n +} *\n/m, "\n")
      res.gsub(/ *{$/, '')
    end
  }
  s.gsub!(/ *$/, '')
  File.open(file, 'wb').write(s) if s != orig
}
Change-Id: I3b30ee60df0986f66c02132c65fc38a3fbb6bbdc
Reviewed-by: hjk <qthjk@ovi.com>
											
										 
											2013-01-08 03:32:53 +02:00
										 |  |  |     if (const FunctionValue *ctor = value_cast<FunctionValue>(value(ast->base))) | 
					
						
							| 
									
										
										
										
											2011-11-21 14:51:03 +01:00
										 |  |  |         _result = ctor->returnValue(); | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  |     return false; | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-15 11:52:39 +01:00
										 |  |  | bool Evaluate::visit(AST::NewExpression *ast) | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
											
												Remove braces for single lines of conditions
#!/usr/bin/env ruby
Dir.glob('**/*.cpp') { |file|
  # skip ast (excluding paste, astpath, and canv'ast'imer)
  next if file =~ /ast[^eip]|keywords\.|qualifiers|preprocessor|names.cpp/i
  s = File.read(file)
  next if s.include?('qlalr')
  orig = s.dup
  s.gsub!(/\n *if [^\n]*{\n[^\n]*\n\s+}(\s+else if [^\n]* {\n[^\n]*\n\s+})*(\s+else {\n[^\n]*\n\s+})?\n/m) { |m|
    res = $&
    if res =~ /^\s*(\/\/|[A-Z_]{3,})/ # C++ comment or macro (Q_UNUSED, SDEBUG), do not touch braces
      res
    else
      res.gsub!('} else', 'else')
      res.gsub!(/\n +} *\n/m, "\n")
      res.gsub(/ *{$/, '')
    end
  }
  s.gsub!(/ *$/, '')
  File.open(file, 'wb').write(s) if s != orig
}
Change-Id: I3b30ee60df0986f66c02132c65fc38a3fbb6bbdc
Reviewed-by: hjk <qthjk@ovi.com>
											
										 
											2013-01-08 03:32:53 +02:00
										 |  |  |     if (const FunctionValue *ctor = value_cast<FunctionValue>(value(ast->expression))) | 
					
						
							| 
									
										
										
										
											2011-11-21 14:51:03 +01:00
										 |  |  |         _result = ctor->returnValue(); | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  |     return false; | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-15 11:52:39 +01:00
										 |  |  | bool Evaluate::visit(AST::CallExpression *ast) | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2011-08-08 12:47:49 +02:00
										 |  |  |     if (const Value *base = value(ast->base)) { | 
					
						
							| 
									
										
										
											
												Remove braces for single lines of conditions
#!/usr/bin/env ruby
Dir.glob('**/*.cpp') { |file|
  # skip ast (excluding paste, astpath, and canv'ast'imer)
  next if file =~ /ast[^eip]|keywords\.|qualifiers|preprocessor|names.cpp/i
  s = File.read(file)
  next if s.include?('qlalr')
  orig = s.dup
  s.gsub!(/\n *if [^\n]*{\n[^\n]*\n\s+}(\s+else if [^\n]* {\n[^\n]*\n\s+})*(\s+else {\n[^\n]*\n\s+})?\n/m) { |m|
    res = $&
    if res =~ /^\s*(\/\/|[A-Z_]{3,})/ # C++ comment or macro (Q_UNUSED, SDEBUG), do not touch braces
      res
    else
      res.gsub!('} else', 'else')
      res.gsub!(/\n +} *\n/m, "\n")
      res.gsub(/ *{$/, '')
    end
  }
  s.gsub!(/ *$/, '')
  File.open(file, 'wb').write(s) if s != orig
}
Change-Id: I3b30ee60df0986f66c02132c65fc38a3fbb6bbdc
Reviewed-by: hjk <qthjk@ovi.com>
											
										 
											2013-01-08 03:32:53 +02:00
										 |  |  |         if (const FunctionValue *obj = base->asFunctionValue()) | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  |             _result = obj->returnValue(); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     return false; | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-15 11:52:39 +01:00
										 |  |  | bool Evaluate::visit(AST::ArgumentList *) | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  |     return false; | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-15 11:52:39 +01:00
										 |  |  | bool Evaluate::visit(AST::PostIncrementExpression *) | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2011-11-23 13:34:27 +01:00
										 |  |  |     _result = _valueOwner->numberValue(); | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  |     return false; | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-15 11:52:39 +01:00
										 |  |  | bool Evaluate::visit(AST::PostDecrementExpression *) | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2011-11-23 13:34:27 +01:00
										 |  |  |     _result = _valueOwner->numberValue(); | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  |     return false; | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-15 11:52:39 +01:00
										 |  |  | bool Evaluate::visit(AST::DeleteExpression *) | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2011-11-23 13:34:27 +01:00
										 |  |  |     _result = _valueOwner->booleanValue(); | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  |     return false; | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-15 11:52:39 +01:00
										 |  |  | bool Evaluate::visit(AST::VoidExpression *) | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2011-11-23 13:34:27 +01:00
										 |  |  |     _result = _valueOwner->undefinedValue(); | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  |     return false; | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-15 11:52:39 +01:00
										 |  |  | bool Evaluate::visit(AST::TypeOfExpression *) | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2011-11-23 13:34:27 +01:00
										 |  |  |     _result = _valueOwner->stringValue(); | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  |     return false; | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-15 11:52:39 +01:00
										 |  |  | bool Evaluate::visit(AST::PreIncrementExpression *) | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2011-11-23 13:34:27 +01:00
										 |  |  |     _result = _valueOwner->numberValue(); | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  |     return false; | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-15 11:52:39 +01:00
										 |  |  | bool Evaluate::visit(AST::PreDecrementExpression *) | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2011-11-23 13:34:27 +01:00
										 |  |  |     _result = _valueOwner->numberValue(); | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  |     return false; | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-15 11:52:39 +01:00
										 |  |  | bool Evaluate::visit(AST::UnaryPlusExpression *) | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2011-11-23 13:34:27 +01:00
										 |  |  |     _result = _valueOwner->numberValue(); | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  |     return false; | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-15 11:52:39 +01:00
										 |  |  | bool Evaluate::visit(AST::UnaryMinusExpression *) | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2011-11-23 13:34:27 +01:00
										 |  |  |     _result = _valueOwner->numberValue(); | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  |     return false; | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-15 11:52:39 +01:00
										 |  |  | bool Evaluate::visit(AST::TildeExpression *) | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2011-11-23 13:34:27 +01:00
										 |  |  |     _result = _valueOwner->numberValue(); | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  |     return false; | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-15 11:52:39 +01:00
										 |  |  | bool Evaluate::visit(AST::NotExpression *) | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2011-11-23 13:34:27 +01:00
										 |  |  |     _result = _valueOwner->booleanValue(); | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  |     return false; | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-11-23 13:34:27 +01:00
										 |  |  | bool Evaluate::visit(AST::BinaryExpression *ast) | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2011-11-23 13:34:27 +01:00
										 |  |  |     const Value *lhs = 0; | 
					
						
							|  |  |  |     const Value *rhs = 0; | 
					
						
							|  |  |  |     switch (ast->op) { | 
					
						
							|  |  |  |     case QSOperator::Add: | 
					
						
							|  |  |  |     case QSOperator::InplaceAdd: | 
					
						
							|  |  |  |     //case QSOperator::And: // ### enable once implemented below
 | 
					
						
							|  |  |  |     //case QSOperator::Or:
 | 
					
						
							|  |  |  |         lhs = value(ast->left); | 
					
						
							|  |  |  |         // fallthrough
 | 
					
						
							|  |  |  |     case QSOperator::Assign: | 
					
						
							|  |  |  |         rhs = value(ast->right); | 
					
						
							|  |  |  |         break; | 
					
						
							|  |  |  |     default: | 
					
						
							|  |  |  |         break; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     switch (ast->op) { | 
					
						
							|  |  |  |     case QSOperator::Add: | 
					
						
							|  |  |  |     case QSOperator::InplaceAdd: | 
					
						
							|  |  |  |         if (lhs->asStringValue() || rhs->asStringValue()) | 
					
						
							|  |  |  |             _result = _valueOwner->stringValue(); | 
					
						
							|  |  |  |         else | 
					
						
							|  |  |  |             _result = _valueOwner->numberValue(); | 
					
						
							|  |  |  |         break; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     case QSOperator::Sub: | 
					
						
							|  |  |  |     case QSOperator::InplaceSub: | 
					
						
							|  |  |  |     case QSOperator::Mul: | 
					
						
							|  |  |  |     case QSOperator::InplaceMul: | 
					
						
							|  |  |  |     case QSOperator::Div: | 
					
						
							|  |  |  |     case QSOperator::InplaceDiv: | 
					
						
							|  |  |  |     case QSOperator::Mod: | 
					
						
							|  |  |  |     case QSOperator::InplaceMod: | 
					
						
							|  |  |  |     case QSOperator::BitAnd: | 
					
						
							|  |  |  |     case QSOperator::InplaceAnd: | 
					
						
							|  |  |  |     case QSOperator::BitXor: | 
					
						
							|  |  |  |     case QSOperator::InplaceXor: | 
					
						
							|  |  |  |     case QSOperator::BitOr: | 
					
						
							|  |  |  |     case QSOperator::InplaceOr: | 
					
						
							|  |  |  |     case QSOperator::LShift: | 
					
						
							|  |  |  |     case QSOperator::InplaceLeftShift: | 
					
						
							|  |  |  |     case QSOperator::RShift: | 
					
						
							|  |  |  |     case QSOperator::InplaceRightShift: | 
					
						
							|  |  |  |     case QSOperator::URShift: | 
					
						
							|  |  |  |     case QSOperator::InplaceURightShift: | 
					
						
							|  |  |  |         _result = _valueOwner->numberValue(); | 
					
						
							|  |  |  |         break; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     case QSOperator::Le: | 
					
						
							|  |  |  |     case QSOperator::Ge: | 
					
						
							|  |  |  |     case QSOperator::Lt: | 
					
						
							|  |  |  |     case QSOperator::Gt: | 
					
						
							|  |  |  |     case QSOperator::Equal: | 
					
						
							|  |  |  |     case QSOperator::NotEqual: | 
					
						
							|  |  |  |     case QSOperator::StrictEqual: | 
					
						
							|  |  |  |     case QSOperator::StrictNotEqual: | 
					
						
							|  |  |  |     case QSOperator::InstanceOf: | 
					
						
							|  |  |  |     case QSOperator::In: | 
					
						
							|  |  |  |         _result = _valueOwner->booleanValue(); | 
					
						
							|  |  |  |         break; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     case QSOperator::And: | 
					
						
							|  |  |  |     case QSOperator::Or: | 
					
						
							|  |  |  |         // ### either lhs or rhs
 | 
					
						
							|  |  |  |         _result = _valueOwner->unknownValue(); | 
					
						
							|  |  |  |         break; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     case QSOperator::Assign: | 
					
						
							|  |  |  |         _result = rhs; | 
					
						
							|  |  |  |         break; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     default: | 
					
						
							|  |  |  |         break; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  |     return false; | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-15 11:52:39 +01:00
										 |  |  | bool Evaluate::visit(AST::ConditionalExpression *) | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  |     return false; | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-15 11:52:39 +01:00
										 |  |  | bool Evaluate::visit(AST::Expression *) | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  |     return false; | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-15 11:52:39 +01:00
										 |  |  | bool Evaluate::visit(AST::Block *) | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  |     return false; | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-15 11:52:39 +01:00
										 |  |  | bool Evaluate::visit(AST::StatementList *) | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  |     return false; | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-15 11:52:39 +01:00
										 |  |  | bool Evaluate::visit(AST::VariableStatement *) | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  |     return false; | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-15 11:52:39 +01:00
										 |  |  | bool Evaluate::visit(AST::VariableDeclarationList *) | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  |     return false; | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-15 11:52:39 +01:00
										 |  |  | bool Evaluate::visit(AST::VariableDeclaration *) | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  |     return false; | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-15 11:52:39 +01:00
										 |  |  | bool Evaluate::visit(AST::EmptyStatement *) | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  |     return false; | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-15 11:52:39 +01:00
										 |  |  | bool Evaluate::visit(AST::ExpressionStatement *) | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2010-11-23 14:15:50 +01:00
										 |  |  |     return true; | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-15 11:52:39 +01:00
										 |  |  | bool Evaluate::visit(AST::IfStatement *) | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  |     return false; | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-15 11:52:39 +01:00
										 |  |  | bool Evaluate::visit(AST::DoWhileStatement *) | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  |     return false; | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-15 11:52:39 +01:00
										 |  |  | bool Evaluate::visit(AST::WhileStatement *) | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  |     return false; | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-15 11:52:39 +01:00
										 |  |  | bool Evaluate::visit(AST::ForStatement *) | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  |     return false; | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-15 11:52:39 +01:00
										 |  |  | bool Evaluate::visit(AST::LocalForStatement *) | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  |     return false; | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-15 11:52:39 +01:00
										 |  |  | bool Evaluate::visit(AST::ForEachStatement *) | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  |     return false; | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-15 11:52:39 +01:00
										 |  |  | bool Evaluate::visit(AST::LocalForEachStatement *) | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  |     return false; | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-15 11:52:39 +01:00
										 |  |  | bool Evaluate::visit(AST::ContinueStatement *) | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  |     return false; | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-15 11:52:39 +01:00
										 |  |  | bool Evaluate::visit(AST::BreakStatement *) | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  |     return false; | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-15 11:52:39 +01:00
										 |  |  | bool Evaluate::visit(AST::ReturnStatement *) | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2011-11-23 13:34:27 +01:00
										 |  |  |     return true; | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-15 11:52:39 +01:00
										 |  |  | bool Evaluate::visit(AST::WithStatement *) | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  |     return false; | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-15 11:52:39 +01:00
										 |  |  | bool Evaluate::visit(AST::SwitchStatement *) | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  |     return false; | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-15 11:52:39 +01:00
										 |  |  | bool Evaluate::visit(AST::CaseBlock *) | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  |     return false; | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-15 11:52:39 +01:00
										 |  |  | bool Evaluate::visit(AST::CaseClauses *) | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  |     return false; | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-15 11:52:39 +01:00
										 |  |  | bool Evaluate::visit(AST::CaseClause *) | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  |     return false; | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-15 11:52:39 +01:00
										 |  |  | bool Evaluate::visit(AST::DefaultClause *) | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  |     return false; | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-15 11:52:39 +01:00
										 |  |  | bool Evaluate::visit(AST::LabelledStatement *) | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  |     return false; | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-15 11:52:39 +01:00
										 |  |  | bool Evaluate::visit(AST::ThrowStatement *) | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  |     return false; | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-15 11:52:39 +01:00
										 |  |  | bool Evaluate::visit(AST::TryStatement *) | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  |     return false; | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-15 11:52:39 +01:00
										 |  |  | bool Evaluate::visit(AST::Catch *) | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  |     return false; | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-15 11:52:39 +01:00
										 |  |  | bool Evaluate::visit(AST::Finally *) | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  |     return false; | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-15 11:52:39 +01:00
										 |  |  | bool Evaluate::visit(AST::FunctionDeclaration *) | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  |     return false; | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-15 11:52:39 +01:00
										 |  |  | bool Evaluate::visit(AST::FunctionExpression *) | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  |     return false; | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-15 11:52:39 +01:00
										 |  |  | bool Evaluate::visit(AST::FormalParameterList *) | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  |     return false; | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-15 11:52:39 +01:00
										 |  |  | bool Evaluate::visit(AST::FunctionBody *) | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  |     return false; | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-15 11:52:39 +01:00
										 |  |  | bool Evaluate::visit(AST::Program *) | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  |     return false; | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-15 11:52:39 +01:00
										 |  |  | bool Evaluate::visit(AST::SourceElements *) | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  |     return false; | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-15 11:52:39 +01:00
										 |  |  | bool Evaluate::visit(AST::FunctionSourceElement *) | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  |     return false; | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-15 11:52:39 +01:00
										 |  |  | bool Evaluate::visit(AST::StatementSourceElement *) | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  |     return false; | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-15 11:52:39 +01:00
										 |  |  | bool Evaluate::visit(AST::DebuggerStatement *) | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2010-01-26 14:53:11 +01:00
										 |  |  |     return false; | 
					
						
							| 
									
										
										
										
											2010-01-18 16:15:23 +01:00
										 |  |  | } |