diff options
author | Albert <albert.tests@gmail.com> | 2013-11-13 17:43:28 (GMT) |
---|---|---|
committer | Albert <albert.tests@gmail.com> | 2013-11-13 17:43:28 (GMT) |
commit | 3c0a246bd1bcf6f0d560394fd81616260a174ae8 (patch) | |
tree | a0314c4c4ccc8e1af611823f2fd76bf991ccd519 /src/tclscanner.l | |
parent | e4b819d62fa50f0445ddad92e46b3575ce011e3c (diff) | |
download | Doxygen-3c0a246bd1bcf6f0d560394fd81616260a174ae8.zip Doxygen-3c0a246bd1bcf6f0d560394fd81616260a174ae8.tar.gz Doxygen-3c0a246bd1bcf6f0d560394fd81616260a174ae8.tar.bz2 |
Debug output for lexical analyzer
In case of error messages like:
input buffer overflow, can't enlarge buffer because scanner uses REJECT
it is not always directly clear from which lexical analyzer (.l file) this problem comes.
This patch helps to find these problems and does the following things:
- when using the option -d lex with doxygen each time a lexical analyzer is called at the start a line like the following line will be given:
Entering lexical analyzer: pre.l (for: ..../file.c)
and at the end:
Finished lexical analyzer: pre.l (for: ..../file.c)
- in case the lexical analyzer has been translated with the -d option of lex / flex the above mentioned lines will be given as part of the lexical analyzer output (to stderr) and look like:
--entering lexical analyzer: pre.l (for: ..../file.c)
--finished lexical analyzer: pre.l (for: ..../file.c)
Diffstat (limited to 'src/tclscanner.l')
-rw-r--r-- | src/tclscanner.l | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/tclscanner.l b/src/tclscanner.l index 5bbb396..1fd20cd 100644 --- a/src/tclscanner.l +++ b/src/tclscanner.l @@ -127,7 +127,7 @@ int TclFindElement( goto done; } - if (*p == '{') + if (*p == '{') /* } to keep vi happy */ { openBraces = 1; p++; @@ -2541,6 +2541,7 @@ tcl_inf("%s\n",fileName); tcl.input_string = input; if (tcl.input_string.length()<1) return; + printlex(yy_flex_debug, TRUE, __FILE__, fileName); msg("Parsing %s...\n",fileName); groupEnterFile(fileName,yylineno); @@ -2554,6 +2555,7 @@ tcl_inf("%s\n",fileName); groupLeaveFile(tcl.file_name,yylineno); root->program.resize(0); myFile.close(); + printlex(yy_flex_debug, FALSE, __FILE__, fileName); } //! Parse file and codify. @@ -2583,6 +2585,7 @@ void TclLanguageScanner::parseCode(CodeOutputInterface & codeOutIntf, (void)collectXRefs; if (input.length()<1) return; + printlex(yy_flex_debug, TRUE, __FILE__, fileDef ? fileDef->fileName().data(): NULL); tcl.input_string = input; QCString myNs=""; @@ -2655,6 +2658,7 @@ tcl_inf("%s (%d,%d) %d %d\n",myStr.ascii(),startLine,endLine,isExampleBlock,inli tcl.cl.clear(); tcl.fn.clear(); tcl.entry.clear(); + printlex(yy_flex_debug, FALSE, __FILE__, fileDef ? fileDef->fileName().data(): NULL); } bool TclLanguageScanner::needsPreprocessing(const QCString &extension) |