Friday, April 12, 2019

Lex Program for Regular Expression that accept either ‘a’ or ‘b’ or ‘c’ without using |


%{
#include<stdio.h>
%}
%%
[abc]* {printf("valid");}
.* {printf("invalid");}
%%
main()
{
yylex();
}


ScreenShot:

No comments:

Post a Comment