4411{
4414 YY_EXTRA_TYPE state = preYYget_extra(
p->yyscanner);
4416
4417#ifdef FLEX_DEBUG
4419#endif
4420
4422
4423
4424
4427 state->skip=false;
4428 state->curlyCount=0;
4429 state->lexRulesPart=false;
4430 state->nospaces=false;
4431 state->inputBuf=&input;
4432 state->inputBufPos=0;
4433 state->outputBuf=&output;
4434 state->includeStack.clear();
4435 state->expandedDict.clear();
4436 state->contextDefines.clear();
4437 state->pragmaSet.clear();
4438 state->condGuardCount=0;
4439 state->condGuardErrorLine=0;
4440 while (!state->levelGuard.empty()) state->levelGuard.pop();
4441 while (!state->condStack.empty()) state->condStack.pop();
4442
4444
4445 state->inputFileDef = state->yyFileDef;
4446
4447
4449
4450 state->yyLineNr = 1;
4451 state->yyColNr = 1;
4452 state->ifcount = 0;
4453
4454 BEGIN( Start );
4455
4457 state->guardName.clear();
4458 state->lastGuardName.clear();
4459 state->guardExpr.clear();
4460
4461 preYYlex(yyscanner);
4462
4463 while (!state->condStack.empty())
4464 {
4465 const std::unique_ptr<preYY_CondCtx> &ctx = state->condStack.top();
4466 DString sectionInfo = " ";
4467 if (ctx->sectionId!=
" ") sectionInfo.
sprintf(
" with label '%s' ",
qPrint(ctx->sectionId.stripWhiteSpace()));
4468 warn(ctx->fileName,ctx->lineNr,
"Conditional section{}does not have "
4469 "a corresponding \\endcond command within this file.",sectionInfo);
4470 state->condStack.pop();
4471 }
4472
4474
4475 if (!state->levelGuard.empty())
4476 {
4477 if (yyextra->condGuardErrorLine!=0)
4478 {
4479 warn(yyextra->condGuardErrorFileName,yyextra->condGuardErrorLine,
"{}",yyextra->condGuardErrorMessage);
4480 }
4481 else
4482 {
4483 warn(state->fileName,state->yyLineNr,
"More #if's than #endif's found (might be in an included file).");
4484 }
4485 }
4486
4488 {
4491 std::string contents;
4493 {
4494 contents=output;
4495 }
4496 else
4497 {
4498 int line=1;
4499 bool startOfLine = true;
4500 size_t content_size = output.size() +
4501 output.size()*6/40;
4502
4503 contents.reserve(content_size);
4504 size_t pos=0;
4505 while (pos<output.size())
4506 {
4507 if (startOfLine)
4508 {
4509 char lineNrStr[15];
4510 snprintf(lineNrStr,15,"%05d ",line++);
4511 contents+=lineNrStr;
4512 }
4513 contents += output[pos];
4514 startOfLine = output[pos]=='\n';
4515 pos++;
4516 }
4517 }
4519 if (!contents.empty() && contents[contents.length()-1]!='\n')
4520 {
4522 }
4524 if (yyextra->contextDefines.size()>0)
4525 {
4528 for (auto &kv : yyextra->contextDefines)
4529 {
4531 }
4532 for (auto &kv : yyextra->localDefines)
4533 {
4535 }
4537 }
4538 else
4539 {
4541 }
4542 }
4543
4544 {
4546 for (const auto &inc : state->includeRelations)
4547 {
4548 auto toKind = [](
bool local,
bool imported) ->
IncludeKind
4549 {
4550 if (local)
4551 {
4552 if (imported)
4553 {
4555 }
4557 }
4558 else if (imported)
4559 {
4561 }
4563 };
4564 if (inc->fromFileDef)
4565 {
4566 inc->fromFileDef->addIncludeDependency(inc->toFileDef,inc->includeName,toKind(inc->local,inc->imported));
4567 }
4568 if (inc->toFileDef && inc->fromFileDef)
4569 {
4570 inc->toFileDef->addIncludedByDependency(inc->fromFileDef,inc->fromFileDef->docName(),toKind(inc->local,inc->imported));
4571 }
4572 }
4573
4575 }
4576
4577
4578}
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