diff options
author | chriseth <c@ethdev.com> | 2016-09-28 03:37:32 +0800 |
---|---|---|
committer | chriseth <c@ethdev.com> | 2016-11-16 21:37:17 +0800 |
commit | cc8583ec7d6fd86ca7e129475fde32b76d102e79 (patch) | |
tree | a2df35174d6d95734207add361db5d894fe8592f /libsolidity/ast/AST.h | |
parent | c811691861eb51520d9fd51d56770f14990b0320 (diff) | |
download | dexon-solidity-cc8583ec7d6fd86ca7e129475fde32b76d102e79.tar.gz dexon-solidity-cc8583ec7d6fd86ca7e129475fde32b76d102e79.tar.zst dexon-solidity-cc8583ec7d6fd86ca7e129475fde32b76d102e79.zip |
Function types.
Diffstat (limited to 'libsolidity/ast/AST.h')
-rw-r--r-- | libsolidity/ast/AST.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/libsolidity/ast/AST.h b/libsolidity/ast/AST.h index 1b42c499..a2b70fe9 100644 --- a/libsolidity/ast/AST.h +++ b/libsolidity/ast/AST.h @@ -823,6 +823,41 @@ private: }; /** + * A literal function type. Its source form is "function (paramType1, paramType2) internal / external returns (retType1, retType2)" + */ +class FunctionTypeName: public TypeName +{ +public: + FunctionTypeName( + SourceLocation const& _location, + ASTPointer<ParameterList> const& _parameterTypes, + ASTPointer<ParameterList> const& _returnTypes, + Declaration::Visibility _visibility, + bool _isDeclaredConst, + bool _isPayable + ): + TypeName(_location), m_parameterTypes(_parameterTypes), m_returnTypes(_returnTypes), + m_visibility(_visibility), m_isDeclaredConst(_isDeclaredConst), m_isPayable(_isPayable) + {} + virtual void accept(ASTVisitor& _visitor) override; + virtual void accept(ASTConstVisitor& _visitor) const override; + + std::vector<ASTPointer<VariableDeclaration>> const& parameterTypes() const { return m_parameterTypes->parameters(); } + std::vector<ASTPointer<VariableDeclaration>> const& returnParameterTypes() const { return m_returnTypes->parameters(); } + + Declaration::Visibility visibility() const { return m_visibility; } + bool isDeclaredConst() const { return m_isDeclaredConst; } + bool isPayable() const { return m_isPayable; } + +private: + ASTPointer<ParameterList> m_parameterTypes; + ASTPointer<ParameterList> m_returnTypes; + Declaration::Visibility m_visibility; + bool m_isDeclaredConst; + bool m_isPayable; +}; + +/** * A mapping type. Its source form is "mapping('keyType' => 'valueType')" */ class Mapping: public TypeName |