Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %{
- #include<stdio.h>
- %}
- %%
- [-+0-9]+ { printf ("%s is not a float.\n", yytext); }
- [-+0-9]*(\.)[0-9]+ {printf("%s is a float.\n",yytext);}
- [a-zA-Z]+ { printf ("%s is not a number.\n", yytext); }
- %%
- int yywrap(){}
- int main()
- {
- printf("\nA lex specification to recognize Integer:\nEnter your input: ");
- yylex();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement