Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %{
- /*float or not float*/
- %}
- %%
- [0-9] {printf("%s is a digit.\n", yytext);}
- -?[0-9]+ {printf("%s is an integer number.\n", yytext);}
- [0-9]+\.[0-9]+ {printf("%s is a float number.\n", yytext);}
- [a-zA-Z] {printf("%s is an alphabet.\n", yytext);}
- [a-zA-Z]+ {printf("%s is a word.\n", yytext);}
- .|\n {ECHO;}
- %%
- main(){
- yylex();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement