File tree 1 file changed +7
-7
lines changed
1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change 2
2
// Created by konstantin on 27.07.24.
3
3
//
4
4
5
+ #include < any>
5
6
#include < cassert>
7
+ #include < concepts>
6
8
#include < coroutine>
7
9
#include < iostream>
8
10
#include < unordered_map>
9
- #include < concepts>
10
- #include < any>
11
11
12
12
#include " generator.h"
13
13
@@ -86,24 +86,24 @@ Generator<Sym> input_seq(std::string seq) {
86
86
}
87
87
}
88
88
89
- template <typename F , typename SM>
90
- struct stm_awaiter : public F {
89
+ template <typename TableTransition , typename SM>
90
+ struct stm_awaiter : public TableTransition {
91
91
SM& stm;
92
- stm_awaiter (F f, SM& stm) : F(f), stm(stm) {}
92
+ stm_awaiter (TableTransition transition, SM& stm)
93
+ : TableTransition(transition), stm(stm) {}
93
94
94
95
bool await_ready () const noexcept { return false ; }
95
96
coro_t await_suspend (std::coroutine_handle<>) noexcept {
96
97
stm.gennext ();
97
98
auto sym = stm.genval ();
98
- auto new_state = F ::operator ()(sym);
99
+ auto new_state = TableTransition ::operator ()(sym);
99
100
return stm[new_state];
100
101
}
101
102
[[nodiscard]] bool await_resume () const noexcept {
102
103
return stm.genval () == Sym::Term;
103
104
}
104
105
};
105
106
106
-
107
107
template <class State , class Sym >
108
108
class StateMachine final {
109
109
public:
You can’t perform that action at this time.
0 commit comments