Converts the comments in a file.
2404{
2408 commentcnvYYlex_init_extra(&extra,&yyscanner);
2409#ifdef FLEX_DEBUG
2411#endif
2413
2414 yyextra->inBufPos = 0;
2415 yyextra->col = 0;
2417 yyextra->skip = false;
2418 yyextra->fileName = fileName;
2420 yyextra->pythonDocString = false;
2421 yyextra->lineNr = 1;
2422 yyextra->raiseLevel = 0;
2423 yyextra->raiseLabel = "";
2424 yyextra->raiseIncrement = 0;
2425 yyextra->raisePrefix = "";
2426 yyextra->insertCppCommentMarker=false;
2427 yyextra->expandedAliases.clear();
2428 yyextra->replacements.clear();
2429 while (!yyextra->condStack.empty()) yyextra->condStack.pop();
2431 yyextra->vhdl = false;
2432
2434 yyextra->isFixedForm = false;
2435 if (yyextra->lang==SrcLangExt::Fortran)
2436 {
2439 }
2440
2441 if (yyextra->lang==SrcLangExt::Markdown)
2442 {
2443 yyextra->nestingCount=0;
2444 BEGIN(CComment);
2445 yyextra->commentStack.push(yyextra->lineNr);
2446 }
2447 else
2448 {
2449 BEGIN(Scan);
2450 }
2452 while (!yyextra->condStack.empty())
2453 {
2457 warn(yyextra->fileName,ctx.
lineNr,
"Conditional section{}does not have "
2458 "a corresponding \\endcond command within this file.",sectionInfo.data());
2459 yyextra->condStack.pop();
2460 }
2461 if (yyextra->nestingCount>0 && yyextra->lang!=SrcLangExt::Markdown && yyextra->lang!=SrcLangExt::Fortran)
2462 {
2464 bool first = true;
2465 while (!yyextra->commentStack.empty())
2466 {
2467 int lineNr = yyextra->commentStack.top();
2468 if (!first) lines += ", ";
2470 first = false;
2471 yyextra->commentStack.pop();
2472 }
2473 warn(yyextra->fileName,yyextra->lineNr,
"Reached end of file while still inside a (nested) comment. "
2474 "Nesting level {} (possible line reference(s): {})",yyextra->nestingCount,lines);
2475 }
2476 yyextra->nestingCount = 0;
2478 {
2480 "output=[\n{}]\n-----------\n",fileName,yyextra->outBuf
2481 );
2482 }
2483 commentcnvYYlex_destroy(yyscanner);
2484}
A String class for use with Doxygen wrapping std::string and adding some additional functionality off...
DString & setNum(short n)
DString stripWhiteSpace() const
returns a copy of this string with leading and trailing whitespace removed
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string.
static bool isFlagSet(const DebugMask mask)
static void print(DebugMask mask, int prio, fmt::format_string< Args... > fmt, Args &&... args)
#define Config_getBool(name)
const char * qPrint(const char *s)
bool recognizeFixedForm(const DString &contents, FortranFormat format)
FortranFormat convertFileNameFortranParserCode(const DString &fn)
#define warn(file, line, fmt,...)
SrcLangExt getLanguageFromFileName(const DString &fileName, SrcLangExt defLang)