Roll No. : 07 Name : Pratik Manoj Bhandari Date : *****************************************************************************/ // LEX Program to identify capital strings from given input. %{ /* Definition Section */ %} %% [A-Z]+ [ \t\n\.\,] {printf("%s",yytext);} .; %% main() { printf("\n Enter the input string:"); yylex(); } int yywrap() { return 1; }
OUTPUT :[admin27@localhost pratik]$ lex asd.l
[admin27@localhost pratik]$ cc lex.yy.c [admin27@localhost pratik]$ ./a.out Enter The Input String: HellO HO