.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#ifndef TYCHE_STACK_HH
|
||||
#define TYCHE_STACK_HH
|
||||
|
||||
#include <stack>
|
||||
#include <vector>
|
||||
|
||||
#include "value.hh"
|
||||
@@ -9,14 +10,20 @@ namespace tyche {
|
||||
|
||||
class Stack {
|
||||
public:
|
||||
Stack();
|
||||
|
||||
void push(Value const& value);
|
||||
Value pop();
|
||||
|
||||
[[nodiscard]] Value at(int pos) const;
|
||||
[[nodiscard]] size_t size() const;
|
||||
|
||||
void push_fp();
|
||||
void pop_fp();
|
||||
|
||||
private:
|
||||
std::vector<Value> stack_;
|
||||
std::stack<size_t> fps_;
|
||||
};
|
||||
|
||||
} // tyche
|
||||
|
||||
Reference in New Issue
Block a user