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