diff options
author | Christian <c@ethdev.com> | 2015-01-20 04:05:47 +0800 |
---|---|---|
committer | Christian <c@ethdev.com> | 2015-01-20 06:35:04 +0800 |
commit | af92f98d86ba1e15e3f41ac49bb9639be1ab4e41 (patch) | |
tree | e42cff46c9701491a43e58bebd8ead5b3e5241ec /AST.h | |
parent | 6e111d5d1da2a0ae397fa2bd846d13132cdd6dd9 (diff) | |
download | dexon-solidity-af92f98d86ba1e15e3f41ac49bb9639be1ab4e41.tar.gz dexon-solidity-af92f98d86ba1e15e3f41ac49bb9639be1ab4e41.tar.zst dexon-solidity-af92f98d86ba1e15e3f41ac49bb9639be1ab4e41.zip |
Constructor arguments for base classes.
Diffstat (limited to 'AST.h')
-rwxr-xr-x | AST.h | 26 |
1 files changed, 23 insertions, 3 deletions
@@ -158,7 +158,7 @@ public: ContractDefinition(Location const& _location, ASTPointer<ASTString> const& _name, ASTPointer<ASTString> const& _documentation, - std::vector<ASTPointer<Identifier>> const& _baseContracts, + std::vector<ASTPointer<InheritanceSpecifier>> const& _baseContracts, std::vector<ASTPointer<StructDefinition>> const& _definedStructs, std::vector<ASTPointer<VariableDeclaration>> const& _stateVariables, std::vector<ASTPointer<FunctionDefinition>> const& _definedFunctions): @@ -173,7 +173,7 @@ public: virtual void accept(ASTVisitor& _visitor) override; virtual void accept(ASTConstVisitor& _visitor) const override; - std::vector<ASTPointer<Identifier>> const& getBaseContracts() const { return m_baseContracts; } + std::vector<ASTPointer<InheritanceSpecifier>> const& getBaseContracts() const { return m_baseContracts; } std::vector<ASTPointer<StructDefinition>> const& getDefinedStructs() const { return m_definedStructs; } std::vector<ASTPointer<VariableDeclaration>> const& getStateVariables() const { return m_stateVariables; } std::vector<ASTPointer<FunctionDefinition>> const& getDefinedFunctions() const { return m_definedFunctions; } @@ -203,7 +203,7 @@ private: std::vector<std::pair<FixedHash<4>, FunctionDefinition const*>> const& getInterfaceFunctionList() const; - std::vector<ASTPointer<Identifier>> m_baseContracts; + std::vector<ASTPointer<InheritanceSpecifier>> m_baseContracts; std::vector<ASTPointer<StructDefinition>> m_definedStructs; std::vector<ASTPointer<VariableDeclaration>> m_stateVariables; std::vector<ASTPointer<FunctionDefinition>> m_definedFunctions; @@ -213,6 +213,26 @@ private: mutable std::unique_ptr<std::vector<std::pair<FixedHash<4>, FunctionDefinition const*>>> m_interfaceFunctionList; }; +class InheritanceSpecifier: public ASTNode +{ +public: + InheritanceSpecifier(Location const& _location, ASTPointer<Identifier> const& _baseName, + std::vector<ASTPointer<Expression>> _arguments): + ASTNode(_location), m_baseName(_baseName), m_arguments(_arguments) {} + + virtual void accept(ASTVisitor& _visitor) override; + virtual void accept(ASTConstVisitor& _visitor) const override; + + ASTPointer<Identifier> const& getName() const { return m_baseName; } + std::vector<ASTPointer<Expression>> const& getArguments() const { return m_arguments; } + + void checkTypeRequirements(); + +private: + ASTPointer<Identifier> m_baseName; + std::vector<ASTPointer<Expression>> m_arguments; +}; + class StructDefinition: public Declaration { public: |