Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %{
- #include "y.tab.h"
- %}
- %option noyywrap noinput nounput batch
- %%
- [ \t\n]
- print return PRT;
- dimension return DIM;
- [][+=*/%();-] return yytext[0];
- "//" return QUO;
- A { yylval.ival = 0; return ID; }
- B { yylval.ival = 1; return ID; }
- C { yylval.ival = 2; return ID; }
- D { yylval.ival = 3; return ID; }
- WW { yylval.ival = 0; return ID2; }
- XX { yylval.ival = 1; return ID2; }
- YY { yylval.ival = 2; return ID2; }
- ZZ { yylval.ival = 3; return ID2; }
- [0-9]+ { yylval.dval = atof(yytext); return NUM; }
- %%
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement