Converts the comments in a file.
2105{
2109 commentcnvYYlex_init_extra(&extra,&yyscanner);
2110#ifdef FLEX_DEBUG
2112#endif
2113 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2114
2115 yyextra->inBufPos = 0;
2116 yyextra->col = 0;
2118 yyextra->skip =
FALSE;
2119 yyextra->fileName = fileName;
2121 yyextra->pythonDocString =
FALSE;
2122 yyextra->lineNr = 1;
2123 yyextra->raiseLevel = 0;
2124 yyextra->raiseLabel = "";
2125 yyextra->raiseIncrement = 0;
2126 yyextra->raisePrefix = "";
2127 yyextra->insertCppCommentMarker=false;
2128 yyextra->expandedAliases.clear();
2129 while (!yyextra->condStack.empty()) yyextra->condStack.pop();
2131 yyextra->vhdl =
FALSE;
2132
2134 yyextra->isFixedForm =
FALSE;
2135 if (yyextra->lang==SrcLangExt::Fortran)
2136 {
2139 }
2140
2141 if (yyextra->lang==SrcLangExt::Markdown)
2142 {
2143 yyextra->nestingCount=0;
2144 BEGIN(CComment);
2145 yyextra->commentStack.push(yyextra->lineNr);
2146 }
2147 else
2148 {
2149 BEGIN(Scan);
2150 }
2152 while (!yyextra->condStack.empty())
2153 {
2157 warn(yyextra->fileName,ctx.
lineNr,
"Conditional section{}does not have "
2158 "a corresponding \\endcond command within this file.",sectionInfo.data());
2159 yyextra->condStack.pop();
2160 }
2161 if (yyextra->nestingCount>0 && yyextra->lang!=SrcLangExt::Markdown && yyextra->lang!=SrcLangExt::Fortran)
2162 {
2164 bool first = true;
2165 while (!yyextra->commentStack.empty())
2166 {
2167 int lineNr = yyextra->commentStack.top();
2168 if (!first) lines += ", ";
2170 first = false;
2171 yyextra->commentStack.pop();
2172 }
2173 warn(yyextra->fileName,yyextra->lineNr,
"Reached end of file while still inside a (nested) comment. "
2174 "Nesting level {} (possible line reference(s): {})",yyextra->nestingCount,lines);
2175 }
2176 yyextra->nestingCount = 0;
2178 {
2180 "output=[\n{}]\n-----------\n",fileName,yyextra->outBuf
2181 );
2182 }
2183 commentcnvYYlex_destroy(yyscanner);
2184}
static bool isFlagSet(const DebugMask mask)
static void print(DebugMask mask, int prio, fmt::format_string< Args... > fmt, Args &&... args)
This is an alternative implementation of QCString.
QCString stripWhiteSpace() const
returns a copy of this string with leading and trailing whitespace removed
QCString & setNum(short n)
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string.
#define Config_getBool(name)
#define warn(file, line, fmt,...)
const char * qPrint(const char *s)
SrcLangExt getLanguageFromFileName(const QCString &fileName, SrcLangExt defLang)
bool recognizeFixedForm(const QCString &contents, FortranFormat format)
FortranFormat convertFileNameFortranParserCode(QCString fn)