%option noyywrap %option nounput %{ #include using namespace std; #include "regex.hpp" #include "parser.tab.hpp" %} %% "BASIC" return basic_token; "DEFINITION" return definition_token; "MAXLEN" return maxlen_token; [a-z] { yylval.c = *yytext; return slovo_token; } [A-Z] { yylval.c = *yytext; return id_token; } [\n*|+\[\]={}] return *yytext; [ \t] { } . { cerr << "Leksicka greska: Neprepoznat karatker'" << *yytext << "'" << endl; exit(EXIT_FAILURE); } %%