28%option never-interactive
29%option case-insensitive
31%option prefix="fortrancodeYY"
32%option extra-type="struct fortrancodeYY_state *"
37#define YY_TYPEDEF_YY_SCANNER_T
38#define yyguts_t fortrancodeYYguts_t
72#define DBG_CTX(x) do { } while(0)
74#define YY_NO_TOP_STATE 1
76#define YY_NO_UNISTD_H 1
88#define YY_USER_ACTION {yy_old_start = yy_my_start; yy_my_start = yy_end; yy_end += static_cast<int>(yyleng);}
89#define YY_FTN_RESET {yy_old_start = 0; yy_my_start = 0; yy_end = 1;}
90#define YY_FTN_REJECT {yy_end = yy_my_start; yy_my_start = yy_old_start; REJECT;}
108class UseMap :
public std::map<std::string,UseEntry>
221#define YY_INPUT(buf,result,max_size) result=yyread(yyscanner,buf,max_size);
A abstract class representing of a compound symbol.
A String class for use with Doxygen wrapping std::string and adding some additional functionality off...
The common base class of all entity definitions found in the sources.
A model of a file symbol.
A model of a class/file/namespace member symbol.
An abstract interface of a namespace symbol.
Class representing a list of different code generators.
Contains names of used modules and names of local variables.
StringUnorderedSet externalVars
contains names of external entities
StringUnorderedSet localVars
contains names of local variables
std::vector< DString > useNames
contains names of used modules
std::vector< DString > onlyNames
module name -> list of ONLY/remote entries (module name = name of the module, which can be accessed v...
std::unordered_set< std::string > StringUnorderedSet
static void writeMultiLineCodeLink(yyscan_t yyscanner, OutputCodeList &ol, Definition *d, const DString &text)
static void addUse(yyscan_t yyscanner, const DString &moduleName)
static void startScope(yyscan_t yyscanner)
start scope
static void endCodeLine(yyscan_t yyscanner)
static void endScope(yyscan_t yyscanner)
end scope
static bool getLink(yyscan_t yyscanner, const UseMap &useMap, const DString &memberText, OutputCodeList &ol, const DString &text)
static void nextCodeLine(yyscan_t yyscanner)
static void startCodeLine(yyscan_t yyscanner)
static void setCurrentDoc(yyscan_t yyscanner, const DString &anchor)
static MemberDef * getFortranDefs(yyscan_t yyscanner, const DString &memberName, const DString &moduleName, const UseMap &useMap)
searches for definition of function memberName
static void generateLink(yyscan_t yyscanner, OutputCodeList &ol, const DString &lname)
static int yyread(yyscan_t yyscanner, char *buf, int max_size)
static int countLines(yyscan_t yyscanner)
static const char * stateToString(int state)
static bool getFortranNamespaceDefs(const DString &mname, NamespaceDef *&cd)
searches for definition of a module (Namespace)
static bool getFortranTypeDefs(const DString &tname, const DString &moduleName, ClassDef *&cd, const UseMap &useMap)
searches for definition of a type
static void pop_state(yyscan_t yyscanner)
static bool getGenericProcedureLink(yyscan_t yyscanner, const ClassDef *cd, const DString &memberText, OutputCodeList &ol)
gets the link to a generic procedure which depends not on the name, but on the parameter list
static void addToSearchIndex(yyscan_t yyscanner, const DString &text)
static void codifyLines(yyscan_t yyscanner, const DString &text)
static void startFontClass(yyscan_t yyscanner, const char *s, bool specialComment=false)
static void endFontClass(yyscan_t yyscanner, bool specialComment=false)
static void addLocalVar(yyscan_t yyscanner, const DString &varName)
static const char * getLexerFILE()
DString str
contents of fortran string
TooltipManager tooltipManager
bool insideSpecialComment
DString docBlock
contents of all lines of a documentation block
int * hasContLine
signals whether or not a line has a continuation line (fixed source form)
bool insideBody
inside subprog/program body? => create links
int contLineNr
current, local, line number for continuation determination
int inputPosition
read offset during parsing
std::vector< Scope > scopeStack
std::unique_ptr< FileDef > exampleFileDef
const FileDef * sourceFileDef
const MemberDef * currentMemberDef
const Definition * searchCtx
UseEntry useEntry
current use statement info
DString currentModule
name of the current enclosing module
int yyLineNr
current line number
UseMap useMembers
info about used modules
std::vector< const Definition * > foldStack
const char * inputString
the code fragment as text
int inputLines
number of line in the code fragment
const Definition * currentDefinition
const char * currentFontClass
A bunch of utility functions.
231SUBPROG (subroutine|function)
236ARGS_L1a [^()]*"("[^)]*")"[^)]*
237ARGS_L1 ("("{ARGS_L1a}*")")
238ARGS_L2 "("({ARGS_L0}|[^()]|{ARGS_L1a}|{ARGS_L1})*")"
239ARGS {BS}({ARGS_L0}|{ARGS_L1}|{ARGS_L2})
241NUM_TYPE (complex|integer|logical|real)
242LOG_OPER (\.and\.|\.eq\.|\.eqv\.|\.ge\.|\.gt\.|\.le\.|\.lt\.|\.ne\.|\.neqv\.|\.or\.|\.not\.)
244CHAR (CHARACTER{ARGS}?|CHARACTER{BS}"*"({BS}[0-9]+|{ARGS}))
245TYPE_SPEC (({NUM_TYPE}({BS}"*"{BS}[0-9]+)?)|({NUM_TYPE}{KIND})|DOUBLE{BS}COMPLEX|DOUBLE{BS}PRECISION|{CHAR}|TYPE|CLASS|PROCEDURE|ENUMERATOR)
247INTENT_SPEC intent{BS}"("{BS}(in|out|in{BS}out){BS}")"
248ATTR_SPEC (IMPLICIT|ALLOCATABLE|DIMENSION{ARGS}|EXTERNAL|{INTENT_SPEC}|INTRINSIC|OPTIONAL|PARAMETER|POINTER|PROTECTED|PRIVATE|PUBLIC|SAVE|TARGET|(NON_)?RECURSIVE|PURE|IMPURE|ELEMENTAL|VALUE|NOPASS|DEFERRED|CONTIGUOUS|VOLATILE)
249ACCESS_SPEC (PROTECTED|PRIVATE|PUBLIC)
251FLOW (DO|SELECT|CASE|SELECT{BS}(CASE|TYPE|RANK)|WHERE|IF|THEN|ELSE|WHILE|FORALL|ELSEWHERE|ELSEIF|RETURN|CONTINUE|EXIT|GO{BS}TO)
252COMMANDS (FORMAT|CONTAINS|MODULE{BS_}PROCEDURE|WRITE|READ|ALLOCATE|ALLOCATED|ASSOCIATED|PRESENT|DEALLOCATE|NULLIFY|SIZE|INQUIRE|OPEN|CLOSE|FLUSH|DATA|COMMON)
254PREFIX ((NON_)?RECURSIVE{BS_}|IMPURE{BS_}|PURE{BS_}|ELEMENTAL{BS_}){0,4}((NON_)?RECURSIVE|IMPURE|PURE|ELEMENTAL)?0
255LANGUAGE_BIND_SPEC BIND{BS}"("{BS}C{BS}(,{BS}NAME{BS}"="{BS}"\""(.*)"\""{BS})?")"
283<Start>{IGNORE}/{BS}"(" {
288<Start>{COMMANDS}/{BS}[,( \t\n] {
294<Start>{FLOW}/{BS}[,( \t\n] {
295 if (yyextra->isFixedForm)
299 if (yyextra->currentMemberDef && yyextra->currentMemberDef->isFunction())
static std::mutex countFlowKeywordsMutex
virtual void incrementFlowKeyWordCount()=0
MemberDefMutable * toMemberDefMutable(Definition *d)
313<Start>{BS}(RANK){BS_}(DEFAULT) |
314<Start>{BS}(RANK)/{BS}"("{BS}([0-9]+|"*"){BS}")" |
315<Start>{BS}(CASE|CLASS|TYPE){BS_}(IS|DEFAULT) {
320<Start>{BS}"end"({BS}{FLOW})/[ \t\n] {
325<Start>"implicit"{BS}("none"|{TYPE_SPEC}) {
330<Start>^{BS}"namelist"/[/] {
340 yy_push_state(YY_START,yyscanner);
347 yy_push_state(YY_START,yyscanner);
353 yyextra->insideBody=
true;
355 yyextra->insideBody=
false;
359 yyextra->useEntry.module = tmp;
360 yyextra->useMembers.emplace(tmp.str(), yyextra->useEntry);
363<Use,UseOnly,Import>{BS},{BS} {
codifyLines(yyscanner,yytext); }
364<UseOnly,Import>{BS}&{BS}"\n" {
codifyLines(yyscanner,yytext);
365 yyextra->contLineNr++;
370 yyextra->useEntry.onlyNames.push_back(tmp);
371 yyextra->insideBody=
true;
373 yyextra->insideBody=
false;
375<Use,UseOnly,Import>"\n" {
380<*>"import"{BS}/"\n" |
386 yy_push_state(YY_START,yyscanner);
390 yyextra->insideBody=
true;
392 yyextra->insideBody=
false;
394<Import>("ONLY"|"NONE"|"ALL") {
400<Start>("block"{BS}"data"|"program"|"module"|"interface")/{BS_}|({COMMA}{ACCESS_SPEC})|\n {
405 yy_push_state(YY_START,yyscanner);
407 if (!
dstricmp(yytext,
"module")) yyextra->currentModule=
"module";
int dstricmp(const char *s1, const char *s2)
409<Start>("enum")/{BS_}|{BS}{COMMA}{BS}{LANGUAGE_BIND_SPEC}|\n {
414 yy_push_state(YY_START,yyscanner);
417<*>{LANGUAGE_BIND_SPEC} {
423<Start>("type")/{BS_}|({COMMA}({ACCESS_SPEC}|ABSTRACT|EXTENDS))|\n {
428 yy_push_state(YY_START,yyscanner);
432 if (yyextra->currentModule ==
"module")
434 yyextra->currentModule=yytext;
435 yyextra->currentModule = yyextra->currentModule.lower();
440<ClassName>({ACCESS_SPEC}|ABSTRACT|EXTENDS)/[,:( ] {
442 yyextra->code->codify(yytext);
449<Start>^{BS}"end"({BS_}"enum").* {
452<Start>^{BS}"end"({BS_}"type").* {
455<Start>^{BS}"end"({BS_}"module").* {
456 yyextra->currentModule=
nullptr;
460<Start>({PREFIX}{BS_})?{TYPE_SPEC}{BS_}({PREFIX}{BS_})?{BS}/{SUBPROG}{BS_} {
465<Start>({PREFIX}{BS_})?{SUBPROG}{BS_} {
469 yy_push_state(YY_START,yyscanner);
473 DBG_CTX((stderr,
"===> start subprogram %s\n", yytext));
477<Subprog>"result"/{BS}"("[^)]*")" {
482<Subprog>"("[^)]*")" {
485<Subprog,Subprogend>"\n" {
codifyLines(yyscanner,yytext);
486 yyextra->contLineNr++;
490<Start>"end"{BS}("block"{BS}"data"|{SUBPROG}|"module"|"program"|"enum"|"type"|"interface")?{BS} {
496 yy_push_state(YY_START,yyscanner);
499<Subprogend>{ID}/{BS}(\n|!|;) {
503<Start>"end"{BS}("block"{BS}"data"|{SUBPROG}|"module"|"program"|"enum"|"type"|"interface"){BS}/(\n|!|;) {
511<Start>^{BS}"real"/[,:( ] {
512 yy_push_state(YY_START,yyscanner);
515 yyextra->code->codify(yytext);
518<Start>{TYPE_SPEC}/[,:( ] {
522 if (typ ==
"type" || typ ==
"class" || typ ==
"procedure") yyextra->inTypeDecl = 1;
523 yy_push_state(YY_START,yyscanner);
526 yyextra->code->codify(yytext);
DString removeRedundantWhiteSpace(const DString &s)
530 if (
DString(yytext) ==
"external")
532 yy_push_state(YY_START,yyscanner);
534 yyextra->isExternal =
true;
537 yyextra->code->codify(yytext);
540<Declaration>({TYPE_SPEC}|{ATTR_SPEC})/[,:( ] {
541 if (
DString(yytext) ==
"external") yyextra->isExternal =
true;
543 yyextra->code->codify(yytext);
550 yyextra->code->codify(yytext);
553 else if (yyextra->currentMemberDef &&
554 ((yyextra->currentMemberDef->isFunction() && (yyextra->currentMemberDef->typeString()!=
DString(
"subroutine") || yyextra->inTypeDecl)) ||
555 yyextra->currentMemberDef->isVariable() || yyextra->currentMemberDef->isEnumValue()
563 yyextra->code->codify(yytext);
567<Declaration>{BS}("=>"|"="){BS} {
568 BEGIN(DeclarationBinding);
569 yyextra->code->codify(yytext);
571<DeclarationBinding>{ID} {
576 yyextra->bracketCount++;
577 yyextra->code->codify(yytext);
581 yyextra->bracketCount--;
582 if (!yyextra->bracketCount) yyextra->inTypeDecl = 0;
583 yyextra->code->codify(yytext);
586<Declaration,DeclarationBinding>"&" {
587 yyextra->code->codify(yytext);
588 if (!yyextra->isFixedForm)
590 yy_push_state(YY_START,yyscanner);
595 yyextra->contLineNr++;
597 yyextra->bracketCount = 0;
601<Declaration,DeclarationBinding>"\n" {
602 if (yyextra->endComment)
604 yyextra->endComment=
false;
610 yyextra->bracketCount = 0;
611 yyextra->contLineNr++;
612 if (!(yyextra->hasContLine && yyextra->hasContLine[yyextra->contLineNr - 1]))
614 yyextra->isExternal =
false;
626 yy_push_state(YY_START,yyscanner);
630 yyextra->insideBody=
true;
632 yyextra->insideBody=
false;
643 yy_push_state(YY_START,yyscanner);
648 yyextra->code->codify(
DString(yytext + 4));
652 yyextra->insideBody=
true;
654 yyextra->insideBody=
false;
std::string_view stripWhiteSpace(std::string_view s)
Given a string view s, returns a new, narrower view on that string, skipping over any leading or trai...
659<Start,Declaration,DeclarationBinding>\n?{BS}"!>"|"!<" {
660 if (yytext[0] ==
'\n')
662 yyextra->contLineNr++;
665 yy_end =
static_cast<int>(yyleng);
669 yy_push_state(YY_START,yyscanner);
671 yyextra->docBlock=yytext;
673<Declaration,DeclarationBinding>{BS}"!<" {
674 yy_push_state(YY_START,yyscanner);
676 yyextra->docBlock=yytext;
680 yyextra->docBlock+=yytext;
682<DocBlock>"\n"{BS}("!>"|"!<"|"!!") {
683 yyextra->contLineNr++;
686 yy_end =
static_cast<int>(yyleng);
689 yyextra->docBlock+=yytext;
693 yyextra->contLineNr++;
698 yyextra->contLineNr--;
703<*>"!"[^><\n].*|"!"$ {
718<*>"assignment"/{BS}"("{BS}"="{BS}")" {
724<*>"operator"/{BS}"("[^)]*")" {
734 yyextra->contLineNr++;
743 yyextra->code->codify(yytext);
746 yyextra->insideBody=
true;
748 yyextra->insideBody=
false;
752 yyextra->contLineNr++;
753 yyextra->str+=yytext;
762 yyextra->str+=yytext;
768<String>[\x80-\xFF]* |
769<String>. {yyextra->str+=yytext;}
774 yy_push_state(YY_START,yyscanner);
775 yyextra->stringStartSymbol=yytext[0];
782 if (yyextra->endComment)
784 yyextra->endComment=
false;
790 if (yyextra->currentFontClass && !strcmp(yyextra->currentFontClass,
"comment"))
endFontClass(yyscanner);
792 yyextra->contLineNr++;
795<*>^{BS}"type"{BS}"=" { yyextra->code->codify(yytext); }
798 if (yyextra->isFixedForm &&
yy_my_start > yyextra->fixedCommentAfter)
805 yyextra->code->codify(yytext);
809 if (yyextra->isFixedForm &&
yy_my_start > yyextra->fixedCommentAfter)
819 yyextra->code->codify(yytext);
823 yyextra->code->codify(yytext);
826 if (YY_START == DocBlock)
842 int inputPosition = yyextra->inputPosition;
843 const char *s = yyextra->inputString + inputPosition;
845 while( c < max_size && *s)
850 yyextra->inputPosition += c;
857 if (yyextra->currentFontClass)
859 yyextra->code->endFontClass();
860 yyextra->currentFontClass=
nullptr;
862 if (specialComment && yyextra->insideSpecialComment)
864 yyextra->code->endSpecialComment();
865 yyextra->insideSpecialComment=
false;
874 yyextra->code->startSpecialComment();
875 yyextra->insideSpecialComment =
true;
878 if (
dstrcmp(yyextra->currentFontClass,s)!=0)
881 yyextra->code->startFontClass(s);
882 yyextra->currentFontClass=s;
891 if (yyextra->searchCtx)
915 while (!yyextra->foldStack.empty())
917 const Definition *dd = yyextra->foldStack.back();
920 yyextra->code->endFold();
922 yyextra->foldStack.pop_back();
933 if (endLine!=-1 && startLine!=endLine &&
941 (yyextra->foldStack.empty() || yyextra->foldStack.back()->getEndBodyLine()!=startLine))
944 yyextra->code->startFold(yyextra->yyLineNr,
"",
"");
945 yyextra->foldStack.push_back(d);
958 if (yyextra->sourceFileDef && yyextra->lineNumbers)
964 const Definition *d = yyextra->sourceFileDef->getSourceDefinition(yyextra->yyLineNr);
966 if (!yyextra->includeCodeFragment && d)
968 yyextra->currentDefinition = d;
969 yyextra->currentMemberDef = yyextra->sourceFileDef->getSourceMember(yyextra->yyLineNr);
970 yyextra->insideBody =
false;
971 yyextra->endComment =
false;
973 lineAnchor.
sprintf(
"l%05d",yyextra->yyLineNr);
974 if (yyextra->currentMemberDef)
977 yyextra->code->writeLineNumber(yyextra->currentMemberDef->getReference(),
978 yyextra->currentMemberDef->getOutputFileBase(),
979 yyextra->currentMemberDef->anchor(),yyextra->yyLineNr,
980 !yyextra->includeCodeFragment);
989 !yyextra->includeCodeFragment);
1001 !yyextra->includeCodeFragment);
1004 yyextra->code->startCodeLine(yyextra->yyLineNr);
1005 yyextra->insideCodeLine=
true;
1006 if (yyextra->currentFontClass)
1008 yyextra->code->startFontClass(yyextra->currentFontClass);
1017 yyextra->code->endCodeLine();
1018 yyextra->insideCodeLine=
false;
1024 const char * fc = yyextra->currentFontClass;
1026 if (yyextra->yyLineNr<yyextra->inputLines)
1028 yyextra->currentFontClass = fc;
1040 if (text.
empty())
return;
1041 const char *p=text.
data(),*sp=p;
1047 while ((c=*p++) && c!=
'\n') { }
1050 yyextra->yyLineNr++;
1051 size_t l =
static_cast<size_t>(p-sp-1);
1052 yyextra->code->codify(
DString(sp,l));
1057 yyextra->code->codify(sp);
1072 yyextra->tooltipManager.addTooltip(d);
1077 if (!sourceTooltips)
1082 const char *p=text.
data();
1087 while ((c=*p++) && c!=
'\n') { }
1090 yyextra->yyLineNr++;
1113 if (mname.
empty())
return false;
1132 if (tname.
empty())
return false;
1149 for (
const auto &[name,useEntry] : useMap)
1175 if (memberName.
empty())
return nullptr;
1178 for (
auto it = yyextra->scopeStack.rbegin(); it!=yyextra->scopeStack.rend(); ++it)
1180 const Scope &scope = *it;
1181 std::string lowMemName = memberName.
lower().
str();
1199 for (
const auto &md : *mn)
1201 const FileDef *fd=md->getFileDef();
1202 const GroupDef *gd=md->getGroupDef();
1203 const ClassDef *cd=md->getClassDef();
1212 if (nspace ==
nullptr)
1216 if (md.get()->getFileDef() == yyextra->sourceFileDef)
return md.get();
1217 else if (!potentialMd) potentialMd = md.get();
1220 else if (moduleName == nspace->
name())
1227 auto use_it = useMap.find(usedModuleName.
str());
1228 if (use_it!=useMap.end())
1230 const UseEntry &ue = use_it->second;
1242 if (memberName == name)
1286 if (yyextra->currentDefinition && yyextra->currentMemberDef &&
1287 yyextra->insideBody && yyextra->collectXRefs)
1329 else if (
getLink(yyscanner,yyextra->useMembers, name, ol, name))
1347 const char *p=yyextra->inputString;
1353 if (c==
'\n') count++;
1355 if (p>yyextra->inputString && *(p-1)!=
'\n')
1368 DBG_CTX((stderr,
"===> startScope %s",yytext));
1369 yyextra->scopeStack.emplace_back();
1376 DBG_CTX((stderr,
"===> endScope %s",yytext));
1377 if (yyextra->scopeStack.empty())
1379 DBG_CTX((stderr,
"WARNING: fortrancode.l: stack empty!\n"));
1383 Scope &scope = yyextra->scopeStack.back();
1384 for (
const auto &name : scope.
useNames)
1386 yyextra->useMembers.erase(name.str());
1388 yyextra->scopeStack.pop_back();
1394 if (!yyextra->scopeStack.empty())
1395 yyextra->scopeStack.back().useNames.push_back(moduleName);
1401 if (!yyextra->scopeStack.empty())
1403 std::string lowVarName = varName.
lower().
str();
1404 yyextra->scopeStack.back().localVars.insert(lowVarName);
1405 if (yyextra->isExternal) yyextra->scopeStack.back().externalVars.insert(lowVarName);
1422 if (*p ==
'\n') numLines++;
1426 yyextra->hasContLine = (
int *) malloc((numLines) *
sizeof(
int));
1427 for (i = 0; i < numLines; i++)
1429 yyextra->hasContLine[i] = 0;
1432 yyextra->hasContLine[0] = 0;
1436 bool ,
const char *,
const FileDef *,
1458 fortrancodeYYlex_init_extra(&
p->state,&
p->yyscanner);
1467 fortrancodeYYlex_destroy(
p->yyscanner);
1473 yyextra->currentDefinition =
nullptr;
1474 yyextra->currentMemberDef =
nullptr;
1475 yyextra->currentFontClass =
nullptr;
1476 yyextra->insideCodeLine =
false;
1484 bool stripCodeComments,
1490 if (input.
empty())
return;
1493 yyextra->code = &codeOutIntf;
1494 yyextra->inputString = input.
data();
1495 yyextra->inputPosition = 0;
1498 yyextra->contLineNr = 1;
1499 yyextra->hasContLine =
nullptr;
1500 if (yyextra->isFixedForm)
1503 yyextra->fixedCommentAfter =
Config_getInt(FORTRAN_COMMENT_AFTER);
1505 yyextra->currentFontClass =
nullptr;
1506 yyextra->insideCodeLine =
false;
1507 yyextra->searchCtx = options.
searchCtx();
1511 yyextra->exampleBlock = options.
isExample();
1513 yyextra->sourceFileDef = options.
fileDef();
1515 yyextra->foldStack.clear();
1516 yyextra->insideSpecialComment =
false;
1521 yyextra->sourceFileDef = yyextra->exampleFileDef.get();
1523 if (yyextra->sourceFileDef)
1527 yyextra->currentDefinition =
nullptr;
1528 yyextra->currentMemberDef =
nullptr;
1529 if (!yyextra->exampleName.empty())
1535 fortrancodeYYrestart(
nullptr, yyscanner);
1537 fortrancodeYYlex(yyscanner);
1538 if (yyextra->insideCodeLine)
1544 while (!yyextra->foldStack.empty())
1546 yyextra->code->endFold();
1547 yyextra->foldStack.pop_back();
1550 if (yyextra->exampleFileDef)
1553 yyextra->exampleFileDef.reset();
1554 yyextra->sourceFileDef=
nullptr;
1556 if (yyextra->hasContLine) free(yyextra->hasContLine);
1557 yyextra->hasContLine =
nullptr;
1560 yyextra->tooltipManager.writeTooltips(codeOutIntf);
1566 if ( yyg->yy_start_stack_ptr <= 0 )
1567 warn(yyextra->fileName,yyextra->yyLineNr,
"Unexpected statement '{}'",yytext );
1569 yy_pop_state(yyscanner);
1573#include "fortrancode.l.h"
virtual CompoundType compoundType() const =0
Returns the type of compound this is, i.e. class/struct/union/...
bool empty() const
Returns true iff the string is empty (std::string compatible alias for isEmpty()).
DString & sprintf(const char *format,...)
const std::string & str() const
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)
virtual int getEndBodyLine() const =0
virtual SrcLangExt getLanguage() const =0
Returns the programming language this definition was written in.
virtual bool isLinkable() const =0
virtual const DString & name() const =0
virtual DString briefDescriptionAsTooltip() const =0
virtual const FileDef * getBodyDef() const =0
virtual bool isLinkableInProject() const =0
virtual DString anchor() const =0
virtual int getStartDefLine() const =0
virtual DString getReference() const =0
virtual CodeSymbolType codeSymbolType() const =0
virtual Definition * getOuterScope() const =0
virtual DString getOutputFileBase() const =0
static NamespaceLinkedMap * namespaceLinkedMap
static ClassLinkedMap * classLinkedMap
static MemberNameLinkedMap * functionNameLinkedMap
static NamespaceDefMutable * globalScope
static MemberNameLinkedMap * memberNameLinkedMap
static SearchIndexIntf searchIndex
virtual DString fileName() const =0
void parseCode(OutputCodeList &codeOutIntf, const DString &scopeName, const DString &input, SrcLangExt lang, bool stripCodeComments, const CodeParserOptions &options) override
Parses a source file or fragment with the goal to produce highlighted and cross-referenced output.
void resetCodeParserState() override
Resets the state of the code parser.
FortranCodeParser(FortranFormat format=FortranFormat::Unknown)
std::unique_ptr< Private > p
~FortranCodeParser() override
A model of a group of symbols.
const T * find(const std::string &key) const
virtual GroupDef * getGroupDef()=0
virtual bool isVariable() const =0
void writeCodeLink(CodeSymbolType type, const DString &ref, const DString &file, const DString &anchor, const DString &name, const DString &tooltip)
void stripCodeComments(bool b)
void addWord(const DString &word, bool hiPriority)
void setCurrentDoc(const Definition *ctx, const DString &anchor, bool isSourceFile)
#define Config_getInt(name)
#define Config_getBool(name)
int dstrcmp(const char *str1, const char *str2)
const char * qPrint(const char *s)
std::unique_ptr< FileDef > createFileDef(const DString &p, const DString &n, const DString &ref, const DString &dn)
void parseFortranCode(OutputCodeList &, const char *, const DString &, bool, const char *, const FileDef *, int, int, bool, const MemberDef *, bool, const Definition *, bool, FortranFormat)
static void checkContLines(yyscan_t yyscanner, const char *s)
static void codeFolding(yyscan_t yyscanner, const Definition *d)
const char * prepassFixedForm(const char *contents, int *hasContLine, int fixedCommentAfter)
bool recognizeFixedForm(const DString &contents, FortranFormat format)
void addDocCrossReference(const MemberDef *s, const MemberDef *d)
#define warn(file, line, fmt,...)
Options to configure the code parser.
const Definition * searchCtx() const
DString exampleName() const
const FileDef * fileDef() const
bool showLineNumbers() const
bool inlineFragment() const
bool collectXRefs() const
fortrancodeYY_state state
DString convertNameToFile(const DString &name, bool allowDots, bool allowUnderscore)