File indexing completed on 2024-04-14 14:47:46

0001 /*
0002     SPDX-FileCopyrightText: 2008 David Nolden <david.nolden.kdevelop@art-master.de>
0003     SPDX-FileCopyrightText: 2008 Niko Sams <niko.sams@gmail.com>
0004 
0005     SPDX-License-Identifier: LGPL-2.0-only
0006 */
0007 
0008 #ifndef EXPRESSIONEVALUATIONRESULT_H
0009 #define EXPRESSIONEVALUATIONRESULT_H
0010 
0011 #include "phpduchainexport.h"
0012 #include <language/duchain/appendedlist.h>
0013 #include <language/duchain/declarationid.h>
0014 #include <language/duchain/declaration.h>
0015 #include <language/duchain/types/referencetype.h>
0016 #include <language/duchain/types/indexedtype.h>
0017 
0018 #include <QList>
0019 
0020 namespace KDevelop
0021 {
0022 class IndexedType;
0023 class TypeIdentifier;
0024 class Declaration;
0025 }
0026 
0027 class QString;
0028 
0029 namespace Php
0030 {
0031 
0032 class KDEVPHPDUCHAIN_EXPORT ExpressionEvaluationResult
0033 {
0034 public:
0035     ExpressionEvaluationResult();
0036     ~ExpressionEvaluationResult();
0037 
0038     ///NOTE: Chain needs to be locked when calling this
0039     void setDeclaration(KDevelop::Declaration* declaration);
0040     void setDeclaration(KDevelop::DeclarationPointer declaration);
0041     ///NOTE: Chain needs to be locked when calling this
0042     void setDeclarations(QList<KDevelop::Declaration*> declarations);
0043     void setDeclarations(QList<KDevelop::DeclarationPointer> declarations);
0044     void setType(KDevelop::AbstractType::Ptr type);
0045     void setHadUnresolvedIdentifiers(bool v);
0046 
0047     KDevelop::AbstractType::Ptr type() const;
0048     QList<KDevelop::DeclarationId> allDeclarationIds() const;
0049     QList<KDevelop::DeclarationPointer> allDeclarations() const;
0050     bool hadUnresolvedIdentifiers() const;
0051 
0052 private:
0053     QList<KDevelop::DeclarationPointer> m_allDeclarations;
0054     QList<KDevelop::DeclarationId> m_allDeclarationIds;
0055     KDevelop::AbstractType::Ptr m_type; ///Type the expression evaluated to, may be zero when the expression failed to evaluate
0056     bool m_hadUnresolvedIdentifiers;
0057 
0058     //bool isInstance; ///Whether the result of this expression is an instance(as it normally should be)
0059     //KDevelop::DeclarationId instanceDeclaration; ///If this expression is an instance of some type, this either contains the declaration of the instance, or the type
0060 };
0061 
0062 }
0063 
0064 #endif