diff options
author | chriseth <chris@ethereum.org> | 2017-09-21 22:56:16 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-21 22:56:16 +0800 |
commit | bdeb9e52a2211510644fb53df93fb98258b40a65 (patch) | |
tree | d8fb917e7dc27b937cb4505029bbc3c8c1bc1a67 /libsolidity/interface/CompilerStack.h | |
parent | d7661dd97460250b4e1127b9e7ea91e116143780 (diff) | |
parent | a14fc5ffa1f03d5aa312396a39633d720b04c90a (diff) | |
download | dexon-solidity-bdeb9e52a2211510644fb53df93fb98258b40a65.tar dexon-solidity-bdeb9e52a2211510644fb53df93fb98258b40a65.tar.gz dexon-solidity-bdeb9e52a2211510644fb53df93fb98258b40a65.tar.bz2 dexon-solidity-bdeb9e52a2211510644fb53df93fb98258b40a65.tar.lz dexon-solidity-bdeb9e52a2211510644fb53df93fb98258b40a65.tar.xz dexon-solidity-bdeb9e52a2211510644fb53df93fb98258b40a65.tar.zst dexon-solidity-bdeb9e52a2211510644fb53df93fb98258b40a65.zip |
Merge pull request #2947 from ethereum/develop
Merge develop into release for 0.4.17.
Diffstat (limited to 'libsolidity/interface/CompilerStack.h')
-rw-r--r-- | libsolidity/interface/CompilerStack.h | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/libsolidity/interface/CompilerStack.h b/libsolidity/interface/CompilerStack.h index 361b8a45..f1bbae47 100644 --- a/libsolidity/interface/CompilerStack.h +++ b/libsolidity/interface/CompilerStack.h @@ -116,6 +116,9 @@ public: m_optimizeRuns = _runs; } + /// @arg _metadataLiteralSources When true, store sources as literals in the contract metadata. + void useMetadataLiteralSources(bool _metadataLiteralSources) { m_metadataLiteralSources = _metadataLiteralSources; } + /// Adds a source object (e.g. file) to the parser. After this, parse has to be called again. /// @returns true if a source object by the name already existed and was replaced. bool addSource(std::string const& _name, std::string const& _content, bool _isLibrary = false); @@ -125,7 +128,7 @@ public: bool parse(); /// Performs the analysis steps (imports, scopesetting, syntaxCheck, referenceResolving, - /// typechecking, staticAnalysis) on previously set sources + /// typechecking, staticAnalysis) on previously parsed sources. /// @returns false on error. bool analyze(); @@ -133,9 +136,6 @@ public: /// @returns false on error. bool parseAndAnalyze(); - /// @returns a list of the contract names in the sources. - std::vector<std::string> contractNames() const; - /// Compiles the source units that were previously added and parsed. /// @returns false on error. bool compile(); @@ -158,6 +158,9 @@ public: /// start line, start column, end line, end column std::tuple<int, int, int, int> positionFromSourceLocation(SourceLocation const& _sourceLocation) const; + /// @returns a list of the contract names in the sources. + std::vector<std::string> contractNames() const; + /// @returns either the contract's name or a mixture of its name and source file, sanitized for filesystem use std::string const filesystemFriendlyName(std::string const& _contractName) const; @@ -187,11 +190,15 @@ public: /// if the contract does not (yet) have bytecode. std::string const* runtimeSourceMapping(std::string const& _contractName = "") const; - /// Streams a verbose version of the assembly to @a _outStream. + /// @return a verbose text representation of the assembly. + /// @arg _sourceCodes is the map of input files to source code strings + /// Prerequisite: Successful compilation. + std::string assemblyString(std::string const& _contractName = "", StringMap _sourceCodes = StringMap()) const; + + /// @returns a JSON representation of the assembly. /// @arg _sourceCodes is the map of input files to source code strings - /// @arg _inJsonFromat shows whether the out should be in Json format /// Prerequisite: Successful compilation. - Json::Value streamAssembly(std::ostream& _outStream, std::string const& _contractName = "", StringMap _sourceCodes = StringMap(), bool _inJsonFormat = false) const; + Json::Value assemblyJSON(std::string const& _contractName = "", StringMap _sourceCodes = StringMap()) const; /// @returns a JSON representing the contract ABI. /// Prerequisite: Successful call to parse or compile. @@ -210,7 +217,6 @@ public: /// @returns the Contract Metadata std::string const& metadata(std::string const& _contractName) const; - void useMetadataLiteralSources(bool _metadataLiteralSources) { m_metadataLiteralSources = _metadataLiteralSources; } /// @returns a JSON representing the estimated gas usage for contract creation, internal and external functions Json::Value gasEstimates(std::string const& _contractName) const; |