aboutsummaryrefslogtreecommitdiffstats
path: root/CompilerStack.h
diff options
context:
space:
mode:
authorChristian <c@ethdev.com>2014-12-05 22:27:07 +0800
committerChristian <c@ethdev.com>2014-12-05 22:27:07 +0800
commitd4a958e1fe96174f8fab09b5360106895c40e09a (patch)
tree3b1b19552c703690be233d990979580c62b08616 /CompilerStack.h
parentd2cf34548322598ae067434a61a171bd190fc2c9 (diff)
parentc8f96589c58c1a0ab290a192e4aa1dfb263d01df (diff)
downloaddexon-solidity-d4a958e1fe96174f8fab09b5360106895c40e09a.tar.gz
dexon-solidity-d4a958e1fe96174f8fab09b5360106895c40e09a.tar.zst
dexon-solidity-d4a958e1fe96174f8fab09b5360106895c40e09a.zip
Merge remote-tracking branch 'ethereum/develop' into sol_import
Conflicts: libsolidity/CompilerStack.cpp libsolidity/CompilerStack.h solc/main.cpp
Diffstat (limited to 'CompilerStack.h')
-rw-r--r--CompilerStack.h26
1 files changed, 22 insertions, 4 deletions
diff --git a/CompilerStack.h b/CompilerStack.h
index a5b8ec41..34178841 100644
--- a/CompilerStack.h
+++ b/CompilerStack.h
@@ -33,10 +33,18 @@ namespace solidity {
// forward declarations
class Scanner;
+class ContractDefinition;
class SourceUnit;
class Compiler;
class GlobalContext;
-class ContractDefinition;
+class InterfaceHandler;
+
+enum DocumentationType: unsigned short
+{
+ NATSPEC_USER = 1,
+ NATSPEC_DEV,
+ ABI_INTERFACE
+};
/**
* Easy to use and self-contained Solidity compiler with as few header dependencies as possible.
@@ -47,6 +55,7 @@ class CompilerStack: boost::noncopyable
{
public:
CompilerStack(): m_parseSuccessful(false) {}
+
/// Adds a source object (e.g. file) to the parser. After this, parse has to be called again.
void addSource(std::string const& _name, std::string const& _content);
void setSource(std::string const& _sourceCode);
@@ -71,6 +80,11 @@ public:
/// Returns a string representing the contract interface in JSON.
/// Prerequisite: Successful call to parse or compile.
std::string const& getInterface(std::string const& _contractName = "");
+ /// Returns a string representing the contract's documentation in JSON.
+ /// Prerequisite: Successful call to parse or compile.
+ /// @param type The type of the documentation to get.
+ /// Can be one of 3 types defined at @c DocumentationType
+ std::string const& getJsonDocumentation(std::string const& _contractName, enum DocumentationType _type);
/// Returns the previously used scanner, useful for counting lines during error reporting.
Scanner const& getScanner(std::string const& _sourceName = "");
@@ -94,10 +108,15 @@ private:
struct Contract
{
- ContractDefinition const* contract;
- std::string interface;
+ ContractDefinition* contract;
std::shared_ptr<Compiler> compiler;
bytes bytecode;
+ std::shared_ptr<InterfaceHandler> interfaceHandler;
+ std::unique_ptr<std::string> interface;
+ std::unique_ptr<std::string> userDocumentation;
+ std::unique_ptr<std::string> devDocumentation;
+
+ Contract();
};
void reset(bool _keepSources = false);
@@ -109,7 +128,6 @@ private:
bool m_parseSuccessful;
std::map<std::string, Source> m_sources;
std::shared_ptr<GlobalContext> m_globalContext;
- std::shared_ptr<Compiler> m_compiler;
std::vector<Source const*> m_sourceOrder;
std::map<std::string, Contract> m_contracts;
};