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