%{
#include <stdio.h>
%}
/* Define patterns */
letter [a-zA-Z]
digit [0-9]
id {letter}({letter}|{digit})*
float {digit
}+"
."
{digit
}*
%%
{id} { printf("Valid Identifier: %s\n", yytext); }
{float} { printf
("Valid Floating Point
Number: %s\n", yytext); } . { printf("Invalid Token: %s\n", yytext); }
%%
int main(void) {
yylex(); // Start lexical analysis
return 0;
}
int yywrap() {
return 1;
}
JXsKI2luY2x1ZGUgPHN0ZGlvLmg+CiV9CgovKiBEZWZpbmUgcGF0dGVybnMgKi8KbGV0dGVyICAgICAgW2EtekEtWl0KZGlnaXQgICAgICAgWzAtOV0KaWQgICAgICAgICAge2xldHRlcn0oe2xldHRlcn18e2RpZ2l0fSkqCmZsb2F0ICAgICAgIHtkaWdpdH0rIi4ie2RpZ2l0fSoKCiUlCgp7aWR9ICAgICAgICB7IHByaW50ZigiVmFsaWQgSWRlbnRpZmllcjogJXNcbiIsIHl5dGV4dCk7IH0Ke2Zsb2F0fSAgICAgeyBwcmludGYoIlZhbGlkIEZsb2F0aW5nIFBvaW50IE51bWJlcjogJXNcbiIsIHl5dGV4dCk7IH0KLiAgICAgICAgICAgeyBwcmludGYoIkludmFsaWQgVG9rZW46ICVzXG4iLCB5eXRleHQpOyB9CgolJQoKaW50IG1haW4odm9pZCkgewogICAgeXlsZXgoKTsgIC8vIFN0YXJ0IGxleGljYWwgYW5hbHlzaXMKICAgIHJldHVybiAwOwp9CgppbnQgeXl3cmFwKCkgewogICAgcmV0dXJuIDE7Cn0K