26%option never-interactive
27%option case-insensitive
29%option prefix="fortrancodeYY"
30%option extra-type="struct fortrancodeYY_state *"
35#define YY_TYPEDEF_YY_SCANNER_T
69#define DBG_CTX(x) do { } while(0)
71#define YY_NO_TOP_STATE 1
73#define YY_NO_UNISTD_H 1
85#define YY_USER_ACTION {yy_old_start = yy_my_start; yy_my_start = yy_end; yy_end += static_cast<int>(yyleng);}
86#define YY_FTN_RESET {yy_old_start = 0; yy_my_start = 0; yy_end = 1;}
87#define YY_FTN_REJECT {yy_end = yy_my_start; yy_my_start = yy_old_start; REJECT;}
105class UseMap :
public std::map<std::string,UseEntry>
217#define YY_INPUT(buf,result,max_size) result=yyread(yyscanner,buf,max_size);
220static inline const char *
getLexerFILE() {
return __FILE__;}
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...
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 void codifyLines(yyscan_t yyscanner, const QCString &text)
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 bool getLink(yyscan_t yyscanner, const QCString &className, const QCString &memberName, OutputCodeList &ol, const QCString &text=QCString(), bool varOnly=FALSE)
static void startFontClass(yyscan_t yyscanner, const char *s, bool specialComment=false)
static void endFontClass(yyscan_t yyscanner, bool specialComment=false)
static const char * getLexerFILE()
static void setCurrentDoc(yyscan_t yyscanner, const QCString &anchor)
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 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 bool getFortranNamespaceDefs(const QCString &mname, NamespaceDef *&cd)
searches for definition of a module (Namespace)
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 addLocalVar(yyscan_t yyscanner, const QCString &varName)
static void generateLink(yyscan_t yyscanner, OutputCodeList &ol, const QCString &lname)
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.
227SUBPROG (subroutine|function)
232ARGS_L1a [^()]*"("[^)]*")"[^)]*
233ARGS_L1 ("("{ARGS_L1a}*")")
234ARGS_L2 "("({ARGS_L0}|[^()]|{ARGS_L1a}|{ARGS_L1})*")"
235ARGS {BS}({ARGS_L0}|{ARGS_L1}|{ARGS_L2})
237NUM_TYPE (complex|integer|logical|real)
238LOG_OPER (\.and\.|\.eq\.|\.eqv\.|\.ge\.|\.gt\.|\.le\.|\.lt\.|\.ne\.|\.neqv\.|\.or\.|\.not\.)
240CHAR (CHARACTER{ARGS}?|CHARACTER{BS}"*"({BS}[0-9]+|{ARGS}))
241TYPE_SPEC (({NUM_TYPE}({BS}"*"{BS}[0-9]+)?)|({NUM_TYPE}{KIND})|DOUBLE{BS}COMPLEX|DOUBLE{BS}PRECISION|{CHAR}|TYPE|CLASS|PROCEDURE|ENUMERATOR)
243INTENT_SPEC intent{BS}"("{BS}(in|out|in{BS}out){BS}")"
244ATTR_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)
245ACCESS_SPEC (PROTECTED|PRIVATE|PUBLIC)
247FLOW (DO|SELECT|CASE|SELECT{BS}(CASE|TYPE|RANK)|WHERE|IF|THEN|ELSE|WHILE|FORALL|ELSEWHERE|ELSEIF|RETURN|CONTINUE|EXIT|GO{BS}TO)
248COMMANDS (FORMAT|CONTAINS|MODULE{BS_}PROCEDURE|WRITE|READ|ALLOCATE|ALLOCATED|ASSOCIATED|PRESENT|DEALLOCATE|NULLIFY|SIZE|INQUIRE|OPEN|CLOSE|FLUSH|DATA|COMMON)
250PREFIX ((NON_)?RECURSIVE{BS_}|IMPURE{BS_}|PURE{BS_}|ELEMENTAL{BS_}){0,4}((NON_)?RECURSIVE|IMPURE|PURE|ELEMENTAL)?0
251LANGUAGE_BIND_SPEC BIND{BS}"("{BS}C{BS}(,{BS}NAME{BS}"="{BS}"\""(.*)"\""{BS})?")"
279<Start>{IGNORE}/{BS}"(" {
284<Start>{COMMANDS}/{BS}[,( \t\n] {
290<Start>{FLOW}/{BS}[,( \t\n] {
291 if (yyextra->isFixedForm)
295 if (yyextra->currentMemberDef && yyextra->currentMemberDef->isFunction())
static std::mutex countFlowKeywordsMutex
virtual void incrementFlowKeyWordCount()=0
MemberDefMutable * toMemberDefMutable(Definition *d)
309<Start>{BS}(RANK){BS_}(DEFAULT) |
310<Start>{BS}(RANK)/{BS}"("{BS}([0-9]+|"*"){BS}")" |
311<Start>{BS}(CASE|CLASS|TYPE){BS_}(IS|DEFAULT) {
316<Start>{BS}"end"({BS}{FLOW})/[ \t\n] {
321<Start>"implicit"{BS}("none"|{TYPE_SPEC}) {
326<Start>^{BS}"namelist"/[/] {
336 yy_push_state(YY_START,yyscanner);
343 yy_push_state(YY_START,yyscanner);
349 yyextra->insideBody=
TRUE;
351 yyextra->insideBody=
FALSE;
355 yyextra->useEntry.module = tmp;
356 yyextra->useMembers.emplace(tmp.str(), yyextra->useEntry);
359<Use,UseOnly,Import>{BS},{BS} {
codifyLines(yyscanner,yytext); }
360<UseOnly,Import>{BS}&{BS}"\n" {
codifyLines(yyscanner,yytext);
361 yyextra->contLineNr++;
366 yyextra->useEntry.onlyNames.push_back(tmp);
367 yyextra->insideBody=
TRUE;
369 yyextra->insideBody=
FALSE;
371<Use,UseOnly,Import>"\n" {
376<*>"import"{BS}/"\n" |
382 yy_push_state(YY_START,yyscanner);
386 yyextra->insideBody=
TRUE;
388 yyextra->insideBody=
FALSE;
390<Import>("ONLY"|"NONE"|"ALL") {
396<Start>("block"{BS}"data"|"program"|"module"|"interface")/{BS_}|({COMMA}{ACCESS_SPEC})|\n {
401 yy_push_state(YY_START,yyscanner);
403 if (!
qstricmp(yytext,
"module")) yyextra->currentModule=
"module";
int qstricmp(const char *s1, const char *s2)
405<Start>("enum")/{BS_}|{BS}{COMMA}{BS}{LANGUAGE_BIND_SPEC}|\n {
410 yy_push_state(YY_START,yyscanner);
413<*>{LANGUAGE_BIND_SPEC} {
419<Start>("type")/{BS_}|({COMMA}({ACCESS_SPEC}|ABSTRACT|EXTENDS))|\n {
424 yy_push_state(YY_START,yyscanner);
428 if (yyextra->currentModule ==
"module")
430 yyextra->currentModule=yytext;
431 yyextra->currentModule = yyextra->currentModule.lower();
436<ClassName>({ACCESS_SPEC}|ABSTRACT|EXTENDS)/[,:( ] {
438 yyextra->code->codify(yytext);
445<Start>^{BS}"end"({BS_}"enum").* {
448<Start>^{BS}"end"({BS_}"type").* {
451<Start>^{BS}"end"({BS_}"module").* {
452 yyextra->currentModule=
nullptr;
456<Start>({PREFIX}{BS_})?{TYPE_SPEC}{BS_}({PREFIX}{BS_})?{BS}/{SUBPROG}{BS_} {
461<Start>({PREFIX}{BS_})?{SUBPROG}{BS_} {
465 yy_push_state(YY_START,yyscanner);
469 DBG_CTX((stderr,
"===> start subprogram %s\n", yytext));
473<Subprog>"result"/{BS}"("[^)]*")" {
478<Subprog>"("[^)]*")" {
481<Subprog,Subprogend>"\n" {
codifyLines(yyscanner,yytext);
482 yyextra->contLineNr++;
486<Start>"end"{BS}("block"{BS}"data"|{SUBPROG}|"module"|"program"|"enum"|"type"|"interface")?{BS} {
492 yy_push_state(YY_START,yyscanner);
495<Subprogend>{ID}/{BS}(\n|!|;) {
499<Start>"end"{BS}("block"{BS}"data"|{SUBPROG}|"module"|"program"|"enum"|"type"|"interface"){BS}/(\n|!|;) {
507<Start>^{BS}"real"/[,:( ] {
508 yy_push_state(YY_START,yyscanner);
511 yyextra->code->codify(yytext);
514<Start>{TYPE_SPEC}/[,:( ] {
518 if (typ ==
"type" || typ ==
"class" || typ ==
"procedure") yyextra->inTypeDecl = 1;
519 yy_push_state(YY_START,yyscanner);
522 yyextra->code->codify(yytext);
QCString removeRedundantWhiteSpace(const QCString &s)
528 yy_push_state(YY_START,yyscanner);
530 yyextra->isExternal =
true;
533 yyextra->code->codify(yytext);
536<Declaration>({TYPE_SPEC}|{ATTR_SPEC})/[,:( ] {
537 if (
QCString(yytext) ==
"external") yyextra->isExternal =
true;
539 yyextra->code->codify(yytext);
546 yyextra->code->codify(yytext);
549 else if (yyextra->currentMemberDef &&
550 ((yyextra->currentMemberDef->isFunction() && (yyextra->currentMemberDef->typeString()!=
QCString(
"subroutine") || yyextra->inTypeDecl)) ||
551 yyextra->currentMemberDef->isVariable() || yyextra->currentMemberDef->isEnumValue()
559 yyextra->code->codify(yytext);
563<Declaration>{BS}("=>"|"="){BS} {
564 BEGIN(DeclarationBinding);
565 yyextra->code->codify(yytext);
567<DeclarationBinding>{ID} {
572 yyextra->bracketCount++;
573 yyextra->code->codify(yytext);
577 yyextra->bracketCount--;
578 if (!yyextra->bracketCount) yyextra->inTypeDecl = 0;
579 yyextra->code->codify(yytext);
582<Declaration,DeclarationBinding>"&" {
583 yyextra->code->codify(yytext);
584 if (!yyextra->isFixedForm)
586 yy_push_state(YY_START,yyscanner);
591 yyextra->contLineNr++;
593 yyextra->bracketCount = 0;
597<Declaration,DeclarationBinding>"\n" {
598 if (yyextra->endComment)
600 yyextra->endComment=
FALSE;
606 yyextra->bracketCount = 0;
607 yyextra->contLineNr++;
608 if (!(yyextra->hasContLine && yyextra->hasContLine[yyextra->contLineNr - 1]))
610 yyextra->isExternal =
false;
622 yy_push_state(YY_START,yyscanner);
626 yyextra->insideBody=
TRUE;
628 yyextra->insideBody=
FALSE;
639 yy_push_state(YY_START,yyscanner);
644 yyextra->code->codify(
QCString(yytext + 4));
648 yyextra->insideBody=
TRUE;
650 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...
655<Start,Declaration,DeclarationBinding>\n?{BS}"!>"|"!<" {
656 if (yytext[0] ==
'\n')
658 yyextra->contLineNr++;
661 yy_end =
static_cast<int>(yyleng);
665 yy_push_state(YY_START,yyscanner);
667 yyextra->docBlock=yytext;
669<Declaration,DeclarationBinding>{BS}"!<" {
670 yy_push_state(YY_START,yyscanner);
672 yyextra->docBlock=yytext;
676 yyextra->docBlock+=yytext;
678<DocBlock>"\n"{BS}("!>"|"!<"|"!!") {
679 yyextra->contLineNr++;
682 yy_end =
static_cast<int>(yyleng);
685 yyextra->docBlock+=yytext;
689 yyextra->contLineNr++;
694 yyextra->contLineNr--;
699<*>"!"[^><\n].*|"!"$ {
714<*>"assignment"/{BS}"("{BS}"="{BS}")" {
720<*>"operator"/{BS}"("[^)]*")" {
730 yyextra->contLineNr++;
739 yyextra->code->codify(yytext);
742 yyextra->insideBody=
TRUE;
744 yyextra->insideBody=
FALSE;
748 yyextra->contLineNr++;
749 yyextra->str+=yytext;
758 yyextra->str+=yytext;
764<String>[\x80-\xFF]* |
765<String>. {yyextra->str+=yytext;}
770 yy_push_state(YY_START,yyscanner);
771 yyextra->stringStartSymbol=yytext[0];
778 if (yyextra->endComment)
780 yyextra->endComment=
FALSE;
786 if (yyextra->currentFontClass && !strcmp(yyextra->currentFontClass,
"comment"))
endFontClass(yyscanner);
788 yyextra->contLineNr++;
791<*>^{BS}"type"{BS}"=" { yyextra->code->codify(yytext); }
794 if (yyextra->isFixedForm &&
yy_my_start > yyextra->fixedCommentAfter)
801 yyextra->code->codify(yytext);
805 if (yyextra->isFixedForm &&
yy_my_start > yyextra->fixedCommentAfter)
815 yyextra->code->codify(yytext);
819 yyextra->code->codify(yytext);
822 if (YY_START == DocBlock)
837 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
838 int inputPosition = yyextra->inputPosition;
839 const char *s = yyextra->inputString + inputPosition;
841 while( c < max_size && *s)
846 yyextra->inputPosition += c;
852 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
853 if (yyextra->currentFontClass)
855 yyextra->code->endFontClass();
856 yyextra->currentFontClass=
nullptr;
858 if (specialComment && yyextra->insideSpecialComment)
860 yyextra->code->endSpecialComment();
861 yyextra->insideSpecialComment=
false;
867 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
870 yyextra->code->startSpecialComment();
871 yyextra->insideSpecialComment =
true;
874 if (
qstrcmp(yyextra->currentFontClass,s)!=0)
877 yyextra->code->startFontClass(s);
878 yyextra->currentFontClass=s;
884 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
887 if (yyextra->searchCtx)
910 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
911 while (!yyextra->foldStack.empty())
913 const Definition *dd = yyextra->foldStack.back();
916 yyextra->code->endFold();
918 yyextra->foldStack.pop_back();
929 if (endLine!=-1 && startLine!=endLine &&
937 (yyextra->foldStack.empty() || yyextra->foldStack.back()->getEndBodyLine()!=startLine))
940 yyextra->code->startFold(yyextra->yyLineNr,
"",
"");
941 yyextra->foldStack.push_back(d);
953 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
954 if (yyextra->sourceFileDef)
960 const Definition *d = yyextra->sourceFileDef->getSourceDefinition(yyextra->yyLineNr);
962 if (!yyextra->includeCodeFragment && d)
964 yyextra->currentDefinition = d;
965 yyextra->currentMemberDef = yyextra->sourceFileDef->getSourceMember(yyextra->yyLineNr);
966 yyextra->insideBody =
FALSE;
967 yyextra->endComment =
FALSE;
969 lineAnchor.
sprintf(
"l%05d",yyextra->yyLineNr);
970 if (yyextra->currentMemberDef)
973 yyextra->code->writeLineNumber(yyextra->currentMemberDef->getReference(),
974 yyextra->currentMemberDef->getOutputFileBase(),
975 yyextra->currentMemberDef->anchor(),yyextra->yyLineNr,
976 !yyextra->includeCodeFragment);
985 !yyextra->includeCodeFragment);
997 !yyextra->includeCodeFragment);
1000 yyextra->code->startCodeLine(yyextra->yyLineNr);
1001 yyextra->insideCodeLine=
true;
1002 if (yyextra->currentFontClass)
1004 yyextra->code->startFontClass(yyextra->currentFontClass);
1011 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1013 yyextra->code->endCodeLine();
1014 yyextra->insideCodeLine=
false;
1019 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1020 const char * fc = yyextra->currentFontClass;
1022 if (yyextra->yyLineNr<yyextra->inputLines)
1024 yyextra->currentFontClass = fc;
1034 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1037 const char *p=text.
data(),*sp=p;
1043 while ((c=*p++) && c!=
'\n') { }
1046 yyextra->yyLineNr++;
1047 size_t l =
static_cast<size_t>(p-sp-1);
1048 yyextra->code->codify(
QCString(sp,l));
1053 yyextra->code->codify(sp);
1066 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1068 yyextra->tooltipManager.addTooltip(d);
1073 if (!sourceTooltips)
1078 const char *p=text.
data();
1083 while ((c=*p++) && c!=
'\n') { }
1086 yyextra->yyLineNr++;
1145 for (
const auto &[name,useEntry] : useMap)
1169 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1171 if (memberName.
isEmpty())
return nullptr;
1174 for (
auto it = yyextra->scopeStack.rbegin(); it!=yyextra->scopeStack.rend(); ++it)
1176 const Scope &scope = *it;
1177 std::string lowMemName = memberName.
lower().
str();
1195 for (
const auto &md : *mn)
1197 const FileDef *fd=md->getFileDef();
1198 const GroupDef *gd=md->getGroupDef();
1199 const ClassDef *cd=md->getClassDef();
1208 if (nspace ==
nullptr)
1212 if (md.get()->getFileDef() == yyextra->sourceFileDef)
return md.get();
1213 else if (!potentialMd) potentialMd = md.get();
1216 else if (moduleName == nspace->
name())
1223 auto use_it = useMap.find(usedModuleName.
str());
1224 if (use_it!=useMap.end())
1226 const UseEntry &ue = use_it->second;
1238 if (memberName == name)
1268 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1282 if (yyextra->currentDefinition && yyextra->currentMemberDef &&
1283 yyextra->insideBody && yyextra->collectXRefs)
1298 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1325 else if (
getLink(yyscanner,yyextra->useMembers, name, ol, name))
1342 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1343 const char *p=yyextra->inputString;
1349 if (c==
'\n') count++;
1351 if (p>yyextra->inputString && *(p-1)!=
'\n')
1363 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1364 DBG_CTX((stderr,
"===> startScope %s",yytext));
1365 yyextra->scopeStack.emplace_back();
1371 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1372 DBG_CTX((stderr,
"===> endScope %s",yytext));
1373 if (yyextra->scopeStack.empty())
1375 DBG_CTX((stderr,
"WARNING: fortrancode.l: stack empty!\n"));
1379 Scope &scope = yyextra->scopeStack.back();
1380 for (
const auto &name : scope.
useNames)
1382 yyextra->useMembers.erase(name.
str());
1384 yyextra->scopeStack.pop_back();
1389 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1390 if (!yyextra->scopeStack.empty())
1391 yyextra->scopeStack.back().
useNames.push_back(moduleName);
1396 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1397 if (!yyextra->scopeStack.empty())
1399 std::string lowVarName = varName.
lower().
str();
1400 yyextra->scopeStack.back().localVars.insert(lowVarName);
1401 if (yyextra->isExternal) yyextra->scopeStack.back().externalVars.insert(lowVarName);
1410 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1418 if (*p ==
'\n') numLines++;
1422 yyextra->hasContLine = (
int *) malloc((numLines) *
sizeof(
int));
1423 for (i = 0; i < numLines; i++)
1425 yyextra->hasContLine[i] = 0;
1428 yyextra->hasContLine[0] = 0;
1432 bool ,
const char *,
const FileDef *,
1454 fortrancodeYYlex_init_extra(&
p->state,&
p->yyscanner);
1463 fortrancodeYYlex_destroy(
p->yyscanner);
1468 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
1469 yyextra->currentDefinition =
nullptr;
1470 yyextra->currentMemberDef =
nullptr;
1471 yyextra->currentFontClass =
nullptr;
1472 yyextra->insideCodeLine =
FALSE;
1480 bool stripCodeComments,
1485 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
1489 yyextra->code = &codeOutIntf;
1490 yyextra->inputString = input.
data();
1491 yyextra->inputPosition = 0;
1494 yyextra->contLineNr = 1;
1495 yyextra->hasContLine =
nullptr;
1496 if (yyextra->isFixedForm)
1499 yyextra->fixedCommentAfter =
Config_getInt(FORTRAN_COMMENT_AFTER);
1501 yyextra->currentFontClass =
nullptr;
1502 yyextra->insideCodeLine =
FALSE;
1503 yyextra->searchCtx = options.
searchCtx();
1507 yyextra->exampleBlock = options.
isExample();
1509 yyextra->sourceFileDef = options.
fileDef();
1510 yyextra->foldStack.clear();
1511 yyextra->insideSpecialComment =
false;
1516 yyextra->sourceFileDef = yyextra->exampleFileDef.get();
1518 if (yyextra->sourceFileDef)
1522 yyextra->currentDefinition =
nullptr;
1523 yyextra->currentMemberDef =
nullptr;
1524 if (!yyextra->exampleName.isEmpty())
1530 fortrancodeYYrestart(
nullptr, yyscanner);
1532 fortrancodeYYlex(yyscanner);
1533 if (yyextra->insideCodeLine)
1539 while (!yyextra->foldStack.empty())
1541 yyextra->code->endFold();
1542 yyextra->foldStack.pop_back();
1545 if (yyextra->exampleFileDef)
1548 yyextra->exampleFileDef.reset();
1549 yyextra->sourceFileDef=
nullptr;
1551 if (yyextra->hasContLine) free(yyextra->hasContLine);
1552 yyextra->hasContLine =
nullptr;
1555 yyextra->tooltipManager.writeTooltips(codeOutIntf);
1560 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1561 if ( yyg->yy_start_stack_ptr <= 0 )
1562 warn(yyextra->fileName,yyextra->yyLineNr,
"Unexpected statement '{}'",yytext );
1564 yy_pop_state(yyscanner);
1568#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)
void parseCode(OutputCodeList &codeOutIntf, const QCString &scopeName, const QCString &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.
std::unique_ptr< Private > p
~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 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)
Options to configure the code parser.
const Definition * searchCtx() const
const FileDef * fileDef() const
bool inlineFragment() const
QCString exampleName() const
bool collectXRefs() const
fortrancodeYY_state state
bool recognizeFixedForm(const QCString &contents, FortranFormat format)
QCString convertNameToFile(const QCString &name, bool allowDots, bool allowUnderscore)