_Coroutine StringLiteral { char ch; // character passed by cocaller // YOU ADD MEMBERS HERE void main(); // coroutine main public: enum Encoding { C, Wide /* u */, Integer /* U or L */, UTF8 /* u8 */ }; _Exception Match { // last character match public: Encoding prefix; // string encoding unsigned int length; // string length std::string & str; // string value Match( Encoding prefix, unsigned int length, std::string & str ) : prefix{prefix}, length{length}, str{str} {} }; _Exception Error {}; // last character invalid void next( char c ) { ch = c; // communication input resume(); // activate } }; /* Test data "" "a\n" "abc" "xyz\012" "xyz\x000c" L"www" "abc"xyz " "a ab" "\\\" "\9" l"www" */