diff options
| author | jantuomi <jans.tuomi@gmail.com> | 2016-09-01 13:24:09 +0300 |
|---|---|---|
| committer | jantuomi <jans.tuomi@gmail.com> | 2016-09-01 13:24:09 +0300 |
| commit | 41f1e410b7cc48db4ec0b99d9d2b49d2edb2a315 (patch) | |
| tree | f551fd722d134c2c82accc9fa80fe739cf6fa82f | |
| parent | 50bafbdd68160d00606a4e83d9759c21223c11f8 (diff) | |
Implement runtime methods
| -rw-r--r-- | src/main.cpp | 1 | ||||
| -rw-r--r-- | src/runtime.cpp | 6 | ||||
| -rw-r--r-- | src/runtime.h | 1 |
3 files changed, 8 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp index c39e469..53a6540 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -34,6 +34,7 @@ int main(int argc, char** argv) { parser.printValues(values); Runtime runtime; + runtime.initValues(values); runtime.run(tokens); return 0; diff --git a/src/runtime.cpp b/src/runtime.cpp index 4edb3e6..26c5885 100644 --- a/src/runtime.cpp +++ b/src/runtime.cpp @@ -4,6 +4,12 @@ Runtime::Runtime() { } +void Runtime::initValues(const std::vector<int>& values) { + for (const int i : values) { + m_values.push(i); + } +} + /* Returns false if token is not a command */ bool Runtime::runCommand(const Token& token) { // TODO diff --git a/src/runtime.h b/src/runtime.h index 3572391..af8351f 100644 --- a/src/runtime.h +++ b/src/runtime.h @@ -10,5 +10,6 @@ class Runtime { public: Runtime(); + void initValues(const std::vector<int>& values); void run(std::vector<Token>& tokens); }; |
