07-05-2011, 12:50 PM
Objective
Program in “LEX” to count the verb in a given line of text.
Code:
%{
%}
%%
isI
areI
amI printf("%s is verb",yytext );
[a-zA-Z]+ {printf("%s is not a verb",yytext);}
.I\n {ECHO;}
%%
main()
{
yylex();
}