4303{
4306 YY_EXTRA_TYPE state = preYYget_extra(
p->yyscanner);
4307 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
4308
4309#ifdef FLEX_DEBUG
4311#endif
4312
4314
4315
4316
4319 state->skip=false;
4320 state->curlyCount=0;
4321 state->lexRulesPart=false;
4322 state->nospaces=false;
4323 state->inputBuf=&input;
4324 state->inputBufPos=0;
4325 state->outputBuf=&output;
4326 state->includeStack.clear();
4327 state->expandedDict.clear();
4328 state->contextDefines.clear();
4329 state->pragmaSet.clear();
4330 state->condGuardCount=0;
4331 state->condGuardErrorLine=0;
4332 while (!state->levelGuard.empty()) state->levelGuard.pop();
4333 while (!state->condStack.empty()) state->condStack.pop();
4334
4336
4337 state->inputFileDef = state->yyFileDef;
4338
4339
4341
4342 state->yyLineNr = 1;
4343 state->yyColNr = 1;
4344 state->ifcount = 0;
4345
4346 BEGIN( Start );
4347
4349 state->guardName.clear();
4350 state->lastGuardName.clear();
4351 state->guardExpr.clear();
4352
4353 preYYlex(yyscanner);
4354
4355 while (!state->condStack.empty())
4356 {
4357 const std::unique_ptr<preYY_CondCtx> &ctx = state->condStack.top();
4358 DString sectionInfo = " ";
4359 if (ctx->sectionId!=
" ") sectionInfo.
sprintf(
" with label '%s' ",
qPrint(ctx->sectionId.stripWhiteSpace()));
4360 warn(ctx->fileName,ctx->lineNr,
"Conditional section{}does not have "
4361 "a corresponding \\endcond command within this file.",sectionInfo);
4362 state->condStack.pop();
4363 }
4364
4366
4367 if (!state->levelGuard.empty())
4368 {
4369 if (yyextra->condGuardErrorLine!=0)
4370 {
4371 warn(yyextra->condGuardErrorFileName,yyextra->condGuardErrorLine,
"{}",yyextra->condGuardErrorMessage);
4372 }
4373 else
4374 {
4375 warn(state->fileName,state->yyLineNr,
"More #if's than #endif's found (might be in an included file).");
4376 }
4377 }
4378
4380 {
4383 std::string contents;
4385 {
4386 contents=output;
4387 }
4388 else
4389 {
4390 int line=1;
4391 bool startOfLine = true;
4392 size_t content_size = output.size() +
4393 output.size()*6/40;
4394
4395 contents.reserve(content_size);
4396 size_t pos=0;
4397 while (pos<output.size())
4398 {
4399 if (startOfLine)
4400 {
4401 char lineNrStr[15];
4402 snprintf(lineNrStr,15,"%05d ",line++);
4403 contents+=lineNrStr;
4404 }
4405 contents += output[pos];
4406 startOfLine = output[pos]=='\n';
4407 pos++;
4408 }
4409 }
4411 if (!contents.empty() && contents[contents.length()-1]!='\n')
4412 {
4414 }
4416 if (yyextra->contextDefines.size()>0)
4417 {
4420 for (auto &kv : yyextra->contextDefines)
4421 {
4423 }
4424 for (auto &kv : yyextra->localDefines)
4425 {
4427 }
4429 }
4430 else
4431 {
4433 }
4434 }
4435
4436 {
4438 for (const auto &inc : state->includeRelations)
4439 {
4440 auto toKind = [](
bool local,
bool imported) ->
IncludeKind
4441 {
4442 if (local)
4443 {
4444 if (imported)
4445 {
4447 }
4449 }
4450 else if (imported)
4451 {
4453 }
4455 };
4456 if (inc->fromFileDef)
4457 {
4458 inc->fromFileDef->addIncludeDependency(inc->toFileDef,inc->includeName,toKind(inc->local,inc->imported));
4459 }
4460 if (inc->toFileDef && inc->fromFileDef)
4461 {
4462 inc->toFileDef->addIncludedByDependency(inc->fromFileDef,inc->fromFileDef->docName(),toKind(inc->local,inc->imported));
4463 }
4464 }
4465
4467 }
4468
4469
4470}
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