Skip to content

Commit

Permalink
Refactoring: making xmlcode.l reentrant
Browse files Browse the repository at this point in the history
  • Loading branch information
doxygen committed Sep 14, 2020
1 parent 5162dab commit 0fc06d6
Show file tree
Hide file tree
Showing 3 changed files with 331 additions and 295 deletions.
5 changes: 2 additions & 3 deletions src/sqlcode.l
Original file line number Diff line number Diff line change
Expand Up @@ -395,9 +395,6 @@ void SQLCodeParser::resetCodeParserState()
yyextra->currentMemberDef = 0;
}


//---------------------------------------------------------------------------------

void SQLCodeParser::parseCode(CodeOutputInterface &codeOutIntf,
const char *scopeName,
const QCString &input,
Expand All @@ -417,6 +414,8 @@ void SQLCodeParser::parseCode(CodeOutputInterface &codeOutIntf,
yyscan_t yyscanner = p->yyscanner;
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;

if (input.isEmpty()) return;

printlex(yy_flex_debug, true, __FILE__, fileDef ? fileDef->fileName().data(): NULL);

yyextra->code = &codeOutIntf;
Expand Down
13 changes: 8 additions & 5 deletions src/xmlcode.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
/******************************************************************************
*
*
*
* Copyright (C) 1997-2014 by Dimitri van Heesch.
* Copyright (C) 1997-2020 by Dimitri van Heesch.
*
* Permission to use, copy, modify, and distribute this software and its
* documentation under the terms of the GNU General Public License is hereby
* granted. No representations are made about the suitability of this software
* documentation under the terms of the GNU General Public License is hereby
* granted. No representations are made about the suitability of this software
* for any purpose. It is provided "as is" without express or implied warranty.
* See the GNU General Public License for more details.
*
Expand All @@ -32,6 +30,8 @@ class Definition;
class XMLCodeParser : public CodeParserInterface
{
public:
XMLCodeParser();
virtual ~XMLCodeParser();
void parseCode(CodeOutputInterface &codeOutIntf,
const char *scopeName,
const QCString &input,
Expand All @@ -48,6 +48,9 @@ class XMLCodeParser : public CodeParserInterface
bool collectXRefs=TRUE
);
void resetCodeParserState();
private:
struct Private;
std::unique_ptr<Private> p;
};


Expand Down
Loading

0 comments on commit 0fc06d6

Please sign in to comment.