%option noyywrap yylineno c++ debug %x INSIDE %{ #include #include using namespace std; string str; %} LETTER [A-Za-z] %% "<"{LETTER}*">" { str = YYText(); std::cout << str.substr(1, str.length()-2) << endl; } .|\n ; %% int main() { FlexLexer* lexer = new yyFlexLexer(); while (lexer->yylex() != 0) ; return 0; }