Skip to content

Commit

Permalink
Supporting linking for methods bound to FORTRAN classes in source def…
Browse files Browse the repository at this point in the history
…initions
  • Loading branch information
hansec committed Dec 21, 2014
1 parent c09f84c commit f704342
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions src/fortrancode.l
Original file line number Diff line number Diff line change
Expand Up @@ -747,6 +747,7 @@ PREFIX (RECURSIVE{BS_}|IMPURE{BS_}|PURE{BS_}|ELEMENTAL{BS_}){0,3}(RECURSIVE|I
%x UseOnly
%x Import
%x Declaration
%x DeclarationBinding
%x DeclContLine
%x Parameterlist
%x String
Expand Down Expand Up @@ -974,6 +975,14 @@ PREFIX (RECURSIVE{BS_}|IMPURE{BS_}|PURE{BS_}|ELEMENTAL{BS_}){0,3}(RECURSIVE|I
generateLink(*g_code, yytext);
}
}
<Declaration>{BS}("=>"|"="){BS} { // Procedure binding
BEGIN(DeclarationBinding);
g_code->codify(yytext);
}
<DeclarationBinding>{ID} { // Type bound procedure link
generateLink(*g_code, yytext);
yy_pop_state();
}
<Declaration>[(] { // start of array specification
bracketCount++;
g_code->codify(yytext);
Expand All @@ -984,7 +993,7 @@ PREFIX (RECURSIVE{BS_}|IMPURE{BS_}|PURE{BS_}|ELEMENTAL{BS_}){0,3}(RECURSIVE|I
g_code->codify(yytext);
}

<Declaration>"&" { // continuation line
<Declaration,DeclarationBinding>"&" { // continuation line
g_code->codify(yytext);
yy_push_state(YY_START);
BEGIN(DeclContLine);
Expand All @@ -995,7 +1004,7 @@ PREFIX (RECURSIVE{BS_}|IMPURE{BS_}|PURE{BS_}|ELEMENTAL{BS_}){0,3}(RECURSIVE|I
yy_pop_state();
YY_FTN_RESET
}
<Declaration>"\n" { // end declaration line
<Declaration,DeclarationBinding>"\n" { // end declaration line
if (g_endComment)
{
g_endComment=FALSE;
Expand Down Expand Up @@ -1039,7 +1048,7 @@ PREFIX (RECURSIVE{BS_}|IMPURE{BS_}|PURE{BS_}|ELEMENTAL{BS_}){0,3}(RECURSIVE|I
}

/*-------- comments ---------------------------------------------------*/
<Start>\n?{BS}"!>"|"!<" { // start comment line or comment block
<Start,Declaration,DeclarationBinding>\n?{BS}"!>"|"!<" { // start comment line or comment block
if (yytext[0] == '\n')
{
yy_old_start = 0;
Expand All @@ -1052,7 +1061,7 @@ PREFIX (RECURSIVE{BS_}|IMPURE{BS_}|PURE{BS_}|ELEMENTAL{BS_}){0,3}(RECURSIVE|I
BEGIN(DocBlock);
docBlock=yytext;
}
<Declaration>{BS}"!<" { // start comment line or comment block
<Declaration,DeclarationBinding>{BS}"!<" { // start comment line or comment block
yy_push_state(YY_START);
BEGIN(DocBlock);
docBlock=yytext;
Expand Down

0 comments on commit f704342

Please sign in to comment.