Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %option noyywrap
- %{
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- #include "y.tab.h"
- extern void yerror(char *s);
- %}
- %%
- print {return print;}
- [0-9]+ {yylval.v=atoi(yytext); return num;}
- [a-zA-Z]+ {strcpy(yylval.s,yytext); return id;}
- \= {return op_dodele;}
- \; {return ';';}
- \+ {return '+';}
- \- {return '-';}
- \* {return '*';}
- \/ {return '/';}
- \( {return '(';}
- \) {return ')';}
- . {yyerror("Leks. greska");}
- [ \n\t] {}
- %%
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement