I use flex parser in bison parser to parse lexemes from input file. Some errors (i.e. unclosed brackets or unacceptable symbols) were detected by flex parser. I want notify from flex to bison parser that error was occurred and syntax parsing should failed. Now I use code like this in .l file
RegExpForInvalidChars: {yyerror("Unaccaptable char")};
But bison when called yylex obtained empty lexeme (because I don't return any value) and ignored it. So bad symbols just skipped and parsing is going on.