I'm doing a translation of acronyms. That is, if it finds 'OMS' print 'Organización Mundial del trabajo', but once I compile and run the program it runs infinitely.
I'm using Windows as a development environment. I have seen examples but I can't see where the error is. Here is the code:
%option noyywrap
%{
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
%}
%%
OMS {fprintf(yyout,"Organización Mundial del trabajo");}
%%
int main(int argc, char *argv[]) {
FILE*yyin=fopen(argv[1],"r");
FILE*yyout=fopen(argv[2],"w");
yylex();
fclose(yyin);
fclose(yyout);
return 0;
}