Okay I have the following lex file. I was wondering if there
exists some sort of convertor from lex into perl or if some kind soul
would aid me in converting this file into a perl script. Thanks!
The lex file is as follows:
%{
static int i_seen = 0;
%}
WC [A-Za-z']
NW [^A-Za-z']
%start INW NIW
%%
\\[ \n]+ ECHO;
{NW} { BEGIN NIW; i_seen = 0; ECHO; }
","$ { BEGIN NIW; i_seen = 0; printf(".\nDong Dong Dong!"); }
<NIW>"dong"/{NW} ECHO;
<NIW>"Dong"/{NW} ECHO;
"an" { BEGIN INW; printf("un"); }
"An" { BEGIN INW; printf("Un"); }
"au" { BEGIN INW; printf("oo"); }
"Au" { BEGIN INW; printf("Oo"); }
"a"/{WC} { BEGIN INW; printf("e"); }
"A"/{WC} { BEGIN INW; printf("E"); }
"en"/{NW} { BEGIN INW; printf("ee"); }
<INW>"ew" { BEGIN INW; printf("oo"); }
<INW>"e"/{NW} { BEGIN INW; printf("e-a"); }
<NIW>"e" { BEGIN INW; printf("i"); }
<NIW>"E" { BEGIN INW; printf("I"); }
<INW>"f" { BEGIN INW; printf("ff"); }
<INW>"ir" { BEGIN INW; printf("ur"); }
<INW>"i" { BEGIN INW; printf(i_seen ? "i" : "ee"); }
<INW>"ow" { BEGIN INW; printf("oo"); }
<NIW>"o" { BEGIN INW; printf("oo"); }
<NIW>"O" { BEGIN INW; printf("Oo"); }
<INW>"o" { BEGIN INW; printf("u"); }
"the" { BEGIN INW; printf("zee"); }
"The" { BEGIN INW; printf("Zee"); }
"th"/{NW} { BEGIN INW; printf("t"); }
<INW>"tion" { BEGIN INW; printf("shun"); }
<INW>"u" { BEGIN INW; printf("oo"); }
<INW>"U" { BEGIN INW; printf("Oo"); }
"v" { BEGIN INW; printf("f"); }
"V" { BEGIN INW; printf("F"); }
"w" { BEGIN INW; printf("v"); }
"W" { BEGIN INW; printf("V"); }
. { BEGIN INW; ECHO; }
--
.sig under construction