4410{
4413 YY_EXTRA_TYPE state = preYYget_extra(
p->yyscanner);
4414 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
4415
4416#ifdef FLEX_DEBUG
4418#endif
4419
4421
4422
4423
4426 state->skip=false;
4427 state->curlyCount=0;
4428 state->lexRulesPart=false;
4429 state->nospaces=false;
4430 state->inputBuf=&input;
4431 state->inputBufPos=0;
4432 state->outputBuf=&output;
4433 state->includeStack.clear();
4434 state->expandedDict.clear();
4435 state->contextDefines.clear();
4436 state->pragmaSet.clear();
4437 state->condGuardCount=0;
4438 state->condGuardErrorLine=0;
4439 while (!state->levelGuard.empty()) state->levelGuard.pop();
4440 while (!state->condStack.empty()) state->condStack.pop();
4441
4443
4444 state->inputFileDef = state->yyFileDef;
4445
4446
4448
4449 state->yyLineNr = 1;
4450 state->yyColNr = 1;
4451 state->ifcount = 0;
4452
4453 BEGIN( Start );
4454
4456 state->guardName.clear();
4457 state->lastGuardName.clear();
4458 state->guardExpr.clear();
4459
4460 preYYlex(yyscanner);
4461
4462 while (!state->condStack.empty())
4463 {
4464 const std::unique_ptr<preYY_CondCtx> &ctx = state->condStack.top();
4465 DString sectionInfo = " ";
4466 if (ctx->sectionId!=
" ") sectionInfo.
sprintf(
" with label '%s' ",
qPrint(ctx->sectionId.stripWhiteSpace()));
4467 warn(ctx->fileName,ctx->lineNr,
"Conditional section{}does not have "
4468 "a corresponding \\endcond command within this file.",sectionInfo);
4469 state->condStack.pop();
4470 }
4471
4473
4474 if (!state->levelGuard.empty())
4475 {
4476 if (yyextra->condGuardErrorLine!=0)
4477 {
4478 warn(yyextra->condGuardErrorFileName,yyextra->condGuardErrorLine,
"{}",yyextra->condGuardErrorMessage);
4479 }
4480 else
4481 {
4482 warn(state->fileName,state->yyLineNr,
"More #if's than #endif's found (might be in an included file).");
4483 }
4484 }
4485
4487 {
4490 std::string contents;
4492 {
4493 contents=output;
4494 }
4495 else
4496 {
4497 int line=1;
4498 bool startOfLine = true;
4499 size_t content_size = output.size() +
4500 output.size()*6/40;
4501
4502 contents.reserve(content_size);
4503 size_t pos=0;
4504 while (pos<output.size())
4505 {
4506 if (startOfLine)
4507 {
4508 char lineNrStr[15];
4509 snprintf(lineNrStr,15,"%05d ",line++);
4510 contents+=lineNrStr;
4511 }
4512 contents += output[pos];
4513 startOfLine = output[pos]=='\n';
4514 pos++;
4515 }
4516 }
4518 if (!contents.empty() && contents[contents.length()-1]!='\n')
4519 {
4521 }
4523 if (yyextra->contextDefines.size()>0)
4524 {
4527 for (auto &kv : yyextra->contextDefines)
4528 {
4530 }
4531 for (auto &kv : yyextra->localDefines)
4532 {
4534 }
4536 }
4537 else
4538 {
4540 }
4541 }
4542
4543 {
4545 for (const auto &inc : state->includeRelations)
4546 {
4547 auto toKind = [](
bool local,
bool imported) ->
IncludeKind
4548 {
4549 if (local)
4550 {
4551 if (imported)
4552 {
4554 }
4556 }
4557 else if (imported)
4558 {
4560 }
4562 };
4563 if (inc->fromFileDef)
4564 {
4565 inc->fromFileDef->addIncludeDependency(inc->toFileDef,inc->includeName,toKind(inc->local,inc->imported));
4566 }
4567 if (inc->toFileDef && inc->fromFileDef)
4568 {
4569 inc->toFileDef->addIncludedByDependency(inc->fromFileDef,inc->fromFileDef->docName(),toKind(inc->local,inc->imported));
4570 }
4571 }
4572
4574 }
4575
4576
4577}
DString & sprintf(const char *format,...)
static bool isFlagSet(const DebugMask mask)
static void print(DebugMask mask, int prio, fmt::format_string< Args... > fmt, Args &&... args)
static DefinesPerFileList macroDefinitions
static EntryType guessSection(const DString &name)
#define Config_getBool(name)
DirIterator end(const DirIterator &) noexcept
const char * qPrint(const char *s)
#define warn(file, line, fmt,...)
static void setFileName(yyscan_t yyscanner, const DString &name)
static void forceEndCondSection(yyscan_t yyscanner)
static std::mutex g_updateGlobals
static void initPredefined(yyscan_t yyscanner, const DString &fileName)
static std::mutex g_debugMutex