Code :
%{
#include<stdio.h>
#include<string.h>
char line[20];
FILE *out;
%}
%%
['\n'] { fprintf(out,"%s\n",line);}
(.*) {strcpy(line,yytext);}
%%
main()
{
yyin=fopen("input.txt","r");
out=fopen("output.txt","w");
yylex();
}
int yywrap()
{
return 1;
}
No comments:
Post a Comment