Converts the comments in a file.
2142{
2146 commentcnvYYlex_init_extra(&extra,&yyscanner);
2147#ifdef FLEX_DEBUG
2149#endif
2150 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2151
2152 yyextra->inBufPos = 0;
2153 yyextra->col = 0;
2155 yyextra->skip = false;
2156 yyextra->fileName = fileName;
2158 yyextra->pythonDocString = false;
2159 yyextra->lineNr = 1;
2160 yyextra->raiseLevel = 0;
2161 yyextra->raiseLabel = "";
2162 yyextra->raiseIncrement = 0;
2163 yyextra->raisePrefix = "";
2164 yyextra->insertCppCommentMarker=false;
2165 yyextra->expandedAliases.clear();
2166 while (!yyextra->condStack.empty()) yyextra->condStack.pop();
2168 yyextra->vhdl = false;
2169
2171 yyextra->isFixedForm = false;
2172 if (yyextra->lang==SrcLangExt::Fortran)
2173 {
2176 }
2177
2178 if (yyextra->lang==SrcLangExt::Markdown)
2179 {
2180 yyextra->nestingCount=0;
2181 BEGIN(CComment);
2182 yyextra->commentStack.push(yyextra->lineNr);
2183 }
2184 else
2185 {
2186 BEGIN(Scan);
2187 }
2189 while (!yyextra->condStack.empty())
2190 {
2194 warn(yyextra->fileName,ctx.
lineNr,
"Conditional section{}does not have "
2195 "a corresponding \\endcond command within this file.",sectionInfo.data());
2196 yyextra->condStack.pop();
2197 }
2198 if (yyextra->nestingCount>0 && yyextra->lang!=SrcLangExt::Markdown && yyextra->lang!=SrcLangExt::Fortran)
2199 {
2201 bool first = true;
2202 while (!yyextra->commentStack.empty())
2203 {
2204 int lineNr = yyextra->commentStack.top();
2205 if (!first) lines += ", ";
2207 first = false;
2208 yyextra->commentStack.pop();
2209 }
2210 warn(yyextra->fileName,yyextra->lineNr,
"Reached end of file while still inside a (nested) comment. "
2211 "Nesting level {} (possible line reference(s): {})",yyextra->nestingCount,lines);
2212 }
2213 yyextra->nestingCount = 0;
2215 {
2217 "output=[\n{}]\n-----------\n",fileName,yyextra->outBuf
2218 );
2219 }
2220 commentcnvYYlex_destroy(yyscanner);
2221}
A String class for use with Doxygen wrapping std::string and adding some additional functionality off...
DString & setNum(short n)
DString stripWhiteSpace() const
returns a copy of this string with leading and trailing whitespace removed
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string.
static bool isFlagSet(const DebugMask mask)
static void print(DebugMask mask, int prio, fmt::format_string< Args... > fmt, Args &&... args)
#define Config_getBool(name)
const char * qPrint(const char *s)
bool recognizeFixedForm(const DString &contents, FortranFormat format)
FortranFormat convertFileNameFortranParserCode(const DString &fn)
#define warn(file, line, fmt,...)
SrcLangExt getLanguageFromFileName(const DString &fileName, SrcLangExt defLang)