%option noyywrap %option nounput %{ #include #include using namespace std; #include "funkcija.hpp" #include "parser.tab.hpp" %} %% [0-9]+(\.[0-9]*)? { yylval.c = atof(yytext); return num_token; } value return value_token; sin return sin_token; cos return cos_token; function return function_token; [a-wyz] { yylval.slovo = *yytext; return f_id; } x return x_token; [=\n"+*/()\[\]'-] return *yytext; /* " */ [ \t] { } . { cerr << "Leksicka greska: Neprepoznat karakter " << *yytext << endl; exit(EXIT_FAILURE); } %%