Converts the comments in a file.
1965{
1969 commentcnvYYlex_init_extra(&extra,&yyscanner);
1970#ifdef FLEX_DEBUG
1972#endif
1973 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
1974
1975 yyextra->inBufPos = 0;
1976 yyextra->col = 0;
1978 yyextra->skip =
FALSE;
1979 yyextra->fileName = fileName;
1981 yyextra->pythonDocString =
FALSE;
1982 yyextra->lineNr = 1;
1983 yyextra->raiseLevel = 0;
1984 yyextra->raiseLabel = "";
1985 yyextra->raiseIncrement = 0;
1986 yyextra->raisePrefix = "";
1987 yyextra->insertCppCommentMarker=false;
1988 yyextra->expandedAliases.clear();
1989 while (!yyextra->condStack.empty()) yyextra->condStack.pop();
1991 yyextra->vhdl =
FALSE;
1992
1994 yyextra->isFixedForm =
FALSE;
1995 if (yyextra->lang==SrcLangExt::Fortran)
1996 {
1999 }
2000
2001 if (yyextra->lang==SrcLangExt::Markdown)
2002 {
2003 yyextra->nestingCount=0;
2004 BEGIN(CComment);
2005 yyextra->commentStack.push(yyextra->lineNr);
2006 }
2007 else
2008 {
2009 BEGIN(Scan);
2010 }
2012 while (!yyextra->condStack.empty())
2013 {
2017 warn(yyextra->fileName,ctx.
lineNr,
"Conditional section{}does not have "
2018 "a corresponding \\endcond command within this file.",sectionInfo.data());
2019 yyextra->condStack.pop();
2020 }
2021 if (yyextra->nestingCount>0 && yyextra->lang!=SrcLangExt::Markdown && yyextra->lang!=SrcLangExt::Fortran)
2022 {
2024 bool first = true;
2025 while (!yyextra->commentStack.empty())
2026 {
2027 int lineNr = yyextra->commentStack.top();
2028 if (!first) lines += ", ";
2030 first = false;
2031 yyextra->commentStack.pop();
2032 }
2033 warn(yyextra->fileName,yyextra->lineNr,
"Reached end of file while still inside a (nested) comment. "
2034 "Nesting level {} (possible line reference(s): {})",yyextra->nestingCount,lines);
2035 }
2036 yyextra->nestingCount = 0;
2038 {
2040 "output=[\n{}]\n-----------\n",fileName,yyextra->outBuf
2041 );
2042 }
2043 commentcnvYYlex_destroy(yyscanner);
2044}
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)