%{ #include %} %option noyywrap %% [a-mA-M] {return yytext[0] + 13;} [n-zN-Z] {return yytext[0] - 13;} . {return yytext[0];} %% int main( ) { /* keep reading until 0 (end of input) */ char c = 1; while(c != 0) { c = (char) yylex( ); printf("%c", c); } return 0; }