From f0c334670dfef7c1b1d1ae610cf19ae9ad2822ca Mon Sep 17 00:00:00 2001 From: Christian Date: Mon, 20 Oct 2014 13:02:06 +0200 Subject: Coding style cleanup: const and vecptr. --- AST.h | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) (limited to 'AST.h') diff --git a/AST.h b/AST.h index 8da3f529..661e10a7 100644 --- a/AST.h +++ b/AST.h @@ -51,7 +51,7 @@ public: virtual void accept(ASTVisitor& _visitor) = 0; template - static void listAccept(vecptr& _list, ASTVisitor& _visitor) + static void listAccept(std::vector>& _list, ASTVisitor& _visitor) { for (ptr& element: _list) element->accept(_visitor); @@ -78,9 +78,9 @@ class ContractDefinition: public Declaration public: ContractDefinition(Location const& _location, ptr const& _name, - vecptr const& _definedStructs, - vecptr const& _stateVariables, - vecptr const& _definedFunctions) + std::vector> const& _definedStructs, + std::vector> const& _stateVariables, + std::vector> const& _definedFunctions) : Declaration(_location, _name), m_definedStructs(_definedStructs), m_stateVariables(_stateVariables), @@ -89,13 +89,13 @@ public: virtual void accept(ASTVisitor& _visitor) override; - vecptr const& getDefinedStructs() { return m_definedStructs; } - vecptr const& getStateVariables() { return m_stateVariables; } - vecptr const& getDefinedFunctions() { return m_definedFunctions; } + std::vector> const& getDefinedStructs() { return m_definedStructs; } + std::vector> const& getStateVariables() { return m_stateVariables; } + std::vector> const& getDefinedFunctions() { return m_definedFunctions; } private: - vecptr m_definedStructs; - vecptr m_stateVariables; - vecptr m_definedFunctions; + std::vector> m_definedStructs; + std::vector> m_stateVariables; + std::vector> m_definedFunctions; }; class StructDefinition: public Declaration @@ -103,12 +103,12 @@ class StructDefinition: public Declaration public: StructDefinition(Location const& _location, ptr const& _name, - vecptr const& _members) + std::vector> const& _members) : Declaration(_location, _name), m_members(_members) {} virtual void accept(ASTVisitor& _visitor) override; private: - vecptr m_members; + std::vector> m_members; }; /// Used as function parameter list and return list @@ -117,13 +117,13 @@ private: class ParameterList: public ASTNode { public: - ParameterList(Location const& _location, vecptr const& _parameters) + ParameterList(Location const& _location, std::vector> const& _parameters) : ASTNode(_location), m_parameters(_parameters) {} virtual void accept(ASTVisitor& _visitor) override; - vecptr const& getParameters() { return m_parameters; } + std::vector> const& getParameters() { return m_parameters; } private: - vecptr m_parameters; + std::vector> m_parameters; }; class FunctionDefinition: public Declaration @@ -141,7 +141,7 @@ public: bool isPublic() const { return m_isPublic; } bool isDeclaredConst() const { return m_isDeclaredConst; } - vecptr const& getParameters() const { return m_parameters->getParameters(); } + std::vector> const& getParameters() const { return m_parameters->getParameters(); } ParameterList& getParameterList() { return *m_parameters; } ptr const& getReturnParameterList() const { return m_returnParameters; } Block& getBody() { return *m_body; } @@ -254,13 +254,13 @@ protected: class Block: public Statement { public: - Block(Location const& _location, vecptr const& _statements) + Block(Location const& _location, std::vector> const& _statements) : Statement(_location), m_statements(_statements) {} virtual void accept(ASTVisitor& _visitor) override; virtual ptr checkTypeRequirements() override; private: - vecptr m_statements; + std::vector> m_statements; }; class IfStatement: public Statement @@ -415,13 +415,13 @@ class FunctionCall: public Expression { public: FunctionCall(Location const& _location, ptr const& _expression, - vecptr const& _arguments) + std::vector> const& _arguments) : Expression(_location), m_expression(_expression), m_arguments(_arguments) {} virtual void accept(ASTVisitor& _visitor) override; virtual ptr checkTypeRequirements() override; private: ptr m_expression; - vecptr m_arguments; + std::vector> m_arguments; }; class MemberAccess: public Expression -- cgit