%{ #include #include "y.tab.h" %} %% mac-pool return MAC_POOL; \[.*\] ; \"[^\"]*\" { yylval.string = strndup (yytext + 1, yyleng - 2); return STRING; } \#.* ; [\040\t\r,] ; \n yylineno++; [\;\{\}] return yytext[0]; . printf ("unexpected character '%c' in config file line %d, skipping", yytext[0], yylineno); %% int yywrap () { return 1; }