SHARE
TWEET

float or not float

a guest Feb 17th, 2020 80 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top