aboutsummaryrefslogtreecommitdiffstats
path: root/Scanner.h
diff options
context:
space:
mode:
authorChristian <c@ethdev.com>2014-12-04 00:45:12 +0800
committerChristian <c@ethdev.com>2014-12-04 01:51:59 +0800
commit254df50feab6bb4c9f013257591b73919e4013a5 (patch)
treef8258a07f87046e1695373bc6024af87f51f51be /Scanner.h
parent328387d6d0a14143f1634df11036a91fad85cec9 (diff)
downloaddexon-solidity-254df50feab6bb4c9f013257591b73919e4013a5.tar.gz
dexon-solidity-254df50feab6bb4c9f013257591b73919e4013a5.tar.zst
dexon-solidity-254df50feab6bb4c9f013257591b73919e4013a5.zip
Multi-source and multi-contract compiler.
Diffstat (limited to 'Scanner.h')
-rw-r--r--Scanner.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/Scanner.h b/Scanner.h
index 49ac3651..deb7df50 100644
--- a/Scanner.h
+++ b/Scanner.h
@@ -79,6 +79,8 @@ public:
char advanceAndGet(size_t _chars=1);
char rollback(size_t _amount);
+ void reset() { m_pos = 0; }
+
///@{
///@name Error printing helper functions
/// Functions that help pretty-printing parse errors
@@ -99,11 +101,12 @@ class Scanner
friend class LiteralScope;
public:
- Scanner() { reset(CharStream()); }
- explicit Scanner(CharStream const& _source) { reset(_source); }
+ explicit Scanner(CharStream const& _source = CharStream(), std::string const& _sourceName = "") { reset(_source, _sourceName); }
- /// Resets the scanner as if newly constructed with _input as input.
- void reset(CharStream const& _source);
+ /// Resets the scanner as if newly constructed with _source and _sourceName as input.
+ void reset(CharStream const& _source, std::string const& _sourceName);
+ /// Resets scanner to the start of input.
+ void reset();
/// Returns the next token and advances input
Token::Value next();