I\'m writing a simple parser for tcpdump logs, could you please tell me why I can\'t get proper line number?
%{ char str[80]; %} %option yylineno ... %% ^{
When I tried this, it turned out that I had to have a rule that actually matches newline for yylineno to be updated. With the following rule it worked, and without it yylineno never changed:
\n { }