Changeset View
Changeset View
Standalone View
Standalone View
duchain/builders/contextbuilder.h
Show All 39 Lines | |||||
40 | /// second comes the all-lowercase identifier used for storage | 40 | /// second comes the all-lowercase identifier used for storage | ||
41 | typedef QPair<KDevelop::IndexedString, KDevelop::QualifiedIdentifier> IdentifierPair; | 41 | typedef QPair<KDevelop::IndexedString, KDevelop::QualifiedIdentifier> IdentifierPair; | ||
42 | 42 | | |||
43 | class KDEVPHPDUCHAIN_EXPORT ContextBuilder: public ContextBuilderBase, public DefaultVisitor | 43 | class KDEVPHPDUCHAIN_EXPORT ContextBuilder: public ContextBuilderBase, public DefaultVisitor | ||
44 | { | 44 | { | ||
45 | 45 | | |||
46 | public: | 46 | public: | ||
47 | ContextBuilder(); | 47 | ContextBuilder(); | ||
48 | virtual ~ContextBuilder(); | 48 | ~ContextBuilder() override; | ||
49 | 49 | | |||
50 | virtual KDevelop::ReferencedTopDUContext build(const KDevelop::IndexedString& url, AstNode* node, | 50 | KDevelop::ReferencedTopDUContext build(const KDevelop::IndexedString& url, AstNode* node, | ||
51 | KDevelop::ReferencedTopDUContext updateContext | 51 | KDevelop::ReferencedTopDUContext updateContext | ||
52 | = KDevelop::ReferencedTopDUContext()); | 52 | = KDevelop::ReferencedTopDUContext()) override; | ||
53 | 53 | | |||
54 | bool hadUnresolvedIdentifiers() const; | 54 | bool hadUnresolvedIdentifiers() const; | ||
55 | 55 | | |||
56 | EditorIntegrator* editor() const; | 56 | EditorIntegrator* editor() const; | ||
57 | 57 | | |||
58 | protected: | 58 | protected: | ||
59 | virtual KDevelop::DUContext* newContext(const KDevelop::RangeInRevision& range); | 59 | KDevelop::DUContext* newContext(const KDevelop::RangeInRevision& range) override; | ||
60 | virtual KDevelop::TopDUContext* newTopContext(const KDevelop::RangeInRevision& range, KDevelop::ParsingEnvironmentFile* file = 0); | 60 | KDevelop::TopDUContext* newTopContext(const KDevelop::RangeInRevision& range, KDevelop::ParsingEnvironmentFile* file = nullptr) override; | ||
61 | 61 | | |||
62 | virtual void startVisiting(AstNode* node); | 62 | void startVisiting(AstNode* node) override; | ||
63 | virtual void setContextOnNode(AstNode* node, KDevelop::DUContext* ctx); | 63 | void setContextOnNode(AstNode* node, KDevelop::DUContext* ctx) override; | ||
64 | virtual KDevelop::DUContext* contextFromNode(AstNode* node); | 64 | KDevelop::DUContext* contextFromNode(AstNode* node) override; | ||
65 | virtual KDevelop::RangeInRevision editorFindRange(AstNode* fromRange, AstNode* toRange = 0); | 65 | KDevelop::RangeInRevision editorFindRange(AstNode* fromRange, AstNode* toRange = nullptr) override; | ||
66 | /// Find Cursor for start of a node, useful to limit findLocalDeclarations() searches. | 66 | /// Find Cursor for start of a node, useful to limit findLocalDeclarations() searches. | ||
67 | KDevelop::CursorInRevision startPos( AstNode* node); | 67 | KDevelop::CursorInRevision startPos( AstNode* node); | ||
68 | 68 | | |||
69 | virtual KDevelop::QualifiedIdentifier identifierForNode(IdentifierAst* id); | 69 | KDevelop::QualifiedIdentifier identifierForNode(IdentifierAst* id) override; | ||
70 | KDevelop::QualifiedIdentifier identifierForNode(VariableIdentifierAst* id); | 70 | KDevelop::QualifiedIdentifier identifierForNode(VariableIdentifierAst* id); | ||
71 | IdentifierPair identifierPairForNode(IdentifierAst* id); | 71 | IdentifierPair identifierPairForNode(IdentifierAst* id); | ||
72 | QString stringForNode(IdentifierAst* node) const; | 72 | QString stringForNode(IdentifierAst* node) const; | ||
73 | QString stringForNode(VariableIdentifierAst* node) const; | 73 | QString stringForNode(VariableIdentifierAst* node) const; | ||
74 | 74 | | |||
75 | virtual void visitClassDeclarationStatement(ClassDeclarationStatementAst*); | 75 | void visitClassDeclarationStatement(ClassDeclarationStatementAst*) override; | ||
76 | virtual void visitInterfaceDeclarationStatement(InterfaceDeclarationStatementAst* node); | 76 | void visitInterfaceDeclarationStatement(InterfaceDeclarationStatementAst* node) override; | ||
77 | virtual void visitTraitDeclarationStatement(TraitDeclarationStatementAst* node); | 77 | void visitTraitDeclarationStatement(TraitDeclarationStatementAst* node) override; | ||
78 | virtual void visitClassStatement(ClassStatementAst *node); | 78 | void visitClassStatement(ClassStatementAst *node) override; | ||
79 | virtual void visitFunctionDeclarationStatement(FunctionDeclarationStatementAst* node); | 79 | void visitFunctionDeclarationStatement(FunctionDeclarationStatementAst* node) override; | ||
80 | virtual void visitClosure(ClosureAst* node); | 80 | void visitClosure(ClosureAst* node) override; | ||
81 | virtual void visitUnaryExpression(UnaryExpressionAst* node); | 81 | void visitUnaryExpression(UnaryExpressionAst* node) override; | ||
82 | /** | 82 | /** | ||
83 | * don't overload in other builders, use @c openNamespace and @c closeNamespace instead. | 83 | * don't overload in other builders, use @c openNamespace and @c closeNamespace instead. | ||
84 | */ | 84 | */ | ||
85 | virtual void visitNamespaceDeclarationStatement(NamespaceDeclarationStatementAst* node); | 85 | void visitNamespaceDeclarationStatement(NamespaceDeclarationStatementAst* node) override; | ||
86 | virtual void openNamespace(NamespaceDeclarationStatementAst* parent, IdentifierAst* node, const IdentifierPair& identifier, const KDevelop::RangeInRevision& range); | 86 | virtual void openNamespace(NamespaceDeclarationStatementAst* parent, IdentifierAst* node, const IdentifierPair& identifier, const KDevelop::RangeInRevision& range); | ||
87 | virtual void closeNamespace(NamespaceDeclarationStatementAst* parent, IdentifierAst* node, const IdentifierPair& identifier); | 87 | virtual void closeNamespace(NamespaceDeclarationStatementAst* parent, IdentifierAst* node, const IdentifierPair& identifier); | ||
88 | 88 | | |||
89 | virtual void addBaseType(NamespacedIdentifierAst * identifier); | 89 | virtual void addBaseType(NamespacedIdentifierAst * identifier); | ||
90 | 90 | | |||
91 | virtual void classContextOpened(KDevelop::DUContext* context); | 91 | virtual void classContextOpened(KDevelop::DUContext* context); | ||
92 | 92 | | |||
93 | /// Report @p errorMsg with the range of @p node | 93 | /// Report @p errorMsg with the range of @p node | ||
Show All 35 Lines |