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