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
71#define DBG_CTX(x) do { } while(0)
73#define YY_NO_TOP_STATE 1
75#define YY_NO_UNISTD_H 1
87#define YY_USER_ACTION {yy_old_start = yy_my_start; yy_my_start = yy_end; yy_end += static_cast<int>(yyleng);}
88#define YY_FTN_RESET {yy_old_start = 0; yy_my_start = 0; yy_end = 1;}
89#define YY_FTN_REJECT {yy_end = yy_my_start; yy_my_start = yy_old_start; REJECT;}
107class UseMap :
public std::map<std::string,UseEntry>
219#define YY_INPUT(buf,result,max_size) result=yyread(yyscanner,buf,max_size);
A abstract class representing of a compound symbol.
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.
This is an alternative implementation of QCString.
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< QCString > useNames
contains names of used modules
std::vector< QCString > 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 startScope(yyscan_t yyscanner)
start scope
static bool getGenericProcedureLink(yyscan_t yyscanner, const ClassDef *cd, const QCString &memberText, OutputCodeList &ol)
gets the link to a generic procedure which depends not on the name, but on the parameter list
static void endCodeLine(yyscan_t yyscanner)
static bool getFortranTypeDefs(const QCString &tname, const QCString &moduleName, ClassDef *&cd, const UseMap &useMap)
searches for definition of a type
static void endScope(yyscan_t yyscanner)
end scope
static void nextCodeLine(yyscan_t yyscanner)
static void startCodeLine(yyscan_t yyscanner)
static void codifyLines(yyscan_t yyscanner, const QCString &text)
static bool getFortranNamespaceDefs(const QCString &mname, NamespaceDef *&cd)
searches for definition of a module (Namespace)
static int yyread(yyscan_t yyscanner, char *buf, int max_size)
static int countLines(yyscan_t yyscanner)
static void addToSearchIndex(yyscan_t yyscanner, const QCString &text)
static const char * stateToString(int state)
static void pop_state(yyscan_t yyscanner)
static void addUse(yyscan_t yyscanner, const QCString &moduleName)
static MemberDef * getFortranDefs(yyscan_t yyscanner, const QCString &memberName, const QCString &moduleName, const UseMap &useMap)
searches for definition of function memberName
static void startFontClass(yyscan_t yyscanner, const char *s, bool specialComment=false)
static void endFontClass(yyscan_t yyscanner, bool specialComment=false)
static bool getLink(yyscan_t yyscanner, const UseMap &useMap, const QCString &memberText, OutputCodeList &ol, const QCString &text)
static const char * getLexerFILE()
static void addLocalVar(yyscan_t yyscanner, const QCString &varName)
static void setCurrentDoc(yyscan_t yyscanner, const QCString &anchor)
static void generateLink(yyscan_t yyscanner, OutputCodeList &ol, const QCString &lname)
static void writeMultiLineCodeLink(yyscan_t yyscanner, OutputCodeList &ol, Definition *d, const QCString &text)
Web server based search engine.
TooltipManager tooltipManager
bool insideSpecialComment
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
QCString docBlock
contents of all lines of a documentation block
int inputPosition
read offset during parsing
std::vector< Scope > scopeStack
std::unique_ptr< FileDef > exampleFileDef
const FileDef * sourceFileDef
QCString str
contents of fortran string
const MemberDef * currentMemberDef
const Definition * searchCtx
UseEntry useEntry
current use statement info
QCString 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.
229SUBPROG (subroutine|function)
234ARGS_L1a [^()]*"("[^)]*")"[^)]*
235ARGS_L1 ("("{ARGS_L1a}*")")
236ARGS_L2 "("({ARGS_L0}|[^()]|{ARGS_L1a}|{ARGS_L1})*")"
237ARGS {BS}({ARGS_L0}|{ARGS_L1}|{ARGS_L2})
239NUM_TYPE (complex|integer|logical|real)
240LOG_OPER (\.and\.|\.eq\.|\.eqv\.|\.ge\.|\.gt\.|\.le\.|\.lt\.|\.ne\.|\.neqv\.|\.or\.|\.not\.)
242CHAR (CHARACTER{ARGS}?|CHARACTER{BS}"*"({BS}[0-9]+|{ARGS}))
243TYPE_SPEC (({NUM_TYPE}({BS}"*"{BS}[0-9]+)?)|({NUM_TYPE}{KIND})|DOUBLE{BS}COMPLEX|DOUBLE{BS}PRECISION|{CHAR}|TYPE|CLASS|PROCEDURE|ENUMERATOR)
245INTENT_SPEC intent{BS}"("{BS}(in|out|in{BS}out){BS}")"
246ATTR_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)
247ACCESS_SPEC (PROTECTED|PRIVATE|PUBLIC)
249FLOW (DO|SELECT|CASE|SELECT{BS}(CASE|TYPE|RANK)|WHERE|IF|THEN|ELSE|WHILE|FORALL|ELSEWHERE|ELSEIF|RETURN|CONTINUE|EXIT|GO{BS}TO)
250COMMANDS (FORMAT|CONTAINS|MODULE{BS_}PROCEDURE|WRITE|READ|ALLOCATE|ALLOCATED|ASSOCIATED|PRESENT|DEALLOCATE|NULLIFY|SIZE|INQUIRE|OPEN|CLOSE|FLUSH|DATA|COMMON)
252PREFIX ((NON_)?RECURSIVE{BS_}|IMPURE{BS_}|PURE{BS_}|ELEMENTAL{BS_}){0,4}((NON_)?RECURSIVE|IMPURE|PURE|ELEMENTAL)?0
253LANGUAGE_BIND_SPEC BIND{BS}"("{BS}C{BS}(,{BS}NAME{BS}"="{BS}"\""(.*)"\""{BS})?")"
281<Start>{IGNORE}/{BS}"(" {
static void codifyLines(yyscan_t yyscanner, const QCString &text)
286<Start>{COMMANDS}/{BS}[,( \t\n] {
static void startFontClass(yyscan_t yyscanner, const char *s, bool specialComment=false)
static void endFontClass(yyscan_t yyscanner, bool specialComment=false)
292<Start>{FLOW}/{BS}[,( \t\n] {
293 if (yyextra->isFixedForm)
297 if (yyextra->currentMemberDef && yyextra->currentMemberDef->isFunction())
static std::mutex countFlowKeywordsMutex
virtual void incrementFlowKeyWordCount()=0
MemberDefMutable * toMemberDefMutable(Definition *d)
311<Start>{BS}(RANK){BS_}(DEFAULT) |
312<Start>{BS}(RANK)/{BS}"("{BS}([0-9]+|"*"){BS}")" |
313<Start>{BS}(CASE|CLASS|TYPE){BS_}(IS|DEFAULT) {
318<Start>{BS}"end"({BS}{FLOW})/[ \t\n] {
323<Start>"implicit"{BS}("none"|{TYPE_SPEC}) {
328<Start>^{BS}"namelist"/[/] {
338 yy_push_state(YY_START,yyscanner);
345 yy_push_state(YY_START,yyscanner);
351 yyextra->insideBody=
TRUE;
353 yyextra->insideBody=
FALSE;
357 yyextra->useEntry.module = tmp;
358 yyextra->useMembers.emplace(tmp.str(), yyextra->useEntry);
361<Use,UseOnly,Import>{BS},{BS} {
codifyLines(yyscanner,yytext); }
362<UseOnly,Import>{BS}&{BS}"\n" {
codifyLines(yyscanner,yytext);
363 yyextra->contLineNr++;
368 yyextra->useEntry.onlyNames.push_back(tmp);
369 yyextra->insideBody=
TRUE;
371 yyextra->insideBody=
FALSE;
373<Use,UseOnly,Import>"\n" {
378<*>"import"{BS}/"\n" |
384 yy_push_state(YY_START,yyscanner);
388 yyextra->insideBody=
TRUE;
390 yyextra->insideBody=
FALSE;
392<Import>("ONLY"|"NONE"|"ALL") {
398<Start>("block"{BS}"data"|"program"|"module"|"interface")/{BS_}|({COMMA}{ACCESS_SPEC})|\n {
403 yy_push_state(YY_START,yyscanner);
405 if (!
qstricmp(yytext,
"module")) yyextra->currentModule=
"module";
int qstricmp(const char *s1, const char *s2)
407<Start>("enum")/{BS_}|{BS}{COMMA}{BS}{LANGUAGE_BIND_SPEC}|\n {
412 yy_push_state(YY_START,yyscanner);
415<*>{LANGUAGE_BIND_SPEC} {
421<Start>("type")/{BS_}|({COMMA}({ACCESS_SPEC}|ABSTRACT|EXTENDS))|\n {
426 yy_push_state(YY_START,yyscanner);
430 if (yyextra->currentModule ==
"module")
432 yyextra->currentModule=yytext;
433 yyextra->currentModule = yyextra->currentModule.lower();
438<ClassName>({ACCESS_SPEC}|ABSTRACT|EXTENDS)/[,:( ] {
440 yyextra->code->codify(yytext);
447<Start>^{BS}"end"({BS_}"enum").* {
450<Start>^{BS}"end"({BS_}"type").* {
453<Start>^{BS}"end"({BS_}"module").* {
454 yyextra->currentModule=
nullptr;
458<Start>({PREFIX}{BS_})?{TYPE_SPEC}{BS_}({PREFIX}{BS_})?{BS}/{SUBPROG}{BS_} {
463<Start>({PREFIX}{BS_})?{SUBPROG}{BS_} {
467 yy_push_state(YY_START,yyscanner);
471 DBG_CTX((stderr,
"===> start subprogram %s\n", yytext));
475<Subprog>"result"/{BS}"("[^)]*")" {
480<Subprog>"("[^)]*")" {
483<Subprog,Subprogend>"\n" {
codifyLines(yyscanner,yytext);
484 yyextra->contLineNr++;
488<Start>"end"{BS}("block"{BS}"data"|{SUBPROG}|"module"|"program"|"enum"|"type"|"interface")?{BS} {
494 yy_push_state(YY_START,yyscanner);
497<Subprogend>{ID}/{BS}(\n|!|;) {
501<Start>"end"{BS}("block"{BS}"data"|{SUBPROG}|"module"|"program"|"enum"|"type"|"interface"){BS}/(\n|!|;) {
509<Start>^{BS}"real"/[,:( ] {
510 yy_push_state(YY_START,yyscanner);
513 yyextra->code->codify(yytext);
516<Start>{TYPE_SPEC}/[,:( ] {
520 if (typ ==
"type" || typ ==
"class" || typ ==
"procedure") yyextra->inTypeDecl = 1;
521 yy_push_state(YY_START,yyscanner);
524 yyextra->code->codify(yytext);
QCString removeRedundantWhiteSpace(const QCString &s)
530 yy_push_state(YY_START,yyscanner);
532 yyextra->isExternal =
true;
535 yyextra->code->codify(yytext);
538<Declaration>({TYPE_SPEC}|{ATTR_SPEC})/[,:( ] {
539 if (
QCString(yytext) ==
"external") yyextra->isExternal =
true;
541 yyextra->code->codify(yytext);
548 yyextra->code->codify(yytext);
551 else if (yyextra->currentMemberDef &&
552 ((yyextra->currentMemberDef->isFunction() && (yyextra->currentMemberDef->typeString()!=
QCString(
"subroutine") || yyextra->inTypeDecl)) ||
553 yyextra->currentMemberDef->isVariable() || yyextra->currentMemberDef->isEnumValue()
561 yyextra->code->codify(yytext);
565<Declaration>{BS}("=>"|"="){BS} {
566 BEGIN(DeclarationBinding);
567 yyextra->code->codify(yytext);
569<DeclarationBinding>{ID} {
574 yyextra->bracketCount++;
575 yyextra->code->codify(yytext);
579 yyextra->bracketCount--;
580 if (!yyextra->bracketCount) yyextra->inTypeDecl = 0;
581 yyextra->code->codify(yytext);
584<Declaration,DeclarationBinding>"&" {
585 yyextra->code->codify(yytext);
586 if (!yyextra->isFixedForm)
588 yy_push_state(YY_START,yyscanner);
593 yyextra->contLineNr++;
595 yyextra->bracketCount = 0;
599<Declaration,DeclarationBinding>"\n" {
600 if (yyextra->endComment)
602 yyextra->endComment=
FALSE;
608 yyextra->bracketCount = 0;
609 yyextra->contLineNr++;
610 if (!(yyextra->hasContLine && yyextra->hasContLine[yyextra->contLineNr - 1]))
612 yyextra->isExternal =
false;
624 yy_push_state(YY_START,yyscanner);
628 yyextra->insideBody=
TRUE;
630 yyextra->insideBody=
FALSE;
641 yy_push_state(YY_START,yyscanner);
646 yyextra->code->codify(
QCString(yytext + 4));
650 yyextra->insideBody=
TRUE;
652 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...
657<Start,Declaration,DeclarationBinding>\n?{BS}"!>"|"!<" {
658 if (yytext[0] ==
'\n')
660 yyextra->contLineNr++;
663 yy_end =
static_cast<int>(yyleng);
667 yy_push_state(YY_START,yyscanner);
669 yyextra->docBlock=yytext;
671<Declaration,DeclarationBinding>{BS}"!<" {
672 yy_push_state(YY_START,yyscanner);
674 yyextra->docBlock=yytext;
678 yyextra->docBlock+=yytext;
680<DocBlock>"\n"{BS}("!>"|"!<"|"!!") {
681 yyextra->contLineNr++;
684 yy_end =
static_cast<int>(yyleng);
687 yyextra->docBlock+=yytext;
691 yyextra->contLineNr++;
696 yyextra->contLineNr--;
701<*>"!"[^><\n].*|"!"$ {
716<*>"assignment"/{BS}"("{BS}"="{BS}")" {
722<*>"operator"/{BS}"("[^)]*")" {
732 yyextra->contLineNr++;
741 yyextra->code->codify(yytext);
744 yyextra->insideBody=
TRUE;
746 yyextra->insideBody=
FALSE;
750 yyextra->contLineNr++;
751 yyextra->str+=yytext;
760 yyextra->str+=yytext;
766<String>[\x80-\xFF]* |
767<String>. {yyextra->str+=yytext;}
772 yy_push_state(YY_START,yyscanner);
773 yyextra->stringStartSymbol=yytext[0];
780 if (yyextra->endComment)
782 yyextra->endComment=
FALSE;
788 if (yyextra->currentFontClass && !strcmp(yyextra->currentFontClass,
"comment"))
endFontClass(yyscanner);
790 yyextra->contLineNr++;
793<*>^{BS}"type"{BS}"=" { yyextra->code->codify(yytext); }
796 if (yyextra->isFixedForm &&
yy_my_start > yyextra->fixedCommentAfter)
803 yyextra->code->codify(yytext);
807 if (yyextra->isFixedForm &&
yy_my_start > yyextra->fixedCommentAfter)
817 yyextra->code->codify(yytext);
821 yyextra->code->codify(yytext);
824 if (YY_START == DocBlock)
839 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
840 int inputPosition = yyextra->inputPosition;
841 const char *s = yyextra->inputString + inputPosition;
843 while( c < max_size && *s)
848 yyextra->inputPosition += c;
854 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
855 if (yyextra->currentFontClass)
857 yyextra->code->endFontClass();
858 yyextra->currentFontClass=
nullptr;
860 if (specialComment && yyextra->insideSpecialComment)
862 yyextra->code->endSpecialComment();
863 yyextra->insideSpecialComment=
false;
869 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
872 yyextra->code->startSpecialComment();
873 yyextra->insideSpecialComment =
true;
876 if (
qstrcmp(yyextra->currentFontClass,s)!=0)
879 yyextra->code->startFontClass(s);
880 yyextra->currentFontClass=s;
886 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
889 if (yyextra->searchCtx)
912 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
913 while (!yyextra->foldStack.empty())
915 const Definition *dd = yyextra->foldStack.back();
918 yyextra->code->endFold();
920 yyextra->foldStack.pop_back();
931 if (endLine!=-1 && startLine!=endLine &&
939 (yyextra->foldStack.empty() || yyextra->foldStack.back()->getEndBodyLine()!=startLine))
942 yyextra->code->startFold(yyextra->yyLineNr,
"",
"");
943 yyextra->foldStack.push_back(d);
955 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
956 if (yyextra->sourceFileDef)
962 const Definition *d = yyextra->sourceFileDef->getSourceDefinition(yyextra->yyLineNr);
964 if (!yyextra->includeCodeFragment && d)
966 yyextra->currentDefinition = d;
967 yyextra->currentMemberDef = yyextra->sourceFileDef->getSourceMember(yyextra->yyLineNr);
968 yyextra->insideBody =
FALSE;
969 yyextra->endComment =
FALSE;
971 lineAnchor.
sprintf(
"l%05d",yyextra->yyLineNr);
972 if (yyextra->currentMemberDef)
975 yyextra->code->writeLineNumber(yyextra->currentMemberDef->getReference(),
976 yyextra->currentMemberDef->getOutputFileBase(),
977 yyextra->currentMemberDef->anchor(),yyextra->yyLineNr,
978 !yyextra->includeCodeFragment);
987 !yyextra->includeCodeFragment);
999 !yyextra->includeCodeFragment);
1002 yyextra->code->startCodeLine(yyextra->yyLineNr);
1003 yyextra->insideCodeLine=
true;
1004 if (yyextra->currentFontClass)
1006 yyextra->code->startFontClass(yyextra->currentFontClass);
1013 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1015 yyextra->code->endCodeLine();
1016 yyextra->insideCodeLine=
false;
1021 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1022 const char * fc = yyextra->currentFontClass;
1024 if (yyextra->yyLineNr<yyextra->inputLines)
1026 yyextra->currentFontClass = fc;
1036 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1039 const char *p=text.
data(),*sp=p;
1045 while ((c=*p++) && c!=
'\n') { }
1048 yyextra->yyLineNr++;
1049 size_t l =
static_cast<size_t>(p-sp-1);
1050 yyextra->code->codify(
QCString(sp,l));
1055 yyextra->code->codify(sp);
1068 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1070 yyextra->tooltipManager.addTooltip(d);
1075 if (!sourceTooltips)
1080 const char *p=text.
data();
1085 while ((c=*p++) && c!=
'\n') { }
1088 yyextra->yyLineNr++;
1147 for (
const auto &[name,useEntry] : useMap)
1171 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1173 if (memberName.
isEmpty())
return nullptr;
1176 for (
auto it = yyextra->scopeStack.rbegin(); it!=yyextra->scopeStack.rend(); ++it)
1178 const Scope &scope = *it;
1179 std::string lowMemName = memberName.
lower().
str();
1197 for (
const auto &md : *mn)
1199 const FileDef *fd=md->getFileDef();
1200 const GroupDef *gd=md->getGroupDef();
1201 const ClassDef *cd=md->getClassDef();
1210 if (nspace ==
nullptr)
1214 if (md.get()->getFileDef() == yyextra->sourceFileDef)
return md.get();
1215 else if (!potentialMd) potentialMd = md.get();
1218 else if (moduleName == nspace->
name())
1225 auto use_it = useMap.find(usedModuleName.
str());
1226 if (use_it!=useMap.end())
1228 const UseEntry &ue = use_it->second;
1240 if (memberName == name)
1270 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1284 if (yyextra->currentDefinition && yyextra->currentMemberDef &&
1285 yyextra->insideBody && yyextra->collectXRefs)
1300 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1327 else if (
getLink(yyscanner,yyextra->useMembers, name, ol, name))
1344 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1345 const char *p=yyextra->inputString;
1351 if (c==
'\n') count++;
1353 if (p>yyextra->inputString && *(p-1)!=
'\n')
1365 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1366 DBG_CTX((stderr,
"===> startScope %s",yytext));
1367 yyextra->scopeStack.emplace_back();
1373 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1374 DBG_CTX((stderr,
"===> endScope %s",yytext));
1375 if (yyextra->scopeStack.empty())
1377 DBG_CTX((stderr,
"WARNING: fortrancode.l: stack empty!\n"));
1381 Scope &scope = yyextra->scopeStack.back();
1382 for (
const auto &name : scope.
useNames)
1384 yyextra->useMembers.erase(name.str());
1386 yyextra->scopeStack.pop_back();
1391 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1392 if (!yyextra->scopeStack.empty())
1393 yyextra->scopeStack.back().
useNames.push_back(moduleName);
1398 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1399 if (!yyextra->scopeStack.empty())
1401 std::string lowVarName = varName.
lower().
str();
1402 yyextra->scopeStack.back().localVars.insert(lowVarName);
1403 if (yyextra->isExternal) yyextra->scopeStack.back().externalVars.insert(lowVarName);
1412 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1420 if (*p ==
'\n') numLines++;
1424 yyextra->hasContLine = (
int *) malloc((numLines) *
sizeof(
int));
1425 for (i = 0; i < numLines; i++)
1427 yyextra->hasContLine[i] = 0;
1430 yyextra->hasContLine[0] = 0;
1434 bool ,
const char *,
const FileDef *,
1456 fortrancodeYYlex_init_extra(&
p->state,&
p->yyscanner);
1465 fortrancodeYYlex_destroy(
p->yyscanner);
1470 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
1471 yyextra->currentDefinition =
nullptr;
1472 yyextra->currentMemberDef =
nullptr;
1473 yyextra->currentFontClass =
nullptr;
1474 yyextra->insideCodeLine =
FALSE;
1482 bool stripCodeComments,
1483 bool isExampleBlock,
1488 bool inlineFragment,
1496 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
1508 yyextra->code = &codeOutIntf;
1509 yyextra->inputString = input.
data();
1510 yyextra->inputPosition = 0;
1511 yyextra->fileName = fileDef ? fileDef->
fileName():
"";
1513 yyextra->contLineNr = 1;
1514 yyextra->hasContLine =
nullptr;
1515 if (yyextra->isFixedForm)
1518 yyextra->fixedCommentAfter =
Config_getInt(FORTRAN_COMMENT_AFTER);
1520 yyextra->currentFontClass =
nullptr;
1521 yyextra->insideCodeLine =
FALSE;
1522 yyextra->searchCtx = searchCtx;
1523 yyextra->collectXRefs = collectXRefs;
1525 yyextra->yyLineNr = startLine;
1527 yyextra->yyLineNr = 1;
1530 yyextra->inputLines = endLine+1;
1532 yyextra->inputLines = yyextra->yyLineNr +
countLines(yyscanner) - 1;
1534 yyextra->exampleBlock = isExampleBlock;
1535 yyextra->exampleName = exampleName;
1536 yyextra->sourceFileDef = fileDef;
1537 yyextra->foldStack.clear();
1538 yyextra->insideSpecialComment =
false;
1539 if (isExampleBlock && fileDef==
nullptr)
1543 yyextra->sourceFileDef = yyextra->exampleFileDef.get();
1545 if (yyextra->sourceFileDef)
1549 yyextra->currentDefinition =
nullptr;
1550 yyextra->currentMemberDef =
nullptr;
1551 if (!yyextra->exampleName.isEmpty())
1555 yyextra->includeCodeFragment = inlineFragment;
1557 fortrancodeYYrestart(
nullptr, yyscanner);
1559 fortrancodeYYlex(yyscanner);
1560 if (yyextra->insideCodeLine)
1566 while (!yyextra->foldStack.empty())
1568 yyextra->code->endFold();
1569 yyextra->foldStack.pop_back();
1572 if (!fileDef && isExampleBlock && yyextra->sourceFileDef)
1575 yyextra->exampleFileDef.reset();
1576 yyextra->sourceFileDef=
nullptr;
1578 if (yyextra->hasContLine) free(yyextra->hasContLine);
1579 yyextra->hasContLine =
nullptr;
1582 yyextra->tooltipManager.writeTooltips(codeOutIntf);
1587 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1588 if ( yyg->yy_start_stack_ptr <= 0 )
1589 warn(yyextra->fileName,yyextra->yyLineNr,
"Unexpected statement '{}'",yytext );
1591 yy_pop_state(yyscanner);
1595#include "fortrancode.l.h"
virtual CompoundType compoundType() const =0
Returns the type of compound this is, i.e.
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 QCString anchor() const =0
virtual QCString briefDescriptionAsTooltip() const =0
virtual const FileDef * getBodyDef() const =0
virtual bool isLinkableInProject() const =0
virtual int getStartDefLine() const =0
virtual QCString getReference() const =0
virtual CodeSymbolType codeSymbolType() const =0
virtual QCString getOutputFileBase() const =0
virtual Definition * getOuterScope() const =0
virtual const QCString & name() const =0
static NamespaceLinkedMap * namespaceLinkedMap
static ClassLinkedMap * classLinkedMap
static MemberNameLinkedMap * functionNameLinkedMap
static NamespaceDefMutable * globalScope
static MemberNameLinkedMap * memberNameLinkedMap
static SearchIndexIntf searchIndex
virtual QCString fileName() const =0
void resetCodeParserState() override
Resets the state of the code parser.
FortranCodeParser(FortranFormat format=FortranFormat::Unknown)
std::unique_ptr< Private > p
void parseCode(OutputCodeList &codeOutIntf, const QCString &scopeName, const QCString &input, SrcLangExt lang, bool stripCodeComments, bool isExampleBlock, const QCString &exampleName=QCString(), const FileDef *fileDef=nullptr, int startLine=-1, int endLine=-1, bool inlineFragment=FALSE, const MemberDef *memberDef=nullptr, bool showLineNumbers=TRUE, const Definition *searchCtx=nullptr, bool collectXRefs=TRUE) override
Parses a source file or fragment with the goal to produce highlighted and cross-referenced output.
~FortranCodeParser() override
A model of a group of symbols.
virtual GroupDef * getGroupDef()=0
virtual bool isVariable() const =0
void writeCodeLink(CodeSymbolType type, const QCString &ref, const QCString &file, const QCString &anchor, const QCString &name, const QCString &tooltip)
void stripCodeComments(bool b)
bool isEmpty() const
Returns TRUE iff the string is empty.
const std::string & str() const
QCString & sprintf(const char *format,...)
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string.
static void writeMultiLineCodeLink(yyscan_t yyscanner, OutputCodeList &ol, const Definition *d, const QCString &text)
static void endCodeLine(yyscan_t yyscanner)
static void nextCodeLine(yyscan_t yyscanner)
static void startCodeLine(yyscan_t yyscanner)
static int yyread(yyscan_t yyscanner, char *buf, int max_size)
static int countLines(yyscan_t yyscanner)
static void addToSearchIndex(yyscan_t yyscanner, const QCString &text)
static bool getLink(yyscan_t yyscanner, const QCString &className, const QCString &memberName, OutputCodeList &ol, const QCString &text=QCString(), bool varOnly=FALSE)
static void setCurrentDoc(yyscan_t yyscanner, const QCString &anchor)
static void codeFolding(yyscan_t yyscanner, const Definition *d)
#define Config_getInt(name)
#define Config_getBool(name)
std::unique_ptr< FileDef > createFileDef(const QCString &p, const QCString &n, const QCString &ref, const QCString &dn)
static void checkContLines(yyscan_t yyscanner, const char *s)
void parseFortranCode(OutputCodeList &, const char *, const QCString &, bool, const char *, const FileDef *, int, int, bool, const MemberDef *, bool, const Definition *, bool, FortranFormat)
const char * prepassFixedForm(const char *contents, int *hasContLine, int fixedCommentAfter)
void addDocCrossReference(const MemberDef *s, const MemberDef *d)
#define warn(file, line, fmt,...)
const char * qPrint(const char *s)
int qstrcmp(const char *str1, const char *str2)
fortrancodeYY_state state
bool recognizeFixedForm(const QCString &contents, FortranFormat format)
QCString convertNameToFile(const QCString &name, bool allowDots, bool allowUnderscore)