Merge pull request #2835 from ethereum/compilerstack-docs

Reorder some methods in CompilerStack for readability
This commit is contained in:
Alex Beregszaszi 2017-08-28 16:27:10 +01:00 committed by GitHub
commit ab06346e6e

View File

@ -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;
@ -210,7 +213,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;