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