Friday, April 12, 2019

Lex program to recognize character, string and special symbols from given input


%{
#include<stdio.h>
%}
%%
[a-zA-Z0-9] {printf("character");}
[^a-zA-Z0-9\n] {printf("special character");}
\".*\" {printf("string");}
%%
main()
{
yylex();
}


ScreenShot:

No comments:

Post a Comment