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