Good day.
I wanted to implement the syntax highlighting for the language using a lexer for this. The essence is simple, we find a token, frame it with a set of symbols for a particular color. But the fact is that language tokens are described in BNF, and lex / flex work with regular expressions to write tokens.
The question itself is how to build a lexer for the BNF grammar?