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>
220#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.
230SUBPROG (subroutine|function)
235ARGS_L1a [^()]*"("[^)]*")"[^)]*
236ARGS_L1 ("("{ARGS_L1a}*")")
237ARGS_L2 "("({ARGS_L0}|[^()]|{ARGS_L1a}|{ARGS_L1})*")"
238ARGS {BS}({ARGS_L0}|{ARGS_L1}|{ARGS_L2})
240NUM_TYPE (complex|integer|logical|real)
241LOG_OPER (\.and\.|\.eq\.|\.eqv\.|\.ge\.|\.gt\.|\.le\.|\.lt\.|\.ne\.|\.neqv\.|\.or\.|\.not\.)
243CHAR (CHARACTER{ARGS}?|CHARACTER{BS}"*"({BS}[0-9]+|{ARGS}))
244TYPE_SPEC (({NUM_TYPE}({BS}"*"{BS}[0-9]+)?)|({NUM_TYPE}{KIND})|DOUBLE{BS}COMPLEX|DOUBLE{BS}PRECISION|{CHAR}|TYPE|CLASS|PROCEDURE|ENUMERATOR)
246INTENT_SPEC intent{BS}"("{BS}(in|out|in{BS}out){BS}")"
247ATTR_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)
248ACCESS_SPEC (PROTECTED|PRIVATE|PUBLIC)
250FLOW (DO|SELECT|CASE|SELECT{BS}(CASE|TYPE|RANK)|WHERE|IF|THEN|ELSE|WHILE|FORALL|ELSEWHERE|ELSEIF|RETURN|CONTINUE|EXIT|GO{BS}TO)
251COMMANDS (FORMAT|CONTAINS|MODULE{BS_}PROCEDURE|WRITE|READ|ALLOCATE|ALLOCATED|ASSOCIATED|PRESENT|DEALLOCATE|NULLIFY|SIZE|INQUIRE|OPEN|CLOSE|FLUSH|DATA|COMMON)
253PREFIX ((NON_)?RECURSIVE{BS_}|IMPURE{BS_}|PURE{BS_}|ELEMENTAL{BS_}){0,4}((NON_)?RECURSIVE|IMPURE|PURE|ELEMENTAL)?0
254LANGUAGE_BIND_SPEC BIND{BS}"("{BS}C{BS}(,{BS}NAME{BS}"="{BS}"\""(.*)"\""{BS})?")"
282<Start>{IGNORE}/{BS}"(" {
static void codifyLines(yyscan_t yyscanner, const QCString &text)
287<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)
293<Start>{FLOW}/{BS}[,( \t\n] {
294 if (yyextra->isFixedForm)
298 if (yyextra->currentMemberDef && yyextra->currentMemberDef->isFunction())
static std::mutex countFlowKeywordsMutex
virtual void incrementFlowKeyWordCount()=0
MemberDefMutable * toMemberDefMutable(Definition *d)
312<Start>{BS}(RANK){BS_}(DEFAULT) |
313<Start>{BS}(RANK)/{BS}"("{BS}([0-9]+|"*"){BS}")" |
314<Start>{BS}(CASE|CLASS|TYPE){BS_}(IS|DEFAULT) {
319<Start>{BS}"end"({BS}{FLOW})/[ \t\n] {
324<Start>"implicit"{BS}("none"|{TYPE_SPEC}) {
329<Start>^{BS}"namelist"/[/] {
339 yy_push_state(YY_START,yyscanner);
346 yy_push_state(YY_START,yyscanner);
352 yyextra->insideBody=
TRUE;
354 yyextra->insideBody=
FALSE;
358 yyextra->useEntry.module = tmp;
359 yyextra->useMembers.emplace(tmp.str(), yyextra->useEntry);
362<Use,UseOnly,Import>{BS},{BS} {
codifyLines(yyscanner,yytext); }
363<UseOnly,Import>{BS}&{BS}"\n" {
codifyLines(yyscanner,yytext);
364 yyextra->contLineNr++;
369 yyextra->useEntry.onlyNames.push_back(tmp);
370 yyextra->insideBody=
TRUE;
372 yyextra->insideBody=
FALSE;
374<Use,UseOnly,Import>"\n" {
379<*>"import"{BS}/"\n" |
385 yy_push_state(YY_START,yyscanner);
389 yyextra->insideBody=
TRUE;
391 yyextra->insideBody=
FALSE;
393<Import>("ONLY"|"NONE"|"ALL") {
399<Start>("block"{BS}"data"|"program"|"module"|"interface")/{BS_}|({COMMA}{ACCESS_SPEC})|\n {
404 yy_push_state(YY_START,yyscanner);
406 if (!
qstricmp(yytext,
"module")) yyextra->currentModule=
"module";
int qstricmp(const char *s1, const char *s2)
408<Start>("enum")/{BS_}|{BS}{COMMA}{BS}{LANGUAGE_BIND_SPEC}|\n {
413 yy_push_state(YY_START,yyscanner);
416<*>{LANGUAGE_BIND_SPEC} {
422<Start>("type")/{BS_}|({COMMA}({ACCESS_SPEC}|ABSTRACT|EXTENDS))|\n {
427 yy_push_state(YY_START,yyscanner);
431 if (yyextra->currentModule ==
"module")
433 yyextra->currentModule=yytext;
434 yyextra->currentModule = yyextra->currentModule.lower();
439<ClassName>({ACCESS_SPEC}|ABSTRACT|EXTENDS)/[,:( ] {
441 yyextra->code->codify(
QCString(yytext));
448<Start>^{BS}"end"({BS_}"enum").* {
451<Start>^{BS}"end"({BS_}"type").* {
454<Start>^{BS}"end"({BS_}"module").* {
455 yyextra->currentModule=
nullptr;
459<Start>({PREFIX}{BS_})?{TYPE_SPEC}{BS_}({PREFIX}{BS_})?{BS}/{SUBPROG}{BS_} {
464<Start>({PREFIX}{BS_})?{SUBPROG}{BS_} {
468 yy_push_state(YY_START,yyscanner);
472 DBG_CTX((stderr,
"===> start subprogram %s\n", yytext));
476<Subprog>"result"/{BS}"("[^)]*")" {
481<Subprog>"("[^)]*")" {
484<Subprog,Subprogend>"\n" {
codifyLines(yyscanner,yytext);
485 yyextra->contLineNr++;
489<Start>"end"{BS}("block"{BS}"data"|{SUBPROG}|"module"|"program"|"enum"|"type"|"interface")?{BS} {
495 yy_push_state(YY_START,yyscanner);
498<Subprogend>{ID}/{BS}(\n|!|;) {
502<Start>"end"{BS}("block"{BS}"data"|{SUBPROG}|"module"|"program"|"enum"|"type"|"interface"){BS}/(\n|!|;) {
510<Start>^{BS}"real"/[,:( ] {
511 yy_push_state(YY_START,yyscanner);
514 yyextra->code->codify(
QCString(yytext));
517<Start>{TYPE_SPEC}/[,:( ] {
521 if (typ ==
"type" || typ ==
"class" || typ ==
"procedure") yyextra->inTypeDecl = 1;
522 yy_push_state(YY_START,yyscanner);
525 yyextra->code->codify(
QCString(yytext));
QCString removeRedundantWhiteSpace(const QCString &s)
531 yy_push_state(YY_START,yyscanner);
533 yyextra->isExternal =
true;
536 yyextra->code->codify(
QCString(yytext));
539<Declaration>({TYPE_SPEC}|{ATTR_SPEC})/[,:( ] {
540 if (
QCString(yytext) ==
"external") yyextra->isExternal =
true;
542 yyextra->code->codify(
QCString(yytext));
549 yyextra->code->codify(
QCString(yytext));
552 else if (yyextra->currentMemberDef &&
553 ((yyextra->currentMemberDef->isFunction() && (yyextra->currentMemberDef->typeString()!=
QCString(
"subroutine") || yyextra->inTypeDecl)) ||
554 yyextra->currentMemberDef->isVariable() || yyextra->currentMemberDef->isEnumValue()
562 yyextra->code->codify(
QCString(yytext));
566<Declaration>{BS}("=>"|"="){BS} {
567 BEGIN(DeclarationBinding);
568 yyextra->code->codify(
QCString(yytext));
570<DeclarationBinding>{ID} {
575 yyextra->bracketCount++;
576 yyextra->code->codify(
QCString(yytext));
580 yyextra->bracketCount--;
581 if (!yyextra->bracketCount) yyextra->inTypeDecl = 0;
582 yyextra->code->codify(
QCString(yytext));
585<Declaration,DeclarationBinding>"&" {
586 yyextra->code->codify(
QCString(yytext));
587 if (!yyextra->isFixedForm)
589 yy_push_state(YY_START,yyscanner);
594 yyextra->contLineNr++;
596 yyextra->bracketCount = 0;
600<Declaration,DeclarationBinding>"\n" {
601 if (yyextra->endComment)
603 yyextra->endComment=
FALSE;
609 yyextra->bracketCount = 0;
610 yyextra->contLineNr++;
611 if (!(yyextra->hasContLine && yyextra->hasContLine[yyextra->contLineNr - 1]))
613 yyextra->isExternal =
false;
625 yy_push_state(YY_START,yyscanner);
629 yyextra->insideBody=
TRUE;
631 yyextra->insideBody=
FALSE;
642 yy_push_state(YY_START,yyscanner);
647 yyextra->code->codify(
QCString(yytext + 4));
651 yyextra->insideBody=
TRUE;
653 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...
658<Start,Declaration,DeclarationBinding>\n?{BS}"!>"|"!<" {
659 if (yytext[0] ==
'\n')
661 yyextra->contLineNr++;
664 yy_end =
static_cast<int>(yyleng);
668 yy_push_state(YY_START,yyscanner);
670 yyextra->docBlock=yytext;
672<Declaration,DeclarationBinding>{BS}"!<" {
673 yy_push_state(YY_START,yyscanner);
675 yyextra->docBlock=yytext;
679 yyextra->docBlock+=yytext;
681<DocBlock>"\n"{BS}("!>"|"!<"|"!!") {
682 yyextra->contLineNr++;
685 yy_end =
static_cast<int>(yyleng);
688 yyextra->docBlock+=yytext;
692 yyextra->contLineNr++;
697 yyextra->contLineNr--;
702<*>"!"[^><\n].*|"!"$ {
717<*>"assignment"/{BS}"("{BS}"="{BS}")" {
723<*>"operator"/{BS}"("[^)]*")" {
733 yyextra->contLineNr++;
742 yyextra->code->codify(
QCString(yytext));
745 yyextra->insideBody=
TRUE;
747 yyextra->insideBody=
FALSE;
751 yyextra->contLineNr++;
752 yyextra->str+=yytext;
761 yyextra->str+=yytext;
767<String>[\x80-\xFF]* |
768<String>. {yyextra->str+=yytext;}
773 yy_push_state(YY_START,yyscanner);
774 yyextra->stringStartSymbol=yytext[0];
781 if (yyextra->endComment)
783 yyextra->endComment=
FALSE;
789 if (yyextra->currentFontClass && !strcmp(yyextra->currentFontClass,
"comment"))
endFontClass(yyscanner);
791 yyextra->contLineNr++;
794<*>^{BS}"type"{BS}"=" { yyextra->code->codify(
QCString(yytext)); }
797 if (yyextra->isFixedForm &&
yy_my_start > yyextra->fixedCommentAfter)
804 yyextra->code->codify(
QCString(yytext));
808 if (yyextra->isFixedForm &&
yy_my_start > yyextra->fixedCommentAfter)
818 yyextra->code->codify(
QCString(yytext));
822 yyextra->code->codify(
QCString(yytext));
825 if (YY_START == DocBlock)
840 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
841 int inputPosition = yyextra->inputPosition;
842 const char *s = yyextra->inputString + inputPosition;
844 while( c < max_size && *s)
849 yyextra->inputPosition += c;
855 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
856 if (yyextra->currentFontClass)
858 yyextra->code->endFontClass();
859 yyextra->currentFontClass=
nullptr;
861 if (specialComment && yyextra->insideSpecialComment)
863 yyextra->code->endSpecialComment();
864 yyextra->insideSpecialComment=
false;
870 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
873 yyextra->code->startSpecialComment();
874 yyextra->insideSpecialComment =
true;
877 if (
qstrcmp(yyextra->currentFontClass,s)!=0)
880 yyextra->code->startFontClass(
QCString(s));
881 yyextra->currentFontClass=s;
887 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
890 if (yyextra->searchCtx)
913 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
914 while (!yyextra->foldStack.empty())
916 const Definition *dd = yyextra->foldStack.back();
919 yyextra->code->endFold();
921 yyextra->foldStack.pop_back();
932 if (endLine!=-1 && startLine!=endLine &&
940 (yyextra->foldStack.empty() || yyextra->foldStack.back()->getEndBodyLine()!=startLine))
943 yyextra->code->startFold(yyextra->yyLineNr,
"",
"");
944 yyextra->foldStack.push_back(d);
956 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
957 if (yyextra->sourceFileDef)
963 const Definition *d = yyextra->sourceFileDef->getSourceDefinition(yyextra->yyLineNr);
965 if (!yyextra->includeCodeFragment && d)
967 yyextra->currentDefinition = d;
968 yyextra->currentMemberDef = yyextra->sourceFileDef->getSourceMember(yyextra->yyLineNr);
969 yyextra->insideBody =
FALSE;
970 yyextra->endComment =
FALSE;
972 lineAnchor.
sprintf(
"l%05d",yyextra->yyLineNr);
973 if (yyextra->currentMemberDef)
976 yyextra->code->writeLineNumber(yyextra->currentMemberDef->getReference(),
977 yyextra->currentMemberDef->getOutputFileBase(),
978 yyextra->currentMemberDef->anchor(),yyextra->yyLineNr,
979 !yyextra->includeCodeFragment);
988 !yyextra->includeCodeFragment);
1000 !yyextra->includeCodeFragment);
1003 yyextra->code->startCodeLine(yyextra->yyLineNr);
1004 yyextra->insideCodeLine=
true;
1005 if (yyextra->currentFontClass)
1007 yyextra->code->startFontClass(
QCString(yyextra->currentFontClass));
1014 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1016 yyextra->code->endCodeLine();
1017 yyextra->insideCodeLine=
false;
1022 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1023 const char * fc = yyextra->currentFontClass;
1025 if (yyextra->yyLineNr<yyextra->inputLines)
1027 yyextra->currentFontClass = fc;
1037 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1040 const char *p=text.
data(),*sp=p;
1046 while ((c=*p++) && c!=
'\n') { }
1049 yyextra->yyLineNr++;
1050 size_t l =
static_cast<size_t>(p-sp-1);
1051 std::string tmp(sp,l);
1052 yyextra->code->codify(tmp.c_str());
1057 yyextra->code->codify(
QCString(sp));
1070 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1072 yyextra->tooltipManager.addTooltip(d);
1077 if (!sourceTooltips)
1082 const char *p=text.
data();
1087 while ((c=*p++) && c!=
'\n') { }
1090 yyextra->yyLineNr++;
1149 for (
const auto &[name,useEntry] : useMap)
1173 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1174 if (memberName.
isEmpty())
return nullptr;
1177 for (
auto it = yyextra->scopeStack.rbegin(); it!=yyextra->scopeStack.rend(); ++it)
1179 const Scope &scope = *it;
1180 std::string lowMemName = memberName.
lower().
str();
1198 for (
const auto &md : *mn)
1200 const FileDef *fd=md->getFileDef();
1201 const GroupDef *gd=md->getGroupDef();
1202 const ClassDef *cd=md->getClassDef();
1211 if (nspace ==
nullptr)
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))
1349 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1350 const char *p=yyextra->inputString;
1356 if (c==
'\n') count++;
1358 if (p>yyextra->inputString && *(p-1)!=
'\n')
1370 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1371 DBG_CTX((stderr,
"===> startScope %s",yytext));
1372 yyextra->scopeStack.emplace_back();
1378 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1379 DBG_CTX((stderr,
"===> endScope %s",yytext));
1380 if (yyextra->scopeStack.empty())
1382 DBG_CTX((stderr,
"WARNING: fortrancode.l: stack empty!\n"));
1386 Scope &scope = yyextra->scopeStack.back();
1387 for (
const auto &name : scope.
useNames)
1389 yyextra->useMembers.erase(name.str());
1391 yyextra->scopeStack.pop_back();
1396 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1397 if (!yyextra->scopeStack.empty())
1398 yyextra->scopeStack.back().
useNames.push_back(moduleName);
1403 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1404 if (!yyextra->scopeStack.empty())
1406 std::string lowVarName = varName.
lower().
str();
1407 yyextra->scopeStack.back().localVars.insert(lowVarName);
1408 if (yyextra->isExternal) yyextra->scopeStack.back().externalVars.insert(lowVarName);
1417 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1425 if (*p ==
'\n') numLines++;
1429 yyextra->hasContLine = (
int *) malloc((numLines) *
sizeof(
int));
1430 for (i = 0; i < numLines; i++)
1432 yyextra->hasContLine[i] = 0;
1435 yyextra->hasContLine[0] = 0;
1439 bool ,
const char *,
const FileDef *,
1461 fortrancodeYYlex_init_extra(&
p->state,&
p->yyscanner);
1470 fortrancodeYYlex_destroy(
p->yyscanner);
1475 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
1476 yyextra->currentDefinition =
nullptr;
1477 yyextra->currentMemberDef =
nullptr;
1478 yyextra->currentFontClass =
nullptr;
1479 yyextra->insideCodeLine =
FALSE;
1487 bool stripCodeComments,
1488 bool isExampleBlock,
1493 bool inlineFragment,
1501 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
1513 yyextra->code = &codeOutIntf;
1514 yyextra->inputString = input.
data();
1515 yyextra->inputPosition = 0;
1516 yyextra->fileName = fileDef ? fileDef->
fileName():
"";
1518 yyextra->contLineNr = 1;
1519 yyextra->hasContLine =
nullptr;
1520 if (yyextra->isFixedForm)
1523 yyextra->fixedCommentAfter =
Config_getInt(FORTRAN_COMMENT_AFTER);
1525 yyextra->currentFontClass =
nullptr;
1526 yyextra->insideCodeLine =
FALSE;
1527 yyextra->searchCtx = searchCtx;
1528 yyextra->collectXRefs = collectXRefs;
1530 yyextra->yyLineNr = startLine;
1532 yyextra->yyLineNr = 1;
1535 yyextra->inputLines = endLine+1;
1537 yyextra->inputLines = yyextra->yyLineNr +
countLines(yyscanner) - 1;
1539 yyextra->exampleBlock = isExampleBlock;
1540 yyextra->exampleName = exampleName;
1541 yyextra->sourceFileDef = fileDef;
1542 yyextra->foldStack.clear();
1543 yyextra->insideSpecialComment =
false;
1544 if (isExampleBlock && fileDef==
nullptr)
1548 yyextra->sourceFileDef = yyextra->exampleFileDef.get();
1550 if (yyextra->sourceFileDef)
1554 yyextra->currentDefinition =
nullptr;
1555 yyextra->currentMemberDef =
nullptr;
1556 if (!yyextra->exampleName.isEmpty())
1560 yyextra->includeCodeFragment = inlineFragment;
1562 fortrancodeYYrestart(
nullptr, yyscanner);
1564 fortrancodeYYlex(yyscanner);
1565 if (yyextra->insideCodeLine)
1571 while (!yyextra->foldStack.empty())
1573 yyextra->code->endFold();
1574 yyextra->foldStack.pop_back();
1577 if (!fileDef && isExampleBlock && yyextra->sourceFileDef)
1580 yyextra->exampleFileDef.reset();
1581 yyextra->sourceFileDef=
nullptr;
1583 if (yyextra->hasContLine) free(yyextra->hasContLine);
1584 yyextra->hasContLine =
nullptr;
1587 yyextra->tooltipManager.writeTooltips(codeOutIntf);
1592 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1593 if ( yyg->yy_start_stack_ptr <= 0 )
1594 warn(yyextra->fileName,yyextra->yyLineNr,
"Unexpected statement '%s'",yytext );
1596 yy_pop_state(yyscanner);
1600#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
SrcLangExt
Language as given by extension.
bool recognizeFixedForm(const QCString &contents, FortranFormat format)
QCString convertNameToFile(const QCString &name, bool allowDots, bool allowUnderscore)