Tuesday 1 April 2014

5. Lex program to print the words in a file that doesnot start with a vowel

The question is self explanatory.

 Here is the code:




%{
%}
%%
[aeiouAEIOU].[a-zA-Z0-9.]+    printf("");
[a-zA-Z0-9]+    printf("%s",yytext);
%%
main()
{
    extern FILE *yyin;
    yyin=fopen("new","r");
    yylex();
}

1 comment:

  1. dosent this program also print words starting with a,e,i,o,u,A,E,I,O,U??

    ReplyDelete