Friday, April 12, 2019

Lex programs for Regular Expression that accept zero or one (at most one) occurrence of "a"

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

ScreenShot:



No comments:

Post a Comment