4011{
4014 YY_EXTRA_TYPE state = preYYget_extra(
p->yyscanner);
4015 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
4016
4017#ifdef FLEX_DEBUG
4019#endif
4020
4022
4023
4024
4028 state->curlyCount=0;
4029 state->lexRulesPart=false;
4030 state->nospaces=
FALSE;
4031 state->inputBuf=&input;
4032 state->inputBufPos=0;
4033 state->outputBuf=&output;
4034 state->includeStack.clear();
4035 state->expandedDict.clear();
4036 state->contextDefines.clear();
4037 state->pragmaSet.clear();
4038 while (!state->condStack.empty()) state->condStack.pop();
4039
4041
4042 state->inputFileDef = state->yyFileDef;
4043
4044
4046
4047 state->yyLineNr = 1;
4048 state->yyColNr = 1;
4049 state->ifcount = 0;
4050
4051 BEGIN( Start );
4052
4053 state->expectGuard =
guessSection(fileName).isHeader();
4054 state->guardName.clear();
4055 state->lastGuardName.clear();
4056 state->guardExpr.clear();
4057
4058 preYYlex(yyscanner);
4059
4060 while (!state->condStack.empty())
4061 {
4062 const std::unique_ptr<preYY_CondCtx> &ctx = state->condStack.top();
4063 QCString sectionInfo = " ";
4064 if (ctx->sectionId!=
" ") sectionInfo.
sprintf(
" with label '%s' ",
qPrint(ctx->sectionId.stripWhiteSpace()));
4065 warn(ctx->fileName,ctx->lineNr,
"Conditional section{}does not have "
4066 "a corresponding \\endcond command within this file.",sectionInfo);
4067 state->condStack.pop();
4068 }
4069
4071
4072 if (!state->levelGuard.empty())
4073 {
4074 warn(state->fileName,state->yyLineNr,
"More #if's than #endif's found (might be in an included file).");
4075 }
4076
4078 {
4081 std::string contents;
4083 {
4084 contents=output;
4085 }
4086 else
4087 {
4088 int line=1;
4089 bool startOfLine = true;
4090 size_t content_size = output.size() +
4091 output.size()*6/40;
4092
4093 contents.reserve(content_size);
4094 size_t pos=0;
4095 while (pos<output.size())
4096 {
4097 if (startOfLine)
4098 {
4099 char lineNrStr[15];
4100 snprintf(lineNrStr,15,"%05d ",line++);
4101 contents+=lineNrStr;
4102 }
4103 contents += output[pos];
4104 startOfLine = output[pos]=='\n';
4105 pos++;
4106 }
4107 }
4109 if (!contents.empty() && contents[contents.length()-1]!='\n')
4110 {
4112 }
4114 if (yyextra->contextDefines.size()>0)
4115 {
4118 for (auto &kv : yyextra->contextDefines)
4119 {
4121 }
4122 for (auto &kv : yyextra->localDefines)
4123 {
4125 }
4127 }
4128 else
4129 {
4131 }
4132 }
4133
4134 {
4136 for (const auto &inc : state->includeRelations)
4137 {
4138 auto toKind = [](
bool local,
bool imported) ->
IncludeKind
4139 {
4140 if (local)
4141 {
4142 if (imported)
4143 {
4145 }
4147 }
4148 else if (imported)
4149 {
4151 }
4153 };
4154 if (inc->fromFileDef)
4155 {
4156 inc->fromFileDef->addIncludeDependency(inc->toFileDef,inc->includeName,toKind(inc->local,inc->imported));
4157 }
4158 if (inc->toFileDef && inc->fromFileDef)
4159 {
4160 inc->toFileDef->addIncludedByDependency(inc->fromFileDef,inc->fromFileDef->docName(),toKind(inc->local,inc->imported));
4161 }
4162 }
4163
4165 }
4166
4167
4168}
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)