Debian Codegraph @

yo/coroutines/demo/fsa_awaiter/digit/codigit.cc

raw
1 #include "digit.ih"
2
3 Digit coDigit()
4 {
5 char ch;
6 while (cin.get(ch))
7 {
8 if (isalpha(ch))
9 {
10 cout << "at `" << ch << "' from digit to letter\n";
11 co_await Awaiter{ g_letter.handle() };
12 }
13 else
14 if (isdigit(ch))
15 cout << "at `" << ch << "' remain in digit\n";
16 else
17 {
18 cout << "at char #" << static_cast<int>(ch) <<
19 ": from digit to start\n";
20 co_await Awaiter{ g_start.handle() };
21 }
22 }
23 co_await Awaiter{ g_done.handle() };
24 }