4242{
4245 YY_EXTRA_TYPE state = preYYget_extra(
p->yyscanner);
4246 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
4247
4248#ifdef FLEX_DEBUG
4250#endif
4251
4253
4254
4255
4259 state->curlyCount=0;
4260 state->lexRulesPart=false;
4261 state->nospaces=
FALSE;
4262 state->inputBuf=&input;
4263 state->inputBufPos=0;
4264 state->outputBuf=&output;
4265 state->includeStack.clear();
4266 state->expandedDict.clear();
4267 state->contextDefines.clear();
4268 state->pragmaSet.clear();
4269 state->condGuardCount=0;
4270 state->condGuardErrorLine=0;
4271 while (!state->levelGuard.empty()) state->levelGuard.pop();
4272 while (!state->condStack.empty()) state->condStack.pop();
4273
4275
4276 state->inputFileDef = state->yyFileDef;
4277
4278
4280
4281 state->yyLineNr = 1;
4282 state->yyColNr = 1;
4283 state->ifcount = 0;
4284
4285 BEGIN( Start );
4286
4287 state->expectGuard =
guessSection(fileName).isHeader();
4288 state->guardName.clear();
4289 state->lastGuardName.clear();
4290 state->guardExpr.clear();
4291
4292 preYYlex(yyscanner);
4293
4294 while (!state->condStack.empty())
4295 {
4296 const std::unique_ptr<preYY_CondCtx> &ctx = state->condStack.top();
4297 QCString sectionInfo = " ";
4298 if (ctx->sectionId!=
" ") sectionInfo.
sprintf(
" with label '%s' ",
qPrint(ctx->sectionId.stripWhiteSpace()));
4299 warn(ctx->fileName,ctx->lineNr,
"Conditional section{}does not have "
4300 "a corresponding \\endcond command within this file.",sectionInfo);
4301 state->condStack.pop();
4302 }
4303
4305
4306 if (!state->levelGuard.empty())
4307 {
4308 if (yyextra->condGuardErrorLine!=0)
4309 {
4310 warn(yyextra->condGuardErrorFileName,yyextra->condGuardErrorLine,
"{}",yyextra->condGuardErrorMessage);
4311 }
4312 else
4313 {
4314 warn(state->fileName,state->yyLineNr,
"More #if's than #endif's found (might be in an included file).");
4315 }
4316 }
4317
4319 {
4322 std::string contents;
4324 {
4325 contents=output;
4326 }
4327 else
4328 {
4329 int line=1;
4330 bool startOfLine = true;
4331 size_t content_size = output.size() +
4332 output.size()*6/40;
4333
4334 contents.reserve(content_size);
4335 size_t pos=0;
4336 while (pos<output.size())
4337 {
4338 if (startOfLine)
4339 {
4340 char lineNrStr[15];
4341 snprintf(lineNrStr,15,"%05d ",line++);
4342 contents+=lineNrStr;
4343 }
4344 contents += output[pos];
4345 startOfLine = output[pos]=='\n';
4346 pos++;
4347 }
4348 }
4350 if (!contents.empty() && contents[contents.length()-1]!='\n')
4351 {
4353 }
4355 if (yyextra->contextDefines.size()>0)
4356 {
4359 for (auto &kv : yyextra->contextDefines)
4360 {
4362 }
4363 for (auto &kv : yyextra->localDefines)
4364 {
4366 }
4368 }
4369 else
4370 {
4372 }
4373 }
4374
4375 {
4377 for (const auto &inc : state->includeRelations)
4378 {
4379 auto toKind = [](
bool local,
bool imported) ->
IncludeKind
4380 {
4381 if (local)
4382 {
4383 if (imported)
4384 {
4386 }
4388 }
4389 else if (imported)
4390 {
4392 }
4394 };
4395 if (inc->fromFileDef)
4396 {
4397 inc->fromFileDef->addIncludeDependency(inc->toFileDef,inc->includeName,toKind(inc->local,inc->imported));
4398 }
4399 if (inc->toFileDef && inc->fromFileDef)
4400 {
4401 inc->toFileDef->addIncludedByDependency(inc->fromFileDef,inc->fromFileDef->docName(),toKind(inc->local,inc->imported));
4402 }
4403 }
4404
4406 }
4407
4408
4409}
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)