Converts the comments in a file.
2090{
2094 commentcnvYYlex_init_extra(&extra,&yyscanner);
2095#ifdef FLEX_DEBUG
2097#endif
2098 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2099
2100 yyextra->inBufPos = 0;
2101 yyextra->col = 0;
2103 yyextra->skip =
FALSE;
2104 yyextra->fileName = fileName;
2106 yyextra->pythonDocString =
FALSE;
2107 yyextra->lineNr = 1;
2108 yyextra->raiseLevel = 0;
2109 yyextra->raiseLabel = "";
2110 yyextra->raiseIncrement = 0;
2111 yyextra->raisePrefix = "";
2112 yyextra->insertCppCommentMarker=false;
2113 yyextra->expandedAliases.clear();
2114 while (!yyextra->condStack.empty()) yyextra->condStack.pop();
2116 yyextra->vhdl =
FALSE;
2117
2119 yyextra->isFixedForm =
FALSE;
2120 if (yyextra->lang==SrcLangExt::Fortran)
2121 {
2124 }
2125
2126 if (yyextra->lang==SrcLangExt::Markdown)
2127 {
2128 yyextra->nestingCount=0;
2129 BEGIN(CComment);
2130 yyextra->commentStack.push(yyextra->lineNr);
2131 }
2132 else
2133 {
2134 BEGIN(Scan);
2135 }
2137 while (!yyextra->condStack.empty())
2138 {
2142 warn(yyextra->fileName,ctx.
lineNr,
"Conditional section{}does not have "
2143 "a corresponding \\endcond command within this file.",sectionInfo.data());
2144 yyextra->condStack.pop();
2145 }
2146 if (yyextra->nestingCount>0 && yyextra->lang!=SrcLangExt::Markdown && yyextra->lang!=SrcLangExt::Fortran)
2147 {
2149 bool first = true;
2150 while (!yyextra->commentStack.empty())
2151 {
2152 int lineNr = yyextra->commentStack.top();
2153 if (!first) lines += ", ";
2155 first = false;
2156 yyextra->commentStack.pop();
2157 }
2158 warn(yyextra->fileName,yyextra->lineNr,
"Reached end of file while still inside a (nested) comment. "
2159 "Nesting level {} (possible line reference(s): {})",yyextra->nestingCount,lines);
2160 }
2161 yyextra->nestingCount = 0;
2163 {
2165 "output=[\n{}]\n-----------\n",fileName,yyextra->outBuf
2166 );
2167 }
2168 commentcnvYYlex_destroy(yyscanner);
2169}
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)