diff options
author | Christian <c@ethdev.com> | 2015-01-28 20:39:04 +0800 |
---|---|---|
committer | Christian <c@ethdev.com> | 2015-01-28 20:39:04 +0800 |
commit | 95d8d7b1f00d3521d20a3735472e359d03d71816 (patch) | |
tree | 0662c5bed06b9cdffae7bc90d1f9466534f59c9c /CompilerStack.h | |
parent | 34d07fc5837745ee3c8fbc571d0e2f0d02041cf1 (diff) | |
download | dexon-solidity-95d8d7b1f00d3521d20a3735472e359d03d71816.tar dexon-solidity-95d8d7b1f00d3521d20a3735472e359d03d71816.tar.gz dexon-solidity-95d8d7b1f00d3521d20a3735472e359d03d71816.tar.bz2 dexon-solidity-95d8d7b1f00d3521d20a3735472e359d03d71816.tar.lz dexon-solidity-95d8d7b1f00d3521d20a3735472e359d03d71816.tar.xz dexon-solidity-95d8d7b1f00d3521d20a3735472e359d03d71816.tar.zst dexon-solidity-95d8d7b1f00d3521d20a3735472e359d03d71816.zip |
Cleaner solution to provide standard sources.
Diffstat (limited to 'CompilerStack.h')
-rw-r--r-- | CompilerStack.h | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/CompilerStack.h b/CompilerStack.h index 09a1ad34..cae0f4e2 100644 --- a/CompilerStack.h +++ b/CompilerStack.h @@ -59,7 +59,8 @@ extern const std::map<std::string, std::string> StandardSources; class CompilerStack: boost::noncopyable { public: - CompilerStack(): m_parseSuccessful(false) {} + /// Creates a new compiler stack. Adds standard sources if @a _addStandardSources. + explicit CompilerStack(bool _addStandardSources = true); /// 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. @@ -68,7 +69,7 @@ public: void setSource(std::string const& _sourceCode); /// Parses all source units that were added void parse(); - /// Sets the given source code as the only source unit and parses it. + /// Sets the given source code as the only source unit apart from standard sources and parses it. void parse(std::string const& _sourceCode); /// Returns a list of the contract names in the sources. std::vector<std::string> getContractNames() const; @@ -141,16 +142,13 @@ private: Contract(); }; - /// Expand source code with preprocessor-like includes. - /// @todo Replace with better framework. - std::string expanded(std::string const& _sourceCode); - void reset(bool _keepSources = false); void resolveImports(); Contract const& getContract(std::string const& _contractName = "") const; Source const& getSource(std::string const& _sourceName = "") const; + bool m_addStandardSources; ///< If true, standard sources are added. bool m_parseSuccessful; std::map<std::string const, Source> m_sources; std::shared_ptr<GlobalContext> m_globalContext; |