Something
public text v1 · immutable%{
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
%}
%%
^([^\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;
}