Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %{
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- #include "y.tab.h"
- int yyline;
- %}
- %%
- [A-Za-z"_"]{1,} {
- strcpy(yylval.ctekst, yytext);
- return TEKST;
- }
- "0."[0-9]{1} {
- yylval.ckriterijum = atof(yytext);
- return KRITERIJUM;
- }
- "*"|"+"|"-"|"?" {
- if (yytext[0] == '*') {
- yylval.cocena = 3;
- }
- else if (yytext[0] == '+') {
- yylval.cocena = 2;
- }
- else if (yytext[0] == '-') {
- yylval.cocena = 1;
- }
- else {
- yylval.cocena = 0;
- }
- return OCENA;
- }
- "###" {
- return TARABE;
- }
- "pr:" {
- return PR;
- }
- " " {
- }
- \n {
- yyline++;
- }
- . {
- return yytext[0];
- }
- %%
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement