Advertisement
Guest User

float or not float

a guest
Feb 17th, 2020
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. %{
  2. /*float or not float*/
  3. %}
  4. %%
  5. [0-9] {printf("%s is a digit.\n", yytext);}
  6. -?[0-9]+ {printf("%s is an integer number.\n", yytext);}
  7. [0-9]+\.[0-9]+ {printf("%s is a float number.\n", yytext);}
  8. [a-zA-Z] {printf("%s is an alphabet.\n", yytext);}
  9. [a-zA-Z]+ {printf("%s is a word.\n", yytext);}
  10. .|\n {ECHO;}
  11. %%
  12. main(){
  13. yylex();
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement