Friday, April 12, 2019

Lex Program for Regular Expression [a+b]

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


Screenshot:

No comments:

Post a Comment