Advertisement
Guest User

lex

a guest
Feb 27th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.22 KB | None | 0 0
  1. %{
  2. #include "y.tab.h"
  3. %}
  4.  
  5. %%
  6. [-+*/=;()\n] {return *yytext;}
  7. [0-9]+ {yylval = atoi(yytext); return NUMBER;}
  8. [ \t] ;
  9. . {printf("unrecgonised character"); return 0;}
  10.  
  11. %%
  12.  
  13. int yywrap(void)
  14. {
  15. return 1;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement