%{ #include #include #include %} %% ^([^\n])*\$([^\n])*$ {printf("%s",yytext);} ([^\n])* {char *p; for (p = yytext; *p != '\0';p++); for (; p != (yytext-1); p--){printf("%c",*p);} } %% int main() { yylex(); return EXIT_SUCCESS; }