4197{
4200 YY_EXTRA_TYPE state = preYYget_extra(
p->yyscanner);
4201 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
4202
4203#ifdef FLEX_DEBUG
4205#endif
4206
4208
4209
4210
4214 state->curlyCount=0;
4215 state->lexRulesPart=false;
4216 state->nospaces=
FALSE;
4217 state->inputBuf=&input;
4218 state->inputBufPos=0;
4219 state->outputBuf=&output;
4220 state->includeStack.clear();
4221 state->expandedDict.clear();
4222 state->contextDefines.clear();
4223 state->pragmaSet.clear();
4224 while (!state->condStack.empty()) state->condStack.pop();
4225
4227
4228 state->inputFileDef = state->yyFileDef;
4229
4230
4232
4233 state->yyLineNr = 1;
4234 state->yyColNr = 1;
4235 state->ifcount = 0;
4236
4237 BEGIN( Start );
4238
4239 state->expectGuard =
guessSection(fileName).isHeader();
4240 state->guardName.clear();
4241 state->lastGuardName.clear();
4242 state->guardExpr.clear();
4243
4244 preYYlex(yyscanner);
4245
4246 while (!state->condStack.empty())
4247 {
4248 const std::unique_ptr<preYY_CondCtx> &ctx = state->condStack.top();
4249 QCString sectionInfo = " ";
4250 if (ctx->sectionId!=
" ") sectionInfo.
sprintf(
" with label '%s' ",
qPrint(ctx->sectionId.stripWhiteSpace()));
4251 warn(ctx->fileName,ctx->lineNr,
"Conditional section{}does not have "
4252 "a corresponding \\endcond command within this file.",sectionInfo);
4253 state->condStack.pop();
4254 }
4255
4257
4258 if (!state->levelGuard.empty())
4259 {
4260 warn(state->fileName,state->yyLineNr,
"More #if's than #endif's found (might be in an included file).");
4261 }
4262
4264 {
4267 std::string contents;
4269 {
4270 contents=output;
4271 }
4272 else
4273 {
4274 int line=1;
4275 bool startOfLine = true;
4276 size_t content_size = output.size() +
4277 output.size()*6/40;
4278
4279 contents.reserve(content_size);
4280 size_t pos=0;
4281 while (pos<output.size())
4282 {
4283 if (startOfLine)
4284 {
4285 char lineNrStr[15];
4286 snprintf(lineNrStr,15,"%05d ",line++);
4287 contents+=lineNrStr;
4288 }
4289 contents += output[pos];
4290 startOfLine = output[pos]=='\n';
4291 pos++;
4292 }
4293 }
4295 if (!contents.empty() && contents[contents.length()-1]!='\n')
4296 {
4298 }
4300 if (yyextra->contextDefines.size()>0)
4301 {
4304 for (auto &kv : yyextra->contextDefines)
4305 {
4307 }
4308 for (auto &kv : yyextra->localDefines)
4309 {
4311 }
4313 }
4314 else
4315 {
4317 }
4318 }
4319
4320 {
4322 for (const auto &inc : state->includeRelations)
4323 {
4324 auto toKind = [](
bool local,
bool imported) ->
IncludeKind
4325 {
4326 if (local)
4327 {
4328 if (imported)
4329 {
4331 }
4333 }
4334 else if (imported)
4335 {
4337 }
4339 };
4340 if (inc->fromFileDef)
4341 {
4342 inc->fromFileDef->addIncludeDependency(inc->toFileDef,inc->includeName,toKind(inc->local,inc->imported));
4343 }
4344 if (inc->toFileDef && inc->fromFileDef)
4345 {
4346 inc->toFileDef->addIncludedByDependency(inc->fromFileDef,inc->fromFileDef->docName(),toKind(inc->local,inc->imported));
4347 }
4348 }
4349
4351 }
4352
4353
4354}
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)