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>
218#define YY_INPUT(buf,result,max_size) result=yyread(yyscanner,buf,max_size);
221static 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.
228SUBPROG (subroutine|function)
233ARGS_L1a [^()]*"("[^)]*")"[^)]*
234ARGS_L1 ("("{ARGS_L1a}*")")
235ARGS_L2 "("({ARGS_L0}|[^()]|{ARGS_L1a}|{ARGS_L1})*")"
236ARGS {BS}({ARGS_L0}|{ARGS_L1}|{ARGS_L2})
238NUM_TYPE (complex|integer|logical|real)
239LOG_OPER (\.and\.|\.eq\.|\.eqv\.|\.ge\.|\.gt\.|\.le\.|\.lt\.|\.ne\.|\.neqv\.|\.or\.|\.not\.)
241CHAR (CHARACTER{ARGS}?|CHARACTER{BS}"*"({BS}[0-9]+|{ARGS}))
242TYPE_SPEC (({NUM_TYPE}({BS}"*"{BS}[0-9]+)?)|({NUM_TYPE}{KIND})|DOUBLE{BS}COMPLEX|DOUBLE{BS}PRECISION|{CHAR}|TYPE|CLASS|PROCEDURE|ENUMERATOR)
244INTENT_SPEC intent{BS}"("{BS}(in|out|in{BS}out){BS}")"
245ATTR_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)
246ACCESS_SPEC (PROTECTED|PRIVATE|PUBLIC)
248FLOW (DO|SELECT|CASE|SELECT{BS}(CASE|TYPE|RANK)|WHERE|IF|THEN|ELSE|WHILE|FORALL|ELSEWHERE|ELSEIF|RETURN|CONTINUE|EXIT|GO{BS}TO)
249COMMANDS (FORMAT|CONTAINS|MODULE{BS_}PROCEDURE|WRITE|READ|ALLOCATE|ALLOCATED|ASSOCIATED|PRESENT|DEALLOCATE|NULLIFY|SIZE|INQUIRE|OPEN|CLOSE|FLUSH|DATA|COMMON)
251PREFIX ((NON_)?RECURSIVE{BS_}|IMPURE{BS_}|PURE{BS_}|ELEMENTAL{BS_}){0,4}((NON_)?RECURSIVE|IMPURE|PURE|ELEMENTAL)?0
252LANGUAGE_BIND_SPEC BIND{BS}"("{BS}C{BS}(,{BS}NAME{BS}"="{BS}"\""(.*)"\""{BS})?")"
280<Start>{IGNORE}/{BS}"(" {
285<Start>{COMMANDS}/{BS}[,( \t\n] {
291<Start>{FLOW}/{BS}[,( \t\n] {
292 if (yyextra->isFixedForm)
296 if (yyextra->currentMemberDef && yyextra->currentMemberDef->isFunction())
static std::mutex countFlowKeywordsMutex
virtual void incrementFlowKeyWordCount()=0
MemberDefMutable * toMemberDefMutable(Definition *d)
310<Start>{BS}(RANK){BS_}(DEFAULT) |
311<Start>{BS}(RANK)/{BS}"("{BS}([0-9]+|"*"){BS}")" |
312<Start>{BS}(CASE|CLASS|TYPE){BS_}(IS|DEFAULT) {
317<Start>{BS}"end"({BS}{FLOW})/[ \t\n] {
322<Start>"implicit"{BS}("none"|{TYPE_SPEC}) {
327<Start>^{BS}"namelist"/[/] {
337 yy_push_state(YY_START,yyscanner);
344 yy_push_state(YY_START,yyscanner);
350 yyextra->insideBody=
TRUE;
352 yyextra->insideBody=
FALSE;
356 yyextra->useEntry.module = tmp;
357 yyextra->useMembers.emplace(tmp.str(), yyextra->useEntry);
360<Use,UseOnly,Import>{BS},{BS} {
codifyLines(yyscanner,yytext); }
361<UseOnly,Import>{BS}&{BS}"\n" {
codifyLines(yyscanner,yytext);
362 yyextra->contLineNr++;
367 yyextra->useEntry.onlyNames.push_back(tmp);
368 yyextra->insideBody=
TRUE;
370 yyextra->insideBody=
FALSE;
372<Use,UseOnly,Import>"\n" {
377<*>"import"{BS}/"\n" |
383 yy_push_state(YY_START,yyscanner);
387 yyextra->insideBody=
TRUE;
389 yyextra->insideBody=
FALSE;
391<Import>("ONLY"|"NONE"|"ALL") {
397<Start>("block"{BS}"data"|"program"|"module"|"interface")/{BS_}|({COMMA}{ACCESS_SPEC})|\n {
402 yy_push_state(YY_START,yyscanner);
404 if (!
qstricmp(yytext,
"module")) yyextra->currentModule=
"module";
int qstricmp(const char *s1, const char *s2)
406<Start>("enum")/{BS_}|{BS}{COMMA}{BS}{LANGUAGE_BIND_SPEC}|\n {
411 yy_push_state(YY_START,yyscanner);
414<*>{LANGUAGE_BIND_SPEC} {
420<Start>("type")/{BS_}|({COMMA}({ACCESS_SPEC}|ABSTRACT|EXTENDS))|\n {
425 yy_push_state(YY_START,yyscanner);
429 if (yyextra->currentModule ==
"module")
431 yyextra->currentModule=yytext;
432 yyextra->currentModule = yyextra->currentModule.lower();
437<ClassName>({ACCESS_SPEC}|ABSTRACT|EXTENDS)/[,:( ] {
439 yyextra->code->codify(yytext);
446<Start>^{BS}"end"({BS_}"enum").* {
449<Start>^{BS}"end"({BS_}"type").* {
452<Start>^{BS}"end"({BS_}"module").* {
453 yyextra->currentModule=
nullptr;
457<Start>({PREFIX}{BS_})?{TYPE_SPEC}{BS_}({PREFIX}{BS_})?{BS}/{SUBPROG}{BS_} {
462<Start>({PREFIX}{BS_})?{SUBPROG}{BS_} {
466 yy_push_state(YY_START,yyscanner);
470 DBG_CTX((stderr,
"===> start subprogram %s\n", yytext));
474<Subprog>"result"/{BS}"("[^)]*")" {
479<Subprog>"("[^)]*")" {
482<Subprog,Subprogend>"\n" {
codifyLines(yyscanner,yytext);
483 yyextra->contLineNr++;
487<Start>"end"{BS}("block"{BS}"data"|{SUBPROG}|"module"|"program"|"enum"|"type"|"interface")?{BS} {
493 yy_push_state(YY_START,yyscanner);
496<Subprogend>{ID}/{BS}(\n|!|;) {
500<Start>"end"{BS}("block"{BS}"data"|{SUBPROG}|"module"|"program"|"enum"|"type"|"interface"){BS}/(\n|!|;) {
508<Start>^{BS}"real"/[,:( ] {
509 yy_push_state(YY_START,yyscanner);
512 yyextra->code->codify(yytext);
515<Start>{TYPE_SPEC}/[,:( ] {
519 if (typ ==
"type" || typ ==
"class" || typ ==
"procedure") yyextra->inTypeDecl = 1;
520 yy_push_state(YY_START,yyscanner);
523 yyextra->code->codify(yytext);
QCString removeRedundantWhiteSpace(const QCString &s)
529 yy_push_state(YY_START,yyscanner);
531 yyextra->isExternal =
true;
534 yyextra->code->codify(yytext);
537<Declaration>({TYPE_SPEC}|{ATTR_SPEC})/[,:( ] {
538 if (
QCString(yytext) ==
"external") yyextra->isExternal =
true;
540 yyextra->code->codify(yytext);
547 yyextra->code->codify(yytext);
550 else if (yyextra->currentMemberDef &&
551 ((yyextra->currentMemberDef->isFunction() && (yyextra->currentMemberDef->typeString()!=
QCString(
"subroutine") || yyextra->inTypeDecl)) ||
552 yyextra->currentMemberDef->isVariable() || yyextra->currentMemberDef->isEnumValue()
560 yyextra->code->codify(yytext);
564<Declaration>{BS}("=>"|"="){BS} {
565 BEGIN(DeclarationBinding);
566 yyextra->code->codify(yytext);
568<DeclarationBinding>{ID} {
573 yyextra->bracketCount++;
574 yyextra->code->codify(yytext);
578 yyextra->bracketCount--;
579 if (!yyextra->bracketCount) yyextra->inTypeDecl = 0;
580 yyextra->code->codify(yytext);
583<Declaration,DeclarationBinding>"&" {
584 yyextra->code->codify(yytext);
585 if (!yyextra->isFixedForm)
587 yy_push_state(YY_START,yyscanner);
592 yyextra->contLineNr++;
594 yyextra->bracketCount = 0;
598<Declaration,DeclarationBinding>"\n" {
599 if (yyextra->endComment)
601 yyextra->endComment=
FALSE;
607 yyextra->bracketCount = 0;
608 yyextra->contLineNr++;
609 if (!(yyextra->hasContLine && yyextra->hasContLine[yyextra->contLineNr - 1]))
611 yyextra->isExternal =
false;
623 yy_push_state(YY_START,yyscanner);
627 yyextra->insideBody=
TRUE;
629 yyextra->insideBody=
FALSE;
640 yy_push_state(YY_START,yyscanner);
645 yyextra->code->codify(
QCString(yytext + 4));
649 yyextra->insideBody=
TRUE;
651 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...
656<Start,Declaration,DeclarationBinding>\n?{BS}"!>"|"!<" {
657 if (yytext[0] ==
'\n')
659 yyextra->contLineNr++;
662 yy_end =
static_cast<int>(yyleng);
666 yy_push_state(YY_START,yyscanner);
668 yyextra->docBlock=yytext;
670<Declaration,DeclarationBinding>{BS}"!<" {
671 yy_push_state(YY_START,yyscanner);
673 yyextra->docBlock=yytext;
677 yyextra->docBlock+=yytext;
679<DocBlock>"\n"{BS}("!>"|"!<"|"!!") {
680 yyextra->contLineNr++;
683 yy_end =
static_cast<int>(yyleng);
686 yyextra->docBlock+=yytext;
690 yyextra->contLineNr++;
695 yyextra->contLineNr--;
700<*>"!"[^><\n].*|"!"$ {
715<*>"assignment"/{BS}"("{BS}"="{BS}")" {
721<*>"operator"/{BS}"("[^)]*")" {
731 yyextra->contLineNr++;
740 yyextra->code->codify(yytext);
743 yyextra->insideBody=
TRUE;
745 yyextra->insideBody=
FALSE;
749 yyextra->contLineNr++;
750 yyextra->str+=yytext;
759 yyextra->str+=yytext;
765<String>[\x80-\xFF]* |
766<String>. {yyextra->str+=yytext;}
771 yy_push_state(YY_START,yyscanner);
772 yyextra->stringStartSymbol=yytext[0];
779 if (yyextra->endComment)
781 yyextra->endComment=
FALSE;
787 if (yyextra->currentFontClass && !strcmp(yyextra->currentFontClass,
"comment"))
endFontClass(yyscanner);
789 yyextra->contLineNr++;
792<*>^{BS}"type"{BS}"=" { yyextra->code->codify(yytext); }
795 if (yyextra->isFixedForm &&
yy_my_start > yyextra->fixedCommentAfter)
802 yyextra->code->codify(yytext);
806 if (yyextra->isFixedForm &&
yy_my_start > yyextra->fixedCommentAfter)
816 yyextra->code->codify(yytext);
820 yyextra->code->codify(yytext);
823 if (YY_START == DocBlock)
838 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
839 int inputPosition = yyextra->inputPosition;
840 const char *s = yyextra->inputString + inputPosition;
842 while( c < max_size && *s)
847 yyextra->inputPosition += c;
853 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
854 if (yyextra->currentFontClass)
856 yyextra->code->endFontClass();
857 yyextra->currentFontClass=
nullptr;
859 if (specialComment && yyextra->insideSpecialComment)
861 yyextra->code->endSpecialComment();
862 yyextra->insideSpecialComment=
false;
868 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
871 yyextra->code->startSpecialComment();
872 yyextra->insideSpecialComment =
true;
875 if (
qstrcmp(yyextra->currentFontClass,s)!=0)
878 yyextra->code->startFontClass(s);
879 yyextra->currentFontClass=s;
885 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
888 if (yyextra->searchCtx)
911 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
912 while (!yyextra->foldStack.empty())
914 const Definition *dd = yyextra->foldStack.back();
917 yyextra->code->endFold();
919 yyextra->foldStack.pop_back();
930 if (endLine!=-1 && startLine!=endLine &&
938 (yyextra->foldStack.empty() || yyextra->foldStack.back()->getEndBodyLine()!=startLine))
941 yyextra->code->startFold(yyextra->yyLineNr,
"",
"");
942 yyextra->foldStack.push_back(d);
954 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
955 if (yyextra->sourceFileDef && yyextra->lineNumbers)
961 const Definition *d = yyextra->sourceFileDef->getSourceDefinition(yyextra->yyLineNr);
963 if (!yyextra->includeCodeFragment && d)
965 yyextra->currentDefinition = d;
966 yyextra->currentMemberDef = yyextra->sourceFileDef->getSourceMember(yyextra->yyLineNr);
967 yyextra->insideBody =
FALSE;
968 yyextra->endComment =
FALSE;
970 lineAnchor.
sprintf(
"l%05d",yyextra->yyLineNr);
971 if (yyextra->currentMemberDef)
974 yyextra->code->writeLineNumber(yyextra->currentMemberDef->getReference(),
975 yyextra->currentMemberDef->getOutputFileBase(),
976 yyextra->currentMemberDef->anchor(),yyextra->yyLineNr,
977 !yyextra->includeCodeFragment);
986 !yyextra->includeCodeFragment);
998 !yyextra->includeCodeFragment);
1001 yyextra->code->startCodeLine(yyextra->yyLineNr);
1002 yyextra->insideCodeLine=
true;
1003 if (yyextra->currentFontClass)
1005 yyextra->code->startFontClass(yyextra->currentFontClass);
1012 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1014 yyextra->code->endCodeLine();
1015 yyextra->insideCodeLine=
false;
1020 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1021 const char * fc = yyextra->currentFontClass;
1023 if (yyextra->yyLineNr<yyextra->inputLines)
1025 yyextra->currentFontClass = fc;
1035 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1038 const char *p=text.
data(),*sp=p;
1044 while ((c=*p++) && c!=
'\n') { }
1047 yyextra->yyLineNr++;
1048 size_t l =
static_cast<size_t>(p-sp-1);
1049 yyextra->code->codify(
QCString(sp,l));
1054 yyextra->code->codify(sp);
1067 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1069 yyextra->tooltipManager.addTooltip(d);
1074 if (!sourceTooltips)
1079 const char *p=text.
data();
1084 while ((c=*p++) && c!=
'\n') { }
1087 yyextra->yyLineNr++;
1146 for (
const auto &[name,useEntry] : useMap)
1170 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1172 if (memberName.
isEmpty())
return nullptr;
1175 for (
auto it = yyextra->scopeStack.rbegin(); it!=yyextra->scopeStack.rend(); ++it)
1177 const Scope &scope = *it;
1178 std::string lowMemName = memberName.
lower().
str();
1196 for (
const auto &md : *mn)
1198 const FileDef *fd=md->getFileDef();
1199 const GroupDef *gd=md->getGroupDef();
1200 const ClassDef *cd=md->getClassDef();
1209 if (nspace ==
nullptr)
1213 if (md.get()->getFileDef() == yyextra->sourceFileDef)
return md.get();
1214 else if (!potentialMd) potentialMd = md.get();
1217 else if (moduleName == nspace->
name())
1224 auto use_it = useMap.find(usedModuleName.
str());
1225 if (use_it!=useMap.end())
1227 const UseEntry &ue = use_it->second;
1239 if (memberName == name)
1269 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1283 if (yyextra->currentDefinition && yyextra->currentMemberDef &&
1284 yyextra->insideBody && yyextra->collectXRefs)
1299 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1326 else if (
getLink(yyscanner,yyextra->useMembers, name, ol, name))
1343 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1344 const char *p=yyextra->inputString;
1350 if (c==
'\n') count++;
1352 if (p>yyextra->inputString && *(p-1)!=
'\n')
1364 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1365 DBG_CTX((stderr,
"===> startScope %s",yytext));
1366 yyextra->scopeStack.emplace_back();
1372 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1373 DBG_CTX((stderr,
"===> endScope %s",yytext));
1374 if (yyextra->scopeStack.empty())
1376 DBG_CTX((stderr,
"WARNING: fortrancode.l: stack empty!\n"));
1380 Scope &scope = yyextra->scopeStack.back();
1381 for (
const auto &name : scope.
useNames)
1383 yyextra->useMembers.erase(name.
str());
1385 yyextra->scopeStack.pop_back();
1390 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1391 if (!yyextra->scopeStack.empty())
1392 yyextra->scopeStack.back().
useNames.push_back(moduleName);
1397 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1398 if (!yyextra->scopeStack.empty())
1400 std::string lowVarName = varName.
lower().
str();
1401 yyextra->scopeStack.back().localVars.insert(lowVarName);
1402 if (yyextra->isExternal) yyextra->scopeStack.back().externalVars.insert(lowVarName);
1411 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1419 if (*p ==
'\n') numLines++;
1423 yyextra->hasContLine = (
int *) malloc((numLines) *
sizeof(
int));
1424 for (i = 0; i < numLines; i++)
1426 yyextra->hasContLine[i] = 0;
1429 yyextra->hasContLine[0] = 0;
1433 bool ,
const char *,
const FileDef *,
1455 fortrancodeYYlex_init_extra(&
p->state,&
p->yyscanner);
1464 fortrancodeYYlex_destroy(
p->yyscanner);
1469 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
1470 yyextra->currentDefinition =
nullptr;
1471 yyextra->currentMemberDef =
nullptr;
1472 yyextra->currentFontClass =
nullptr;
1473 yyextra->insideCodeLine =
FALSE;
1481 bool stripCodeComments,
1486 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
1490 yyextra->code = &codeOutIntf;
1491 yyextra->inputString = input.
data();
1492 yyextra->inputPosition = 0;
1495 yyextra->contLineNr = 1;
1496 yyextra->hasContLine =
nullptr;
1497 if (yyextra->isFixedForm)
1500 yyextra->fixedCommentAfter =
Config_getInt(FORTRAN_COMMENT_AFTER);
1502 yyextra->currentFontClass =
nullptr;
1503 yyextra->insideCodeLine =
FALSE;
1504 yyextra->searchCtx = options.
searchCtx();
1508 yyextra->exampleBlock = options.
isExample();
1510 yyextra->sourceFileDef = options.
fileDef();
1512 yyextra->foldStack.clear();
1513 yyextra->insideSpecialComment =
false;
1518 yyextra->sourceFileDef = yyextra->exampleFileDef.get();
1520 if (yyextra->sourceFileDef)
1524 yyextra->currentDefinition =
nullptr;
1525 yyextra->currentMemberDef =
nullptr;
1526 if (!yyextra->exampleName.isEmpty())
1532 fortrancodeYYrestart(
nullptr, yyscanner);
1534 fortrancodeYYlex(yyscanner);
1535 if (yyextra->insideCodeLine)
1541 while (!yyextra->foldStack.empty())
1543 yyextra->code->endFold();
1544 yyextra->foldStack.pop_back();
1547 if (yyextra->exampleFileDef)
1550 yyextra->exampleFileDef.reset();
1551 yyextra->sourceFileDef=
nullptr;
1553 if (yyextra->hasContLine) free(yyextra->hasContLine);
1554 yyextra->hasContLine =
nullptr;
1557 yyextra->tooltipManager.writeTooltips(codeOutIntf);
1562 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1563 if ( yyg->yy_start_stack_ptr <= 0 )
1564 warn(yyextra->fileName,yyextra->yyLineNr,
"Unexpected statement '{}'",yytext );
1566 yy_pop_state(yyscanner);
1570#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 showLineNumbers() 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)