Answers for "lex program to identify token"

0

lex program to identify token

%{
#include<stdio.h>
%}
%%
bool|int|float printf("Keyword");
[-,+]?[0-9]+ printf("Constants");
[,.'"]+ printf("Punctuation Chars");
[!@#$%^&*()]+ printf("Special Chars");
[a-zA-Z]+ printf("Identifiers");
%%
main(){yylex();}
Posted by: Guest on May-06-2021

Browse Popular Code Answers by Language