%option noyywrap %option noinput %option nounput %{ #include #include #include "polinom.h" #include "y.tab.h" %} %% [-]?[0-9]+(\.[0-9]+)? { yylval.x = atof(yytext); return num_token; } [a-zA-Z][a-zA-Z0-9]+ { yylval.s = strdup(yytext); return id_token; } [<>,\n+*():=!$|'-\[\]] return *yytext; [ \t] { } . { fprintf(stderr, "Leksicka greska: Neprepoznat karakter '%c'\n", *yytext); exit(EXIT_FAILURE); } %%