Advertisement
Guest User

new

a guest
Aug 21st, 2019
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. %{
  2. #include<stdio.h>
  3. %}
  4.  
  5. %%
  6.  
  7. [-+0-9]+ { printf ("%s is not a float.\n", yytext); }
  8. [-+0-9]*(\.)[0-9]+ {printf("%s is a float.\n",yytext);}
  9. [a-zA-Z]+ { printf ("%s is not a number.\n", yytext); }
  10.  
  11. %%
  12.  
  13. int yywrap(){}
  14.  
  15. int main()
  16. {
  17. printf("\nA lex specification to recognize Integer:\nEnter your input: ");
  18. yylex();
  19. return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement