4074{
4077 YY_EXTRA_TYPE state = preYYget_extra(
p->yyscanner);
4078 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
4079
4080#ifdef FLEX_DEBUG
4082#endif
4083
4085
4086
4087
4091 state->curlyCount=0;
4092 state->lexRulesPart=false;
4093 state->nospaces=
FALSE;
4094 state->inputBuf=&input;
4095 state->inputBufPos=0;
4096 state->outputBuf=&output;
4097 state->includeStack.clear();
4098 state->expandedDict.clear();
4099 state->contextDefines.clear();
4100 state->pragmaSet.clear();
4101 while (!state->condStack.empty()) state->condStack.pop();
4102
4104
4105 state->inputFileDef = state->yyFileDef;
4106
4107
4109
4110 state->yyLineNr = 1;
4111 state->yyColNr = 1;
4112 state->ifcount = 0;
4113
4114 BEGIN( Start );
4115
4116 state->expectGuard =
guessSection(fileName).isHeader();
4117 state->guardName.clear();
4118 state->lastGuardName.clear();
4119 state->guardExpr.clear();
4120
4121 preYYlex(yyscanner);
4122
4123 while (!state->condStack.empty())
4124 {
4125 const std::unique_ptr<preYY_CondCtx> &ctx = state->condStack.top();
4126 QCString sectionInfo = " ";
4127 if (ctx->sectionId!=
" ") sectionInfo.
sprintf(
" with label '%s' ",
qPrint(ctx->sectionId.stripWhiteSpace()));
4128 warn(ctx->fileName,ctx->lineNr,
"Conditional section{}does not have "
4129 "a corresponding \\endcond command within this file.",sectionInfo);
4130 state->condStack.pop();
4131 }
4132
4134
4135 if (!state->levelGuard.empty())
4136 {
4137 warn(state->fileName,state->yyLineNr,
"More #if's than #endif's found (might be in an included file).");
4138 }
4139
4141 {
4144 std::string contents;
4146 {
4147 contents=output;
4148 }
4149 else
4150 {
4151 int line=1;
4152 bool startOfLine = true;
4153 size_t content_size = output.size() +
4154 output.size()*6/40;
4155
4156 contents.reserve(content_size);
4157 size_t pos=0;
4158 while (pos<output.size())
4159 {
4160 if (startOfLine)
4161 {
4162 char lineNrStr[15];
4163 snprintf(lineNrStr,15,"%05d ",line++);
4164 contents+=lineNrStr;
4165 }
4166 contents += output[pos];
4167 startOfLine = output[pos]=='\n';
4168 pos++;
4169 }
4170 }
4172 if (!contents.empty() && contents[contents.length()-1]!='\n')
4173 {
4175 }
4177 if (yyextra->contextDefines.size()>0)
4178 {
4181 for (auto &kv : yyextra->contextDefines)
4182 {
4184 }
4185 for (auto &kv : yyextra->localDefines)
4186 {
4188 }
4190 }
4191 else
4192 {
4194 }
4195 }
4196
4197 {
4199 for (const auto &inc : state->includeRelations)
4200 {
4201 auto toKind = [](
bool local,
bool imported) ->
IncludeKind
4202 {
4203 if (local)
4204 {
4205 if (imported)
4206 {
4208 }
4210 }
4211 else if (imported)
4212 {
4214 }
4216 };
4217 if (inc->fromFileDef)
4218 {
4219 inc->fromFileDef->addIncludeDependency(inc->toFileDef,inc->includeName,toKind(inc->local,inc->imported));
4220 }
4221 if (inc->toFileDef && inc->fromFileDef)
4222 {
4223 inc->toFileDef->addIncludedByDependency(inc->fromFileDef,inc->fromFileDef->docName(),toKind(inc->local,inc->imported));
4224 }
4225 }
4226
4228 }
4229
4230
4231}
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)