diff options
author | Lefteris Karapetsas <lefteris@refu.co> | 2015-01-24 00:55:58 +0800 |
---|---|---|
committer | Lefteris Karapetsas <lefteris@refu.co> | 2015-01-29 04:46:16 +0800 |
commit | 468f26b1cce189ea47af9f99b8efe0834a3eed8c (patch) | |
tree | b049dd6ceba6b7667076ea58a3d26640e4691075 | |
parent | 5c7359aa09c46eb7fc27a70e328adde93d4844ab (diff) | |
download | dexon-solidity-468f26b1cce189ea47af9f99b8efe0834a3eed8c.tar dexon-solidity-468f26b1cce189ea47af9f99b8efe0834a3eed8c.tar.gz dexon-solidity-468f26b1cce189ea47af9f99b8efe0834a3eed8c.tar.bz2 dexon-solidity-468f26b1cce189ea47af9f99b8efe0834a3eed8c.tar.lz dexon-solidity-468f26b1cce189ea47af9f99b8efe0834a3eed8c.tar.xz dexon-solidity-468f26b1cce189ea47af9f99b8efe0834a3eed8c.tar.zst dexon-solidity-468f26b1cce189ea47af9f99b8efe0834a3eed8c.zip |
Modifications to Mix to adapt to FunctionDescription
-rw-r--r-- | AST.cpp | 10 | ||||
-rwxr-xr-x | AST.h | 6 |
2 files changed, 15 insertions, 1 deletions
@@ -607,6 +607,16 @@ Declaration const* FunctionDescription::getDeclaration() const return m_description.second; } +VariableDeclaration const* FunctionDescription::getVariableDeclaration() const +{ + return dynamic_cast<VariableDeclaration const*>(m_description.second); +} + +FunctionDefinition const* FunctionDescription::getFunctionDefinition() const +{ + return dynamic_cast<FunctionDefinition const*>(m_description.second); +} + shared_ptr<FunctionType const> FunctionDescription::getFunctionTypeShared() const { return m_description.first; @@ -200,8 +200,12 @@ struct FunctionDescription std::vector<ParamDescription> const getParameters() const; /// @returns the return parameters of the function std::vector<ParamDescription> const getReturnParameters() const; - /// @returns the Declaration AST Node pointer + /// @returns a generic Declaration AST Node pointer which can be either a FunctionDefinition or a VariableDeclaration Declaration const* getDeclaration() const; + /// @returns the VariableDeclaration AST Node pointer or nullptr if it's not a VariableDeclaration + VariableDeclaration const* getVariableDeclaration() const; + /// @returns the FunctionDefinition AST Node pointer or nullptr if it's not a FunctionDefinition + FunctionDefinition const* getFunctionDefinition() const; /// @returns a created shared pointer with the type of the function std::shared_ptr<FunctionType> makeFunctionType() const; /// @returns a pointer to the function type |