Friday, April 12, 2019

Lex Program for Regular Expression that accepts all the strings which ends with ‘b’


%{
#include<stdio.h>
%}
%%
[a-z]*b$ {printf("valid");}
.* {printf("invalid");}
%%
main()
{
yylex();
}
ScreenShot:

No comments:

Post a Comment