4010{
4013 YY_EXTRA_TYPE state = preYYget_extra(
p->yyscanner);
4014 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
4015
4016#ifdef FLEX_DEBUG
4018#endif
4019
4021
4022
4023
4027 state->curlyCount=0;
4028 state->lexRulesPart=false;
4029 state->nospaces=
FALSE;
4030 state->inputBuf=&input;
4031 state->inputBufPos=0;
4032 state->outputBuf=&output;
4033 state->includeStack.clear();
4034 state->expandedDict.clear();
4035 state->contextDefines.clear();
4036 state->pragmaSet.clear();
4037 while (!state->condStack.empty()) state->condStack.pop();
4038
4040
4041 state->inputFileDef = state->yyFileDef;
4042
4043
4045
4046 state->yyLineNr = 1;
4047 state->yyColNr = 1;
4048 state->ifcount = 0;
4049
4050 BEGIN( Start );
4051
4052 state->expectGuard =
guessSection(fileName).isHeader();
4053 state->guardName.clear();
4054 state->lastGuardName.clear();
4055 state->guardExpr.clear();
4056
4057 preYYlex(yyscanner);
4058
4059 while (!state->condStack.empty())
4060 {
4061 const std::unique_ptr<preYY_CondCtx> &ctx = state->condStack.top();
4062 QCString sectionInfo = " ";
4063 if (ctx->sectionId!=
" ") sectionInfo.
sprintf(
" with label '%s' ",
qPrint(ctx->sectionId.stripWhiteSpace()));
4064 warn(ctx->fileName,ctx->lineNr,
"Conditional section%sdoes not have "
4065 "a corresponding \\endcond command within this file.",
qPrint(sectionInfo));
4066 state->condStack.pop();
4067 }
4068
4070
4072 {
4075 std::string contents;
4077 {
4078 contents=output;
4079 }
4080 else
4081 {
4082 int line=1;
4083 bool startOfLine = true;
4084 size_t content_size = output.size() +
4085 output.size()*6/40;
4086
4087 contents.reserve(content_size);
4088 size_t pos=0;
4089 while (pos<output.size())
4090 {
4091 if (startOfLine)
4092 {
4093 char lineNrStr[15];
4094 snprintf(lineNrStr,15,"%05d ",line++);
4095 contents+=lineNrStr;
4096 }
4097 contents += output[pos];
4098 startOfLine = output[pos]=='\n';
4099 pos++;
4100 }
4101 }
4103 if (!contents.empty() && contents[contents.length()-1]!='\n')
4104 {
4106 }
4108 if (yyextra->contextDefines.size()>0)
4109 {
4112 for (auto &kv : yyextra->contextDefines)
4113 {
4115 }
4116 for (auto &kv : yyextra->localDefines)
4117 {
4119 }
4121 }
4122 else
4123 {
4125 }
4126 }
4127
4128 {
4130 for (const auto &inc : state->includeRelations)
4131 {
4132 auto toKind = [](
bool local,
bool imported) ->
IncludeKind
4133 {
4134 if (local)
4135 {
4136 if (imported)
4137 {
4139 }
4141 }
4142 else if (imported)
4143 {
4145 }
4147 };
4148 if (inc->fromFileDef)
4149 {
4150 inc->fromFileDef->addIncludeDependency(inc->toFileDef,inc->includeName,toKind(inc->local,inc->imported));
4151 }
4152 if (inc->toFileDef && inc->fromFileDef)
4153 {
4154 inc->toFileDef->addIncludedByDependency(inc->fromFileDef,inc->fromFileDef->docName(),toKind(inc->local,inc->imported));
4155 }
4156 }
4157
4159 }
4160
4161
4162}
static void print(DebugMask mask, int prio, const char *fmt,...)
static bool isFlagSet(const DebugMask mask)
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)