Converts the comments in a file.
2041{
2045 commentcnvYYlex_init_extra(&extra,&yyscanner);
2046#ifdef FLEX_DEBUG
2048#endif
2049 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2050
2051 yyextra->inBufPos = 0;
2052 yyextra->col = 0;
2054 yyextra->skip =
FALSE;
2055 yyextra->fileName = fileName;
2057 yyextra->pythonDocString =
FALSE;
2058 yyextra->lineNr = 1;
2059 yyextra->raiseLevel = 0;
2060 yyextra->raiseLabel = "";
2061 yyextra->raiseIncrement = 0;
2062 yyextra->raisePrefix = "";
2063 yyextra->insertCppCommentMarker=false;
2064 yyextra->expandedAliases.clear();
2065 while (!yyextra->condStack.empty()) yyextra->condStack.pop();
2067 yyextra->vhdl =
FALSE;
2068
2070 yyextra->isFixedForm =
FALSE;
2071 if (yyextra->lang==SrcLangExt::Fortran)
2072 {
2075 }
2076
2077 if (yyextra->lang==SrcLangExt::Markdown)
2078 {
2079 yyextra->nestingCount=0;
2080 BEGIN(CComment);
2081 yyextra->commentStack.push(yyextra->lineNr);
2082 }
2083 else
2084 {
2085 BEGIN(Scan);
2086 }
2088 while (!yyextra->condStack.empty())
2089 {
2093 warn(yyextra->fileName,ctx.
lineNr,
"Conditional section{}does not have "
2094 "a corresponding \\endcond command within this file.",sectionInfo.data());
2095 yyextra->condStack.pop();
2096 }
2097 if (yyextra->nestingCount>0 && yyextra->lang!=SrcLangExt::Markdown && yyextra->lang!=SrcLangExt::Fortran)
2098 {
2100 bool first = true;
2101 while (!yyextra->commentStack.empty())
2102 {
2103 int lineNr = yyextra->commentStack.top();
2104 if (!first) lines += ", ";
2106 first = false;
2107 yyextra->commentStack.pop();
2108 }
2109 warn(yyextra->fileName,yyextra->lineNr,
"Reached end of file while still inside a (nested) comment. "
2110 "Nesting level {} (possible line reference(s): {})",yyextra->nestingCount,lines);
2111 }
2112 yyextra->nestingCount = 0;
2114 {
2116 "output=[\n{}]\n-----------\n",fileName,yyextra->outBuf
2117 );
2118 }
2119 commentcnvYYlex_destroy(yyscanner);
2120}
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)