Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %{
- //LEX with YACC
- #include<stdio.h>
- #include<stdlib.h>
- void yyerror(char*);
- #include "y.tab.h"
- %}
- %%
- [0-9]* { yylval = atoi(yytext);
- return NUM;}
- "(" { return L; }
- ")" { return R; }
- "&" { return LOGICAL_AND; }
- "&&" { return BIT_AND; }
- "|" { return LOGICAL_OR; }
- "||" { return BIT_OR;}
- "^" { return LOGICAL_EXOR; }
- "^^" { return BIT_EXOR;}
- "~" { return LOGICAL_NOT; }
- "<<" { return SHIFT_LEFT; }
- ">>" { return SHIFT_RIGHT; }
- "+" { return REL_EQ; }
- ">" { return REL_GT; }
- "<" { return REL_LT; }
- ">=" { return REL_GE; }
- "<=" { return REL_LE; }
- %%
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement