4277{
4280 YY_EXTRA_TYPE state = preYYget_extra(
p->yyscanner);
4281 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
4282
4283#ifdef FLEX_DEBUG
4285#endif
4286
4288
4289
4290
4293 state->skip=false;
4294 state->curlyCount=0;
4295 state->lexRulesPart=false;
4296 state->nospaces=false;
4297 state->inputBuf=&input;
4298 state->inputBufPos=0;
4299 state->outputBuf=&output;
4300 state->includeStack.clear();
4301 state->expandedDict.clear();
4302 state->contextDefines.clear();
4303 state->pragmaSet.clear();
4304 state->condGuardCount=0;
4305 state->condGuardErrorLine=0;
4306 while (!state->levelGuard.empty()) state->levelGuard.pop();
4307 while (!state->condStack.empty()) state->condStack.pop();
4308
4310
4311 state->inputFileDef = state->yyFileDef;
4312
4313
4315
4316 state->yyLineNr = 1;
4317 state->yyColNr = 1;
4318 state->ifcount = 0;
4319
4320 BEGIN( Start );
4321
4322 state->expectGuard =
guessSection(fileName).isHeader();
4323 state->guardName.clear();
4324 state->lastGuardName.clear();
4325 state->guardExpr.clear();
4326
4327 preYYlex(yyscanner);
4328
4329 while (!state->condStack.empty())
4330 {
4331 const std::unique_ptr<preYY_CondCtx> &ctx = state->condStack.top();
4332 QCString sectionInfo = " ";
4333 if (ctx->sectionId!=
" ") sectionInfo.
sprintf(
" with label '%s' ",
qPrint(ctx->sectionId.stripWhiteSpace()));
4334 warn(ctx->fileName,ctx->lineNr,
"Conditional section{}does not have "
4335 "a corresponding \\endcond command within this file.",sectionInfo);
4336 state->condStack.pop();
4337 }
4338
4340
4341 if (!state->levelGuard.empty())
4342 {
4343 if (yyextra->condGuardErrorLine!=0)
4344 {
4345 warn(yyextra->condGuardErrorFileName,yyextra->condGuardErrorLine,
"{}",yyextra->condGuardErrorMessage);
4346 }
4347 else
4348 {
4349 warn(state->fileName,state->yyLineNr,
"More #if's than #endif's found (might be in an included file).");
4350 }
4351 }
4352
4354 {
4357 std::string contents;
4359 {
4360 contents=output;
4361 }
4362 else
4363 {
4364 int line=1;
4365 bool startOfLine = true;
4366 size_t content_size = output.size() +
4367 output.size()*6/40;
4368
4369 contents.reserve(content_size);
4370 size_t pos=0;
4371 while (pos<output.size())
4372 {
4373 if (startOfLine)
4374 {
4375 char lineNrStr[15];
4376 snprintf(lineNrStr,15,"%05d ",line++);
4377 contents+=lineNrStr;
4378 }
4379 contents += output[pos];
4380 startOfLine = output[pos]=='\n';
4381 pos++;
4382 }
4383 }
4385 if (!contents.empty() && contents[contents.length()-1]!='\n')
4386 {
4388 }
4390 if (yyextra->contextDefines.size()>0)
4391 {
4394 for (auto &kv : yyextra->contextDefines)
4395 {
4397 }
4398 for (auto &kv : yyextra->localDefines)
4399 {
4401 }
4403 }
4404 else
4405 {
4407 }
4408 }
4409
4410 {
4412 for (const auto &inc : state->includeRelations)
4413 {
4414 auto toKind = [](
bool local,
bool imported) ->
IncludeKind
4415 {
4416 if (local)
4417 {
4418 if (imported)
4419 {
4421 }
4423 }
4424 else if (imported)
4425 {
4427 }
4429 };
4430 if (inc->fromFileDef)
4431 {
4432 inc->fromFileDef->addIncludeDependency(inc->toFileDef,inc->includeName,toKind(inc->local,inc->imported));
4433 }
4434 if (inc->toFileDef && inc->fromFileDef)
4435 {
4436 inc->toFileDef->addIncludedByDependency(inc->fromFileDef,inc->fromFileDef->docName(),toKind(inc->local,inc->imported));
4437 }
4438 }
4439
4441 }
4442
4443
4444}
static bool isFlagSet(const DebugMask mask)
static void print(DebugMask mask, int prio, fmt::format_string< Args... > fmt, Args &&... args)
static DefinesPerFileList macroDefinitions
QCString & sprintf(const char *format,...)
#define Config_getBool(name)
DirIterator end(const DirIterator &) noexcept
#define warn(file, line, fmt,...)
static void initPredefined(yyscan_t yyscanner, const QCString &fileName)
static void setFileName(yyscan_t yyscanner, const QCString &name)
static void forceEndCondSection(yyscan_t yyscanner)
static std::mutex g_updateGlobals
static std::mutex g_debugMutex
const char * qPrint(const char *s)
EntryType guessSection(const QCString &name)