4157{
4160 YY_EXTRA_TYPE state = preYYget_extra(
p->yyscanner);
4161 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
4162
4163#ifdef FLEX_DEBUG
4165#endif
4166
4168
4169
4170
4174 state->curlyCount=0;
4175 state->lexRulesPart=false;
4176 state->nospaces=
FALSE;
4177 state->inputBuf=&input;
4178 state->inputBufPos=0;
4179 state->outputBuf=&output;
4180 state->includeStack.clear();
4181 state->expandedDict.clear();
4182 state->contextDefines.clear();
4183 state->pragmaSet.clear();
4184 while (!state->condStack.empty()) state->condStack.pop();
4185
4187
4188 state->inputFileDef = state->yyFileDef;
4189
4190
4192
4193 state->yyLineNr = 1;
4194 state->yyColNr = 1;
4195 state->ifcount = 0;
4196
4197 BEGIN( Start );
4198
4199 state->expectGuard =
guessSection(fileName).isHeader();
4200 state->guardName.clear();
4201 state->lastGuardName.clear();
4202 state->guardExpr.clear();
4203
4204 preYYlex(yyscanner);
4205
4206 while (!state->condStack.empty())
4207 {
4208 const std::unique_ptr<preYY_CondCtx> &ctx = state->condStack.top();
4209 QCString sectionInfo = " ";
4210 if (ctx->sectionId!=
" ") sectionInfo.
sprintf(
" with label '%s' ",
qPrint(ctx->sectionId.stripWhiteSpace()));
4211 warn(ctx->fileName,ctx->lineNr,
"Conditional section{}does not have "
4212 "a corresponding \\endcond command within this file.",sectionInfo);
4213 state->condStack.pop();
4214 }
4215
4217
4218 if (!state->levelGuard.empty())
4219 {
4220 warn(state->fileName,state->yyLineNr,
"More #if's than #endif's found (might be in an included file).");
4221 }
4222
4224 {
4227 std::string contents;
4229 {
4230 contents=output;
4231 }
4232 else
4233 {
4234 int line=1;
4235 bool startOfLine = true;
4236 size_t content_size = output.size() +
4237 output.size()*6/40;
4238
4239 contents.reserve(content_size);
4240 size_t pos=0;
4241 while (pos<output.size())
4242 {
4243 if (startOfLine)
4244 {
4245 char lineNrStr[15];
4246 snprintf(lineNrStr,15,"%05d ",line++);
4247 contents+=lineNrStr;
4248 }
4249 contents += output[pos];
4250 startOfLine = output[pos]=='\n';
4251 pos++;
4252 }
4253 }
4255 if (!contents.empty() && contents[contents.length()-1]!='\n')
4256 {
4258 }
4260 if (yyextra->contextDefines.size()>0)
4261 {
4264 for (auto &kv : yyextra->contextDefines)
4265 {
4267 }
4268 for (auto &kv : yyextra->localDefines)
4269 {
4271 }
4273 }
4274 else
4275 {
4277 }
4278 }
4279
4280 {
4282 for (const auto &inc : state->includeRelations)
4283 {
4284 auto toKind = [](
bool local,
bool imported) ->
IncludeKind
4285 {
4286 if (local)
4287 {
4288 if (imported)
4289 {
4291 }
4293 }
4294 else if (imported)
4295 {
4297 }
4299 };
4300 if (inc->fromFileDef)
4301 {
4302 inc->fromFileDef->addIncludeDependency(inc->toFileDef,inc->includeName,toKind(inc->local,inc->imported));
4303 }
4304 if (inc->toFileDef && inc->fromFileDef)
4305 {
4306 inc->toFileDef->addIncludedByDependency(inc->fromFileDef,inc->fromFileDef->docName(),toKind(inc->local,inc->imported));
4307 }
4308 }
4309
4311 }
4312
4313
4314}
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)