Changeset View
Changeset View
Standalone View
Standalone View
duchain/builders/declarationbuilder.h
Show First 20 Lines • Show All 49 Lines • ▼ Show 20 Line(s) | |||||
50 | class KDEVPHPDUCHAIN_EXPORT DeclarationBuilder : public DeclarationBuilderBase | 50 | class KDEVPHPDUCHAIN_EXPORT DeclarationBuilder : public DeclarationBuilderBase | ||
51 | { | 51 | { | ||
52 | public: | 52 | public: | ||
53 | DeclarationBuilder(EditorIntegrator* editor) | 53 | DeclarationBuilder(EditorIntegrator* editor) | ||
54 | : m_currentModifers(0) | 54 | : m_currentModifers(0) | ||
55 | { | 55 | { | ||
56 | m_editor = editor; | 56 | m_editor = editor; | ||
57 | m_findVariable.find = false; | 57 | m_findVariable.find = false; | ||
58 | m_useNamespaceType = ClassDeclarationType; | ||||
58 | } | 59 | } | ||
59 | KDevelop::ReferencedTopDUContext build(const KDevelop::IndexedString& url, AstNode* node, | 60 | KDevelop::ReferencedTopDUContext build(const KDevelop::IndexedString& url, AstNode* node, | ||
60 | const KDevelop::ReferencedTopDUContext& updateContext | 61 | const KDevelop::ReferencedTopDUContext& updateContext | ||
61 | = KDevelop::ReferencedTopDUContext()) override; | 62 | = KDevelop::ReferencedTopDUContext()) override; | ||
62 | 63 | | |||
63 | void startVisiting(AstNode* node) override; | 64 | void startVisiting(AstNode* node) override; | ||
64 | 65 | | |||
65 | protected: | 66 | protected: | ||
Show All 23 Lines | |||||
89 | void visitStatement(StatementAst* node) override; | 90 | void visitStatement(StatementAst* node) override; | ||
90 | void visitStaticVar(StaticVarAst* node) override; | 91 | void visitStaticVar(StaticVarAst* node) override; | ||
91 | void visitGlobalVar(GlobalVarAst* node) override; | 92 | void visitGlobalVar(GlobalVarAst* node) override; | ||
92 | void visitCatchItem(CatchItemAst *node) override; | 93 | void visitCatchItem(CatchItemAst *node) override; | ||
93 | void visitUnaryExpression( UnaryExpressionAst* node ) override; | 94 | void visitUnaryExpression( UnaryExpressionAst* node ) override; | ||
94 | void visitAssignmentListElement(AssignmentListElementAst* node) override; | 95 | void visitAssignmentListElement(AssignmentListElementAst* node) override; | ||
95 | void openNamespace(NamespaceDeclarationStatementAst* parent, IdentifierAst* node, const IdentifierPair& identifier, const KDevelop::RangeInRevision& range) override; | 96 | void openNamespace(NamespaceDeclarationStatementAst* parent, IdentifierAst* node, const IdentifierPair& identifier, const KDevelop::RangeInRevision& range) override; | ||
96 | void closeNamespace(NamespaceDeclarationStatementAst* parent, IdentifierAst* node, const IdentifierPair& identifier) override; | 97 | void closeNamespace(NamespaceDeclarationStatementAst* parent, IdentifierAst* node, const IdentifierPair& identifier) override; | ||
98 | void visitUseStatement(UseStatementAst* node) override; | ||||
97 | void visitUseNamespace(UseNamespaceAst* node) override; | 99 | void visitUseNamespace(UseNamespaceAst* node) override; | ||
98 | void visitClosure(ClosureAst* node) override; | 100 | void visitClosure(ClosureAst* node) override; | ||
99 | void visitLexicalVar(LexicalVarAst* node) override; | 101 | void visitLexicalVar(LexicalVarAst* node) override; | ||
100 | void visitVarExpression(VarExpressionAst* node) override; | 102 | void visitVarExpression(VarExpressionAst* node) override; | ||
101 | 103 | | |||
102 | /// checks whether the body is empty (i.e. equals ";" instead of "{...}") | 104 | /// checks whether the body is empty (i.e. equals ";" instead of "{...}") | ||
103 | bool isEmptyMethodBody(const MethodBodyAst* body) const { | 105 | bool isEmptyMethodBody(const MethodBodyAst* body) const { | ||
104 | return !body || !body->statements; | 106 | return !body || !body->statements; | ||
Show All 40 Lines | 121 | private: | |||
145 | /// The position of the current argument, will only be set inside function calls. | 147 | /// The position of the current argument, will only be set inside function calls. | ||
146 | int m_functionCallParameterPos; | 148 | int m_functionCallParameterPos; | ||
147 | /// Type of the current function, will only be set inside function calls. | 149 | /// Type of the current function, will only be set inside function calls. | ||
148 | KDevelop::FunctionType::Ptr m_currentFunctionType; | 150 | KDevelop::FunctionType::Ptr m_currentFunctionType; | ||
149 | /// The AstNode of the previous function declaration argument | 151 | /// The AstNode of the previous function declaration argument | ||
150 | ParameterAst *m_functionDeclarationPreviousArgument = nullptr; | 152 | ParameterAst *m_functionDeclarationPreviousArgument = nullptr; | ||
151 | /// The AstNode of the previous function call argument | 153 | /// The AstNode of the previous function call argument | ||
152 | FunctionCallParameterListElementAst *m_functionCallPreviousArgument = nullptr; | 154 | FunctionCallParameterListElementAst *m_functionCallPreviousArgument = nullptr; | ||
155 | /// Type of use | ||||
156 | DeclarationType m_useNamespaceType; | ||||
153 | 157 | | |||
154 | unsigned int m_currentModifers; | 158 | unsigned int m_currentModifers; | ||
155 | QString m_lastTopStatementComment; | 159 | QString m_lastTopStatementComment; | ||
156 | 160 | | |||
157 | QHash<qint64, ClassDeclaration*> m_types; | 161 | QHash<qint64, ClassDeclaration*> m_types; | ||
158 | QHash<qint64, FunctionDeclaration*> m_functions; | 162 | QHash<qint64, FunctionDeclaration*> m_functions; | ||
159 | QHash<qint64, NamespaceDeclaration*> m_namespaces; | 163 | QHash<qint64, NamespaceDeclaration*> m_namespaces; | ||
160 | QVector<KDevelop::QualifiedIdentifier> m_upcomingClassVariables; | 164 | QVector<KDevelop::QualifiedIdentifier> m_upcomingClassVariables; | ||
▲ Show 20 Lines • Show All 89 Lines • Show Last 20 Lines |