aboutsummaryrefslogtreecommitdiffstats
path: root/CompilerStack.h
diff options
context:
space:
mode:
Diffstat (limited to 'CompilerStack.h')
-rw-r--r--CompilerStack.h10
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;