aboutsummaryrefslogtreecommitdiffstats
path: root/AST.cpp
diff options
context:
space:
mode:
authorChristian <c@ethdev.com>2014-11-12 00:41:48 +0800
committerChristian <c@ethdev.com>2014-11-12 00:41:48 +0800
commit8c6bf21c01d3ae3c22301bbe0b039aa18e1f58a6 (patch)
treeba26de04d610fcc09c96f366a35bb148180a4e21 /AST.cpp
parenta0c72065fee89c4558eeb4a98e5273633635bc39 (diff)
downloaddexon-solidity-8c6bf21c01d3ae3c22301bbe0b039aa18e1f58a6.tar.gz
dexon-solidity-8c6bf21c01d3ae3c22301bbe0b039aa18e1f58a6.tar.zst
dexon-solidity-8c6bf21c01d3ae3c22301bbe0b039aa18e1f58a6.zip
Provide interface for calls in JSON and some other formatting changes.
Diffstat (limited to 'AST.cpp')
-rw-r--r--AST.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/AST.cpp b/AST.cpp
index 565560ad..70af8f98 100644
--- a/AST.cpp
+++ b/AST.cpp
@@ -263,6 +263,21 @@ TypeError ASTNode::createTypeError(string const& _description)
return TypeError() << errinfo_sourceLocation(getLocation()) << errinfo_comment(_description);
}
+vector<FunctionDefinition const*> ContractDefinition::getInterfaceFunctions() const
+{
+ vector<FunctionDefinition const*> exportedFunctions;
+ for (ASTPointer<FunctionDefinition> const& f: m_definedFunctions)
+ if (f->isPublic() && f->getName() != getName())
+ exportedFunctions.push_back(f.get());
+ auto compareNames = [](FunctionDefinition const* _a, FunctionDefinition const* _b)
+ {
+ return _a->getName().compare(_b->getName()) < 0;
+ };
+
+ sort(exportedFunctions.begin(), exportedFunctions.end(), compareNames);
+ return exportedFunctions;
+}
+
void Block::checkTypeRequirements()
{
for (shared_ptr<Statement> const& statement: m_statements)