Hi,
I have also run into a related issue caused by the ambiguous lexer
definition - it matched whitespace using dot rule and the
configuration file failed to parse.
I have used the attached patch to resolve it.
Thank you for considering the patch!
Best Regards,
Vladimir.
Description: resolve ambiguity in the configuration grammar
- enable verbose error reporting to be able to see the failing token
- explicitly match '(', ')' and ',' tokens
- require comments to be single line
Author: Vladimir Petko <[email protected]>
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/tcpxtract/+bug/2063015
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=945092
Forwarded: no
Last-Update: 2024-04-23
--- a/confl.l
+++ b/confl.l
@@ -31,10 +31,10 @@
[a-zA-Z0-9\\\?]+ {yylval.string = strdup(yytext); return SPECIFIER;}
[ \t] {;}
; {return ENDLINE;}
-^#.* {;}
+^#.*$ {;}
\n {;}
\r {;}
-. {return yytext[0];}
+[\(\)\,] {return yytext[0];}
%%
--- a/confy.y
+++ b/confy.y
@@ -26,6 +26,8 @@
#include "confy.h"
%}
+%error-verbose
+
%union {
char *string;
}