New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
Changeset 1200 for trunk/AGRIF/LIB/fortran.lex – NEMO

Ignore:
Timestamp:
2008-09-24T15:05:20+02:00 (16 years ago)
Author:
rblod
Message:

Adapt Agrif to the new SBC and correct several bugs for agrif (restart writing and reading), see ticket #133
Note : this fix does not work yet on NEC computerq (sxf90/360)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/AGRIF/LIB/fortran.lex

    r774 r1200  
    3636%s character 
    3737%x donottreat 
     38%s fortran77style 
     39%s fortran90style 
    3840%{ 
    3941#include <math.h> 
     
    7072           }\ 
    7173           strcpy(motparse1,yytext);\ 
     74           /*printf("yytext = %s\n",yytext);*/\ 
    7275        /*if ( firstpass == 1 )  
    7376                      printf("yytext = %s %d\n",yytext,strlen(yytext));*/\ 
     
    102105NEXTLINEF77 \n[ \t]{5}("&"|"+"|"$"|"*"|"1"|"2"|"3"|"4"|"5"|"6"|"7"|"8"|"."|"#") 
    103106%% 
     107  if (infixed) BEGIN(fortran77style) ; 
     108  if (infree) BEGIN(fortran90style)  ; 
    104109 
    105110^C${AGRIFDEB}            return TOK_DEBUT; 
     
    111116subroutine              {return TOK_SUBROUTINE;} 
    112117program                 {return TOK_PROGRAM;} 
    113 allocate                {return TOK_ALLOCATE;} 
    114 deallocate              {return TOK_DEALLOCATE;} 
     118allocate                {inallocate = 1; return TOK_ALLOCATE;} 
     119deallocate              {inallocate = 1; return TOK_DEALLOCATE;} 
    115120result                  {return TOK_RESULT;} 
    116121function                {return TOK_FUNCTION;} 
     
    145150\=\>                    {return TOK_POINT_TO;} 
    146151\*\*                    {strcpy(yylval.na,yytext);return TOK_DASTER;} 
     152\.[ \t]*eqv\.            {strcpy(yylval.na,yytext);return TOK_EQV;} 
    147153\.[ \t]*eq\.            {strcpy(yylval.na,yytext);return TOK_EQ;} 
    148154\.[ \t]*gt\.            {strcpy(yylval.na,yytext);return TOK_GT;} 
     
    150156\.[ \t]*lt\.            {strcpy(yylval.na,yytext);return TOK_LT;} 
    151157\.[ \t]*le\.            {strcpy(yylval.na,yytext);return TOK_LE;} 
     158\.[ \t]*neqv\.          {strcpy(yylval.na,yytext);return TOK_NEQV;} 
    152159\.[ \t]*ne\.            {strcpy(yylval.na,yytext);return TOK_NE;} 
    153160\.[ \t]*not\.           {strcpy(yylval.na,yytext);return TOK_NOT;} 
     
    188195^[ \t]*type[ \t\,]+       {return TOK_TYPE;} 
    189196^[ \t]*type[ \t]*\(     {return TOK_TYPEPAR;} 
    190 stat                    {return TOK_STAT;} 
     197stat                    {if (inallocate == 1) return TOK_STAT; else {strcpy(yylval.na,yytext);return TOK_NAME;}} 
    191198end[ \t]*type           {return TOK_ENDTYPE;} 
    192199open                     return TOK_OPEN; 
     
    228235exist[ \t]*\=           {return TOK_EXIST;} 
    229236min[ \t]*\(             {return TOK_MIN;} 
    230 int                     {return TOK_INT;} 
    231237nint                    {return TOK_NINT;} 
    232238float                   {return TOK_FLOAT;} 
     
    271277\'|\"                   {return TOK_QUOTE;} 
    272278\.                      {} 
    273 ;|\(|\)|:|\[|\]|\+|\-|\*|\% {strcpy(yylval.na,yytext);return (int) *yytext;} 
     279\(|\)|:|\[|\]|\+|\-|\*|\% {strcpy(yylval.na,yytext);return (int) *yytext;} 
     280\;                      {return TOK_SEMICOLON;} 
    274281\,                      {return (int) *yytext;} 
    275 \;                      {return (int) *yytext;} 
    276282\=                      {return (int) *yytext;} 
    277283\<                      {return (int) *yytext;} 
     
    285291{NEXTLINEF90}           {line_num_fortran++;line_num_fortran_common++;newlinef90=1;colnum=0;} 
    286292{NEXTLINEF77}           {line_num_fortran++;line_num_fortran_common++;colnum=0;} 
    287 {COMMENTAIRESFORTRAN77} { 
     293<fortran77style>{COMMENTAIRESFORTRAN77} { 
    288294                           convert2lower(motparse1); 
    289295                           if ( strncasecmp(motparse1,"contains",8) == 0 ) 
     
    323329      printf("%s line %d, file %s\n",s,line_num_fortran_common,curfile); 
    324330   } 
     331   /*exit(0);*/ 
    325332} 
    326333 
Note: See TracChangeset for help on using the changeset viewer.