mirror of
https://github.com/siemens-mobile-hacks/doxygen.git
synced 2026-11-26 06:37:51 +00:00
Improve debugging for lexical scanners
- Debug builds now have lex debugging compiled in by default - For a release build option `enable_lex_debug` can enabled to compile in debug support. - Option `-d lex` will now turn on debugging output for all lexers. - Option `-d lex:name` will turn on debugging for lexer `name` only.
This commit is contained in:
parent
2467435730
commit
88c1899ae2
29 changed files with 155 additions and 108 deletions
|
|
@ -30,7 +30,8 @@ option(static_libclang "Link to a statically compiled version of LLVM/libclang."
|
|||
option(win_static "Link with /MT in stead of /MD on windows" OFF)
|
||||
option(enable_console "Enable that executables on Windows get the CONSOLE bit set for the doxywizard executable [development]" OFF)
|
||||
option(enable_coverage "Enable coverage reporting for gcc/clang [development]" OFF)
|
||||
option(enable_tracing "Enable tracing for release builds [development]" OFF)
|
||||
option(enable_tracing "Enable tracing option in release builds [development]" OFF)
|
||||
option(enable_lex_debug "Enable debugging info for lexical scanners in release builds [development]" OFF)
|
||||
|
||||
set(force_qt CACHE INTERNAL "Forces doxywizard to build using the specified major version, this can be Qt5 or Qt6")
|
||||
set_property(CACHE force_qt PROPERTY STRINGS OFF Qt6 Qt5)
|
||||
|
|
@ -153,6 +154,10 @@ endif()
|
|||
find_package(Threads)
|
||||
find_package(Sanitizers)
|
||||
|
||||
if ((CMAKE_BUILD_TYPE STREQUAL "Debug") OR enable_lex_debug)
|
||||
set(LEX_FLAGS "${LEX_FLAGS} -d")
|
||||
endif()
|
||||
|
||||
if (sqlite3)
|
||||
find_package(SQLite3 REQUIRED)
|
||||
if (SQLITE3_VERSION VERSION_LESS 3.9.0)
|
||||
|
|
|
|||
|
|
@ -104,50 +104,25 @@ Finally the data for members of classes, namespaces, and files is stored in
|
|||
the subclass MemberDef. This class is used for functions, variables, enums, etc, as indicated by
|
||||
MemberDef::memberType().
|
||||
|
||||
Producing debug output
|
||||
======================
|
||||
Producing tracing and debug output
|
||||
==================================
|
||||
|
||||
Within doxygen there are a number of ways to obtain debug output. Besides the
|
||||
invasive method of putting print statements in the code there are a number of
|
||||
easy ways to get debug information.
|
||||
invasive method of putting print statements in the code there are a number of
|
||||
easier ways to get debug information.
|
||||
|
||||
For a debug build (build option `-DCMAKE_BUILD_TYPE=Debug`)
|
||||
these options are always available, but for a release build some debug capabilities have to be enabled explicitly
|
||||
(see build options `-Denable_tracing=YES` and `-Denable_lex_debug=YES`).
|
||||
|
||||
To enable tracing use the `-t` option. You can optionally specify a name of a trace file,
|
||||
if omitted `trace.txt` will be used.
|
||||
When running doxygen with tracing enabled, doxygen will write a lot of internal information to the trace file,
|
||||
which can be used (by experts) to diagnose problems.
|
||||
|
||||
During a run of doxygen it is possible to specify the `-d` command line option with one of the
|
||||
following values (each option has to be preceded by `-d`):
|
||||
|
||||
- Compilation of `.l` files<br>
|
||||
This is also an invasive method but it will be automatically done by the
|
||||
`flex / lex` command. The result is that of each input line the (lex) rule(s)
|
||||
that are applied on it are shown.
|
||||
- windows
|
||||
- in the Visual C++ GUI
|
||||
- find the required `.l` file
|
||||
- select the `Properties` of this file
|
||||
- set the item `Write used lex rules` to `Yes`
|
||||
- see to it that the `.l` file is newer than the corresponding `.cpp` file
|
||||
or remove the corresponding `.cpp` file
|
||||
- when using `nmake` the same possibilities exist as described with "unices".
|
||||
- unices
|
||||
- global change<br>
|
||||
In the chapter "Doxygen's internals" a `perl` script is given to toggle the
|
||||
possibility of having the rules debug information.
|
||||
- command line change<br>
|
||||
It is possible to the option `LEX_FLAGS="-d"` with the `make` command on the
|
||||
command line. In this case the `.l` that are converted to the corresponding
|
||||
`.cpp` files during this `make` get the rules debug information.<br>
|
||||
To undo the rules debug information output just recompile the file with
|
||||
just `make`.<br>
|
||||
Note this method applies for all the `.l` files that are rebuild to `.cpp`
|
||||
files so be sure that only the `.l` files(s) of which you want to have the
|
||||
rules debug information is (are) newer than the corresponding `.cpp`
|
||||
file(s).
|
||||
- Running doxygen<br>
|
||||
During a run of doxygen it is possible to specify the `-d` option with the
|
||||
following possibilities (each option has to be preceded by `-d`):
|
||||
- findmembers<br>
|
||||
Gives of global, class, module members its scope, arguments and other relevant information.
|
||||
- functions<br>
|
||||
Gives of functions its scope, arguments and other relevant information.
|
||||
- variables<br>
|
||||
Gives of variables its scope and other relevant information.
|
||||
- classes<br>
|
||||
Gives of classes en modules its scope and other relevant information.
|
||||
- preprocessor<br>
|
||||
Shows the results of the preprocessing phase, i.e. results from include files,
|
||||
<tt>\#define</tt> statements etc., definitions in the doxygen configuration file like:
|
||||
|
|
@ -179,10 +154,6 @@ easy ways to get debug information.
|
|||
command is specified)
|
||||
- validate<br>
|
||||
Currently not used
|
||||
- lex<br>
|
||||
Provide output of the `lex` files used. When a lexer is started and when a lexer
|
||||
ends the name of the `lex` file is given so it is possible to see in which lexer the
|
||||
problem occurs. This makes it easier to select the file to be compiled in `lex` debug mode.
|
||||
- cite<br>
|
||||
Retains the temporary files as created and used for the non LaTeX output results of the
|
||||
generation of the bibliographical references.
|
||||
|
|
@ -202,6 +173,12 @@ easy ways to get debug information.
|
|||
also some extra checks are done by means of the `-c` flag of the `qhelpgenerator`.
|
||||
- tag<br>
|
||||
Shows the results of reading the tag files.
|
||||
- lex<br>
|
||||
Provide output of the `lex` files used. When a lexer is started and when a lexer
|
||||
ends the name of the `lex` file is given so it is possible to see in which lexer the
|
||||
problem occurs. This makes it easier to select the file to be compiled in `lex` debug mode.
|
||||
- lex:lexer<br>
|
||||
Enables output for a specific lexer only, where `lexer` should be replaced by the name of the specific lexer.
|
||||
|
||||
Producing output
|
||||
================
|
||||
|
|
|
|||
|
|
@ -31,7 +31,6 @@
|
|||
#include <vector>
|
||||
#include <stdio.h>
|
||||
#include "xml.h"
|
||||
//#include "message.h"
|
||||
|
||||
#define YY_NEVER_INTERACTIVE 1
|
||||
#define YY_NO_INPUT 1
|
||||
|
|
@ -432,7 +431,7 @@ void XMLParser::parse(const char *fileName,const char *inputStr, bool debugEnabl
|
|||
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
|
||||
|
||||
#ifdef FLEX_DEBUG
|
||||
xmlYYset_debug(1,p->yyscanner);
|
||||
xmlYYset_debug(debugEnabled?1:0,p->yyscanner);
|
||||
#endif
|
||||
|
||||
if (inputStr==nullptr || inputStr[0]=='\0') return; // empty input
|
||||
|
|
|
|||
|
|
@ -388,7 +388,7 @@ if (use_libclang)
|
|||
target_compile_definitions(doxygen PRIVATE ${LLVM_DEFINITIONS})
|
||||
endif()
|
||||
|
||||
if((CMAKE_BUILD_TYPE EQUAL "DEBUG") OR enable_tracing)
|
||||
if((CMAKE_BUILD_TYPE STREQUAL "Debug") OR enable_tracing)
|
||||
target_compile_definitions(doxycfg PRIVATE -DENABLE_TRACING=1)
|
||||
target_compile_definitions(doxymain PRIVATE -DENABLE_TRACING=1)
|
||||
target_compile_definitions(doxygen PRIVATE -DENABLE_TRACING=1)
|
||||
|
|
|
|||
|
|
@ -64,6 +64,7 @@ typedef yyguts_t *yyscan_t;
|
|||
#include "scopedtypevariant.h"
|
||||
#include "symbolresolver.h"
|
||||
#include "dir.h"
|
||||
#include "debug.h"
|
||||
|
||||
// Toggle for some debugging info
|
||||
//#define DBG_CTX(x) fprintf x
|
||||
|
|
@ -3901,7 +3902,7 @@ CCodeParser::CCodeParser() : p(std::make_unique<CCodeParser::Private>())
|
|||
{
|
||||
codeYYlex_init_extra(&p->state,&p->yyscanner);
|
||||
#ifdef FLEX_DEBUG
|
||||
codeYYset_debug(1,p->yyscanner);
|
||||
codeYYset_debug(Debug::isFlagSet(Debug::Lex_code)?1:0,p->yyscanner);
|
||||
#endif
|
||||
resetCodeParserState();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1198,7 +1198,7 @@ void convertCppComments(const BufStr &inBuf,BufStr &outBuf,const QCString &fileN
|
|||
commentcnvYY_state extra(inBuf,outBuf);
|
||||
commentcnvYYlex_init_extra(&extra,&yyscanner);
|
||||
#ifdef FLEX_DEBUG
|
||||
commentcnvYYset_debug(1,yyscanner);
|
||||
commentcnvYYset_debug(Debug::isFlagSet(Debug::Lex_commentcnv)?1:0,yyscanner);
|
||||
#endif
|
||||
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
|
||||
//printf("convertCppComments(%s)\n",fileName);
|
||||
|
|
|
|||
|
|
@ -62,6 +62,7 @@ typedef yyguts_t *yyscan_t;
|
|||
#include "util.h"
|
||||
#include "reflist.h"
|
||||
#include "trace.h"
|
||||
#include "debug.h"
|
||||
|
||||
#define USE_STATE2STRING 0
|
||||
|
||||
|
|
@ -3680,7 +3681,7 @@ CommentScanner::CommentScanner() : p(std::make_unique<Private>())
|
|||
{
|
||||
commentscanYYlex_init_extra(&p->extra,&p->yyscanner);
|
||||
#ifdef FLEX_DEBUG
|
||||
commentscanYYset_debug(1,p->yyscanner);
|
||||
commentscanYYset_debug(Debug::isFlagSet(Debug::Lex_commentscan)?1:0,p->yyscanner);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@
|
|||
#include "dir.h"
|
||||
#include "textstream.h"
|
||||
#include "dotattributes.h"
|
||||
#include "debug.h"
|
||||
|
||||
#define YY_NO_INPUT 1
|
||||
#define YY_NO_UNISTD_H 1
|
||||
|
|
@ -1568,6 +1569,9 @@ static QCString configFileToString(const QCString &name)
|
|||
|
||||
bool ConfigImpl::parseString(const QCString &fn,const QCString &str,bool update)
|
||||
{
|
||||
#ifdef FLEX_DEBUG
|
||||
configimplYYset_debug(Debug::isFlagSet(Debug::Lex_configimpl)?1:0);
|
||||
#endif
|
||||
g_config = ConfigImpl::instance();
|
||||
g_inputString = str.data();
|
||||
g_inputPosition = 0;
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@
|
|||
#include "cppvalue.h"
|
||||
#include "ce_parse.hpp" // generated header file
|
||||
#include "message.h"
|
||||
#include "debug.h"
|
||||
|
||||
#define YY_NO_INPUT 1
|
||||
#define YY_NO_UNISTD_H 1
|
||||
|
|
@ -144,7 +145,7 @@ bool ConstExpressionParser::parse(const char *fileName,int lineNr,const std::str
|
|||
struct yyguts_t *yyg = (struct yyguts_t*)p->yyscanner;
|
||||
|
||||
#ifdef FLEX_DEBUG
|
||||
constexpYYset_debug(1,p->yyscanner);
|
||||
constexpYYset_debug(Debug::isFlagSet(Debug::Lex_constexp)?1:0,p->yyscanner);
|
||||
#endif
|
||||
|
||||
yyextra->constExpFileName = fileName;
|
||||
|
|
|
|||
|
|
@ -28,22 +28,42 @@
|
|||
|
||||
static std::map< std::string, Debug::DebugMask > s_labels =
|
||||
{
|
||||
{ "preprocessor", Debug::Preprocessor },
|
||||
{ "nolineno", Debug::NoLineNo },
|
||||
{ "commentcnv", Debug::CommentCnv },
|
||||
{ "commentscan", Debug::CommentScan },
|
||||
{ "printtree", Debug::PrintTree },
|
||||
{ "time", Debug::Time },
|
||||
{ "extcmd", Debug::ExtCmd },
|
||||
{ "markdown", Debug::Markdown },
|
||||
{ "filteroutput", Debug::FilterOutput },
|
||||
{ "lex", Debug::Lex },
|
||||
{ "plantuml", Debug::Plantuml },
|
||||
{ "fortranfixed2free", Debug::FortranFixed2Free },
|
||||
{ "cite", Debug::Cite },
|
||||
{ "rtf", Debug::Rtf },
|
||||
{ "qhp", Debug::Qhp },
|
||||
{ "tag", Debug::Tag },
|
||||
{ "preprocessor", Debug::Preprocessor },
|
||||
{ "nolineno", Debug::NoLineNo },
|
||||
{ "commentcnv", Debug::CommentCnv },
|
||||
{ "commentscan", Debug::CommentScan },
|
||||
{ "printtree", Debug::PrintTree },
|
||||
{ "time", Debug::Time },
|
||||
{ "extcmd", Debug::ExtCmd },
|
||||
{ "markdown", Debug::Markdown },
|
||||
{ "filteroutput", Debug::FilterOutput },
|
||||
{ "plantuml", Debug::Plantuml },
|
||||
{ "fortranfixed2free", Debug::FortranFixed2Free },
|
||||
{ "cite", Debug::Cite },
|
||||
{ "rtf", Debug::Rtf },
|
||||
{ "qhp", Debug::Qhp },
|
||||
{ "tag", Debug::Tag },
|
||||
{ "lex", Debug::Lex },
|
||||
{ "lex:code", Debug::Lex_code },
|
||||
{ "lex:commentcnv", Debug::Lex_commentcnv },
|
||||
{ "lex:commentscan", Debug::Lex_commentscan },
|
||||
{ "lex:configimpl", Debug::Lex_configimpl },
|
||||
{ "lex:constexp", Debug::Lex_constexp },
|
||||
{ "lex:declinfo", Debug::Lex_declinfo },
|
||||
{ "lex:defargs", Debug::Lex_defargs },
|
||||
{ "lex:doctokenizer", Debug::Lex_doctokenizer },
|
||||
{ "lex:fortrancode", Debug::Lex_fortrancode },
|
||||
{ "lex:fortranscanner", Debug::Lex_fortranscanner },
|
||||
{ "lex:lexcode", Debug::Lex_lexcode },
|
||||
{ "lex:lexscanner", Debug::Lex_lexscanner },
|
||||
{ "lex:pre", Debug::Lex_pre },
|
||||
{ "lex:pycode", Debug::Lex_pycode },
|
||||
{ "lex:pyscanner", Debug::Lex_pyscanner },
|
||||
{ "lex:scanner", Debug::Lex_scanner },
|
||||
{ "lex:sqlcode", Debug::Lex_sqlcode },
|
||||
{ "lex:vhdlcode", Debug::Lex_vhdlcode },
|
||||
{ "lex:xml", Debug::Lex_xml },
|
||||
{ "lex:xmlcode", Debug::Lex_xmlcode },
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
|
|
@ -68,7 +88,7 @@ static char asciiToLower(char in) {
|
|||
return in;
|
||||
}
|
||||
|
||||
static int labelToEnumValue(const QCString &l)
|
||||
static uint64_t labelToEnumValue(const QCString &l)
|
||||
{
|
||||
std::string s = l.str();
|
||||
std::transform(s.begin(),s.end(),s.begin(),asciiToLower);
|
||||
|
|
@ -76,9 +96,9 @@ static int labelToEnumValue(const QCString &l)
|
|||
return (it!=s_labels.end()) ? it->second : 0;
|
||||
}
|
||||
|
||||
int Debug::setFlagStr(const QCString &lab)
|
||||
uint64_t Debug::setFlagStr(const QCString &lab)
|
||||
{
|
||||
int retVal = labelToEnumValue(lab);
|
||||
uint64_t retVal = labelToEnumValue(lab);
|
||||
curMask = static_cast<DebugMask>(curMask | retVal);
|
||||
return retVal;
|
||||
}
|
||||
|
|
|
|||
59
src/debug.h
59
src/debug.h
|
|
@ -16,33 +16,56 @@
|
|||
#ifndef DEBUG_H
|
||||
#define DEBUG_H
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
class QCString;
|
||||
|
||||
/** Class containing a print function for diagnostics. */
|
||||
class Debug
|
||||
{
|
||||
public:
|
||||
enum DebugMask { Quiet = 0x00000000,
|
||||
Preprocessor = 0x00000008,
|
||||
CommentCnv = 0x00000020,
|
||||
CommentScan = 0x00000040,
|
||||
PrintTree = 0x00000100,
|
||||
Time = 0x00000200,
|
||||
ExtCmd = 0x00000400,
|
||||
Markdown = 0x00000800,
|
||||
FilterOutput = 0x00001000,
|
||||
Lex = 0x00002000,
|
||||
Plantuml = 0x00004000,
|
||||
FortranFixed2Free = 0x00008000,
|
||||
Cite = 0x00010000,
|
||||
NoLineNo = 0x00020000,
|
||||
Rtf = 0x00040000,
|
||||
Qhp = 0x00080000,
|
||||
Tag = 0x00100000,
|
||||
enum DebugMask : uint64_t {
|
||||
Quiet = 0x0000,
|
||||
Preprocessor = 0x0001,
|
||||
CommentCnv = 0x0002,
|
||||
CommentScan = 0x0004,
|
||||
PrintTree = 0x0010,
|
||||
Time = 0x0020,
|
||||
ExtCmd = 0x0040,
|
||||
Markdown = 0x0080,
|
||||
FilterOutput = 0x0100,
|
||||
Plantuml = 0x0200,
|
||||
FortranFixed2Free = 0x0400,
|
||||
Cite = 0x0800,
|
||||
NoLineNo = 0x1000,
|
||||
Rtf = 0x2000,
|
||||
Qhp = 0x4000,
|
||||
Tag = 0x8000,
|
||||
Lex = 0xFFFFFF0000ULL, // all scanners combined
|
||||
Lex_code = 0x0000010000ULL,
|
||||
Lex_commentcnv = 0x0000020000ULL,
|
||||
Lex_commentscan = 0x0000040000ULL,
|
||||
Lex_configimpl = 0x0000080000ULL,
|
||||
Lex_constexp = 0x0000100000ULL,
|
||||
Lex_declinfo = 0x0000200000ULL,
|
||||
Lex_defargs = 0x0000400000ULL,
|
||||
Lex_doctokenizer = 0x0000800000ULL,
|
||||
Lex_fortrancode = 0x0001000000ULL,
|
||||
Lex_fortranscanner= 0x0002000000ULL,
|
||||
Lex_lexcode = 0x0004000000ULL,
|
||||
Lex_lexscanner = 0x0008000000ULL,
|
||||
Lex_pre = 0x0010000000ULL,
|
||||
Lex_pycode = 0x0020000000ULL,
|
||||
Lex_pyscanner = 0x0040000000ULL,
|
||||
Lex_scanner = 0x0080000000ULL,
|
||||
Lex_sqlcode = 0x0100000000ULL,
|
||||
Lex_vhdlcode = 0x0200000000ULL,
|
||||
Lex_xml = 0x0400000000ULL,
|
||||
Lex_xmlcode = 0x0800000000ULL
|
||||
};
|
||||
static void print(DebugMask mask,int prio,const char *fmt,...);
|
||||
|
||||
static int setFlagStr(const QCString &label);
|
||||
static uint64_t setFlagStr(const QCString &label);
|
||||
static void setFlag(const DebugMask mask);
|
||||
static void clearFlag(const DebugMask mask);
|
||||
static bool isFlagSet(DebugMask mask);
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@ typedef yyguts_t *yyscan_t;
|
|||
#include "util.h"
|
||||
#include "message.h"
|
||||
#include "types.h"
|
||||
#include "debug.h"
|
||||
|
||||
#define YY_NO_INPUT 1
|
||||
#define YY_NO_UNISTD_H 1
|
||||
|
|
@ -323,7 +324,7 @@ void parseFuncDecl(const QCString &decl,const SrcLangExt lang,QCString &cl,QCStr
|
|||
struct yyguts_t *yyg = (struct yyguts_t*)g_yyscanner;
|
||||
|
||||
#ifdef FLEX_DEBUG
|
||||
declinfoYYset_debug(1,g_yyscanner);
|
||||
declinfoYYset_debug(Debug::isFlagSet(Debug::Lex_declinfo)?1:0,g_yyscanner);
|
||||
#endif
|
||||
|
||||
printlex(yy_flex_debug, TRUE, __FILE__, NULL);
|
||||
|
|
|
|||
|
|
@ -66,6 +66,7 @@ typedef yyguts_t *yyscan_t;
|
|||
#include "util.h"
|
||||
#include "arguments.h"
|
||||
#include "message.h"
|
||||
#include "debug.h"
|
||||
|
||||
#define YY_NO_INPUT 1
|
||||
#define YY_NO_UNISTD_H 1
|
||||
|
|
@ -820,7 +821,7 @@ std::unique_ptr<ArgumentList> stringToArgumentList(SrcLangExt lang, const QCStri
|
|||
defargsYY_state extra(argsString.data(),al,lang);
|
||||
defargsYYlex_init_extra(&extra,&yyscanner);
|
||||
#ifdef FLEX_DEBUG
|
||||
defargsYYset_debug(1,yyscanner);
|
||||
defargsYYset_debug(Debug::isFlagSet(Debug::Lex_defargs)?1:0,yyscanner);
|
||||
#endif
|
||||
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
|
||||
printlex(yy_flex_debug, TRUE, __FILE__, NULL);
|
||||
|
|
|
|||
|
|
@ -46,6 +46,7 @@ typedef yyguts_t *yyscan_t;
|
|||
#include "portable.h"
|
||||
#include "cite.h"
|
||||
#include "regex.h"
|
||||
#include "debug.h"
|
||||
|
||||
#define YY_NO_INPUT 1
|
||||
#define YY_NO_UNISTD_H 1
|
||||
|
|
@ -1717,7 +1718,7 @@ DocTokenizer::DocTokenizer() : p(std::make_unique<Private>())
|
|||
//printf("%p:DocTokenizer::DocTokenizer()\n",(void*)this);
|
||||
doctokenizerYYlex_init_extra(&p->extra,&p->yyscanner);
|
||||
#ifdef FLEX_DEBUG
|
||||
doctokenizerYYset_debug(1,p->yyscanner);
|
||||
doctokenizerYYset_debug(Debug::isFlagSet(Debug::Lex_doctokenizer)?1:0,p->yyscanner);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -10513,6 +10513,9 @@ static void devUsage()
|
|||
msg("Developer parameters:\n");
|
||||
msg(" -m dump symbol map\n");
|
||||
msg(" -b making messages output unbuffered\n");
|
||||
#if ENABLE_TRACING
|
||||
msg(" -t [<file>] trace debug info to file (default file trace.txt)\n");
|
||||
#endif
|
||||
msg(" -T activates output generation via Django like template\n");
|
||||
msg(" -d <level> enable a debug level, such as (multiple invocations of -d are possible):\n");
|
||||
Debug::printFlags();
|
||||
|
|
|
|||
|
|
@ -62,6 +62,7 @@ typedef yyguts_t *yyscan_t;
|
|||
#include "fortrancode.h"
|
||||
#include "fortranscanner.h"
|
||||
#include "containers.h"
|
||||
#include "debug.h"
|
||||
|
||||
// Toggle for some debugging info
|
||||
//#define DBG_CTX(x) fprintf x
|
||||
|
|
@ -1417,7 +1418,7 @@ FortranCodeParser::FortranCodeParser(FortranFormat format) : p(std::make_unique<
|
|||
p->format = format;
|
||||
fortrancodeYYlex_init_extra(&p->state,&p->yyscanner);
|
||||
#ifdef FLEX_DEBUG
|
||||
fortrancodeYYset_debug(1,p->yyscanner);
|
||||
fortrancodeYYset_debug(Debug::isFlagSet(Debug::Lex_fortrancode)?1:0,p->yyscanner);
|
||||
#endif
|
||||
resetCodeParserState();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2894,7 +2894,7 @@ struct FortranOutlineParser::Private
|
|||
{
|
||||
fortranscannerYYlex_init_extra(&extra,&yyscanner);
|
||||
#ifdef FLEX_DEBUG
|
||||
fortranscannerYYset_debug(1,yyscanner);
|
||||
fortranscannerYYset_debug(Debug::isFlagSet(Debug::Lex_fortranscanner)?1:0,yyscanner);
|
||||
#endif
|
||||
}
|
||||
~Private()
|
||||
|
|
|
|||
|
|
@ -1572,7 +1572,7 @@ void LayoutDocManager::init()
|
|||
XMLParser parser(handlers);
|
||||
layoutParser.setDocumentLocator(&parser);
|
||||
QCString layout_default = ResourceMgr::instance().getAsString("layout_default.xml");
|
||||
parser.parse("layout_default.xml",layout_default.data(),Debug::isFlagSet(Debug::Lex));
|
||||
parser.parse("layout_default.xml",layout_default.data(),Debug::isFlagSet(Debug::Lex_xml));
|
||||
}
|
||||
|
||||
LayoutDocManager::~LayoutDocManager()
|
||||
|
|
@ -1615,7 +1615,7 @@ void LayoutDocManager::parse(const QCString &fileName)
|
|||
handlers.error = [&layoutParser](const std::string &fn,int lineNr,const std::string &msg) { layoutParser.error(fn,lineNr,msg); };
|
||||
XMLParser parser(handlers);
|
||||
layoutParser.setDocumentLocator(&parser);
|
||||
parser.parse(fileName.data(),fileToString(fileName).data(),Debug::isFlagSet(Debug::Lex));
|
||||
parser.parse(fileName.data(),fileToString(fileName).data(),Debug::isFlagSet(Debug::Lex_xml));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ typedef yyguts_t *yyscan_t;
|
|||
#include "lexcode.h"
|
||||
#include "filedef.h"
|
||||
#include "message.h"
|
||||
#include "debug.h"
|
||||
|
||||
#define YY_NEVER_INTERACTIVE 1
|
||||
#define YY_NO_INPUT 1
|
||||
|
|
@ -1177,7 +1178,7 @@ LexCodeParser::LexCodeParser() : p(std::make_unique<Private>())
|
|||
{
|
||||
lexcodeYYlex_init_extra(&p->state, &p->yyscanner);
|
||||
#ifdef FLEX_DEBUG
|
||||
lexcodeYYset_debug(1,p->yyscanner);
|
||||
lexcodeYYset_debug(Debug::isFlagSet(Debug::Lex_lexcode)?1:0,p->yyscanner);
|
||||
#endif
|
||||
resetCodeParserState();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@ typedef yyguts_t *yyscan_t;
|
|||
#include "message.h"
|
||||
#include "util.h"
|
||||
#include "scanner.h"
|
||||
#include "debug.h"
|
||||
|
||||
#define YY_NO_INPUT 1
|
||||
#define YY_NO_UNISTD_H 1
|
||||
|
|
@ -1007,7 +1008,7 @@ LexOutlineParser::LexOutlineParser() : p(std::make_unique<LexOutlineParser::Priv
|
|||
{
|
||||
lexscannerYYlex_init_extra(&p->state,&p->yyscanner);
|
||||
#ifdef FLEX_DEBUG
|
||||
lexscannerYYset_debug(1,p->yyscanner);
|
||||
lexscannerYYset_debug(Debug::isFlagSet(Debug::Lex_lexscanner)?1:0,p->yyscanner);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -65,6 +65,7 @@ typedef yyguts_t *yyscan_t;
|
|||
#include "regex.h"
|
||||
#include "fileinfo.h"
|
||||
#include "trace.h"
|
||||
#include "debug.h"
|
||||
|
||||
#define YY_NO_UNISTD_H 1
|
||||
|
||||
|
|
@ -3668,7 +3669,7 @@ void Preprocessor::processFile(const QCString &fileName,BufStr &input,BufStr &ou
|
|||
struct yyguts_t *yyg = (struct yyguts_t*)p->yyscanner;
|
||||
|
||||
#ifdef FLEX_DEBUG
|
||||
preYYset_debug(1,yyscanner);
|
||||
preYYset_debug(Debug::isFlagSet(Debug::Lex_pre)?1:0,yyscanner);
|
||||
#endif
|
||||
|
||||
printlex(yy_flex_debug, TRUE, __FILE__, qPrint(fileName));
|
||||
|
|
|
|||
|
|
@ -58,6 +58,7 @@ typedef yyguts_t *yyscan_t;
|
|||
#include "tooltip.h"
|
||||
#include "scopedtypevariant.h"
|
||||
#include "symbolresolver.h"
|
||||
#include "debug.h"
|
||||
|
||||
// Toggle for some debugging info
|
||||
//#define DBG_CTX(x) fprintf x
|
||||
|
|
@ -1545,7 +1546,7 @@ PythonCodeParser::PythonCodeParser() : p(std::make_unique<Private>())
|
|||
{
|
||||
pycodeYYlex_init_extra(&p->state,&p->yyscanner);
|
||||
#ifdef FLEX_DEBUG
|
||||
pycodeYYset_debug(1,p->yyscanner);
|
||||
pycodeYYset_debug(Debug::isFlagSet(Debug::Lex_pycode)?1:0,p->yyscanner);
|
||||
#endif
|
||||
resetCodeParserState();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,6 +53,7 @@ typedef yyguts_t *yyscan_t;
|
|||
#include "arguments.h"
|
||||
#include "markdown.h"
|
||||
#include "fileinfo.h"
|
||||
#include "debug.h"
|
||||
|
||||
// Toggle for some debugging info
|
||||
//#define DBG_CTX(x) fprintf x
|
||||
|
|
@ -2020,7 +2021,7 @@ PythonOutlineParser::PythonOutlineParser() : p(std::make_unique<PythonOutlinePar
|
|||
{
|
||||
pyscannerYYlex_init_extra(&p->state,&p->yyscanner);
|
||||
#ifdef FLEX_DEBUG
|
||||
pyscannerYYset_debug(1,p->yyscanner);
|
||||
pyscannerYYset_debug(Debug::isFlagSet(Debug::Lex_pyscanner)?1:0,p->yyscanner);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -55,6 +55,7 @@ typedef yyguts_t *yyscan_t;
|
|||
#include "markdown.h"
|
||||
#include "regex.h"
|
||||
#include "trace.h"
|
||||
#include "debug.h"
|
||||
|
||||
#define YY_NO_INPUT 1
|
||||
#define YY_NO_UNISTD_H 1
|
||||
|
|
@ -7923,7 +7924,7 @@ COutlineParser::COutlineParser() : p(std::make_unique<COutlineParser::Private>()
|
|||
{
|
||||
scannerYYlex_init_extra(&p->state,&p->yyscanner);
|
||||
#ifdef FLEX_DEBUG
|
||||
scannerYYset_debug(1,p->yyscanner);
|
||||
scannerYYset_debug(Debug::isFlagSet(Debug::Lex_scanner)?1:0,p->yyscanner);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@ typedef yyguts_t *yyscan_t;
|
|||
#include "filedef.h"
|
||||
#include "tooltip.h"
|
||||
#include "message.h"
|
||||
#include "debug.h"
|
||||
|
||||
#define YY_NEVER_INTERACTIVE 1
|
||||
#define YY_NO_INPUT 1
|
||||
|
|
@ -394,7 +395,7 @@ SQLCodeParser::SQLCodeParser() : p(std::make_unique<Private>())
|
|||
{
|
||||
sqlcodeYYlex_init_extra(&p->state, &p->yyscanner);
|
||||
#ifdef FLEX_DEBUG
|
||||
sqlcodeYYset_debug(1,p->yyscanner);
|
||||
sqlcodeYYset_debug(Debug::isFlagSet(Debug::Lex_sqlcode)?1:0,p->yyscanner);
|
||||
#endif
|
||||
resetCodeParserState();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1699,7 +1699,7 @@ void parseTagFile(const std::shared_ptr<Entry> &root,const char *fullName)
|
|||
handlers.error = [&tagFileParser](const std::string &fileName,int lineNr,const std::string &msg) { tagFileParser.error(QCString(fileName),lineNr,QCString(msg)); };
|
||||
XMLParser parser(handlers);
|
||||
tagFileParser.setDocumentLocator(&parser);
|
||||
parser.parse(fullName,inputStr.data(),Debug::isFlagSet(Debug::Lex));
|
||||
parser.parse(fullName,inputStr.data(),Debug::isFlagSet(Debug::Lex_xml));
|
||||
tagFileParser.buildLists(root);
|
||||
tagFileParser.addIncludes();
|
||||
if (Debug::isFlagSet(Debug::Tag))
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ namespace Trace
|
|||
size_t i=0;
|
||||
for (; i<numChars && i<s.length(); i++)
|
||||
{
|
||||
char c=s[i];
|
||||
char c=s.at(i);
|
||||
if (c=='\n') { result+="\\n"; }
|
||||
else if (c=='\t') { result+="\\t"; }
|
||||
else if (c=='\r') { result+="\\r"; }
|
||||
|
|
|
|||
|
|
@ -57,6 +57,7 @@ typedef yyguts_t *yyscan_t;
|
|||
#include "filedef.h"
|
||||
#include "tooltip.h"
|
||||
#include "regex.h"
|
||||
#include "debug.h"
|
||||
|
||||
#define YY_NO_INPUT 1
|
||||
#define YY_NO_UNISTD_H 1
|
||||
|
|
@ -1566,7 +1567,7 @@ VHDLCodeParser::VHDLCodeParser() : p(std::make_unique<Private>())
|
|||
{
|
||||
vhdlcodeYYlex_init_extra(&p->state,&p->yyscanner);
|
||||
#ifdef FLEX_DEBUG
|
||||
vhdlcodeYYset_debug(1,p->yyscanner);
|
||||
vhdlcodeYYset_debug(Debug::isFlagSet(Debug::Lex_vhdlcode)?1:0,p->yyscanner);
|
||||
#endif
|
||||
resetCodeParserState();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@ typedef yyguts_t *yyscan_t;
|
|||
#include "filedef.h"
|
||||
#include "tooltip.h"
|
||||
#include "message.h"
|
||||
#include "debug.h"
|
||||
|
||||
#define YY_NEVER_INTERACTIVE 1
|
||||
#define YY_NO_INPUT 1
|
||||
|
|
@ -395,7 +396,7 @@ XMLCodeParser::XMLCodeParser() : p(std::make_unique<Private>())
|
|||
{
|
||||
xmlcodeYYlex_init_extra(&p->state,&p->yyscanner);
|
||||
#ifdef FLEX_DEBUG
|
||||
xmlcodeYYset_debug(1,p->yyscanner);
|
||||
xmlcodeYYset_debug(Debug::isFlagSet(Debug::Lex_xmlcode)?1:0,p->yyscanner);
|
||||
#endif
|
||||
resetCodeParserState();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue