Official website and documentation (SourceForge I often encounter an inaccessible situation when using, do it yourself, you know)
flex:http://flex.sourceforge.net/
Document: http://flex.sourceforge.net/manual/
bison:http://www.gnu.org/software/bison/
Document: Https://www.gnu.org/software/bison/manual/html_node/index.html
The versions I am currently using are: Flex 2.5.37, Bison 3.0.2, yum installation
Debug parameters
As you can see through--HELP, the Flex debug switch-d,bison the debug switch to-T, adding both parameters when generating the code.
Manually adjust the Bison code, the light switch is not enough, open gram.c, you can see a lot of macro definitions inside are: "if (yydebug)", search "int yydebug;" definition to: "int yydebug = 1;" Another way is to set yydebug nonzero before starting the grammar engine in other files .
See section: https://www.gnu.org/software/bison/manual/html_node/Tracing.html
Scan.c bug fix, I could not compile the file in the version I used, error:
in file included from gram.y:14877:0:scan.c: in function ' Core_yylex ': scan.c:9263:47: error: macro "fprintf" requires 3 arguments, but only 2 given fprintf ( stderr, "--scanner backing up\n" ); ^scan.c:9263:5: warning: statement with no effect [-wunused-value] fprintf ( stderr, "--scanner backing up\n" ); ^scan.c:9266:52: error: macro "fprintf" passed 4 arguments, but takes just 3 (long) yy_rule_linenum[yy_act], yytext ); ^scan.c:9265:5: warning: statement with no effect [-wunused-value] fprintf ( stderr, "--accepting rule at line %ld (\"%s\ ") \ n",    ^ &NBSP, .....
Open the SCAN.C Discovery macro definition:
#undef fprintf#define fprintf (file, FMT, msg) fprintf_to_ereport (FMT, msg) static voidfprintf_to_ereport (const char *FMT , const char *msg) {ereport (ERROR, (Errmsg_internal ("%s", msg));}
In conflict with the usage of fprintf below, comment out these lines
Debugging of Flex and Bison