%description: Positive test cases for StringTokenizer2. %includes: #include %global: using namespace omnetpp::common; static void tokenize(const char *text) { try { StringTokenizer2 tokenizer(text, " ", "{}[]()", "'"); while (tokenizer.hasMoreTokens()) { EV << tokenizer.nextToken(); if (tokenizer.hasMoreTokens()) EV << "|"; } EV << "\n"; } catch (std::exception& e) { EV << "ERROR: " << e.what() << "\n"; } } %activity: #define T(x) tokenize(x); T("This 'string contains' {a lot} (of {[{irritating}]}) 'parentheses: {,[ and ('"); T("\\\\ \\ \\{ \\} \\( \\) \\[ \\] \\' \\n"); EV << ".\n"; %contains: stdout This|'string contains'|{a lot}|(of {[{irritating}]})|'parentheses: {,[ and (' \| |{|}|(|)|[|]|'|\n .