Changeset 1200 for trunk/AGRIF/LIB/fortran.lex
- Timestamp:
- 2008-09-24T15:05:20+02:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/AGRIF/LIB/fortran.lex
r774 r1200 36 36 %s character 37 37 %x donottreat 38 %s fortran77style 39 %s fortran90style 38 40 %{ 39 41 #include <math.h> … … 70 72 }\ 71 73 strcpy(motparse1,yytext);\ 74 /*printf("yytext = %s\n",yytext);*/\ 72 75 /*if ( firstpass == 1 ) 73 76 printf("yytext = %s %d\n",yytext,strlen(yytext));*/\ … … 102 105 NEXTLINEF77 \n[ \t]{5}("&"|"+"|"$"|"*"|"1"|"2"|"3"|"4"|"5"|"6"|"7"|"8"|"."|"#") 103 106 %% 107 if (infixed) BEGIN(fortran77style) ; 108 if (infree) BEGIN(fortran90style) ; 104 109 105 110 ^C${AGRIFDEB} return TOK_DEBUT; … … 111 116 subroutine {return TOK_SUBROUTINE;} 112 117 program {return TOK_PROGRAM;} 113 allocate { return TOK_ALLOCATE;}114 deallocate { return TOK_DEALLOCATE;}118 allocate {inallocate = 1; return TOK_ALLOCATE;} 119 deallocate {inallocate = 1; return TOK_DEALLOCATE;} 115 120 result {return TOK_RESULT;} 116 121 function {return TOK_FUNCTION;} … … 145 150 \=\> {return TOK_POINT_TO;} 146 151 \*\* {strcpy(yylval.na,yytext);return TOK_DASTER;} 152 \.[ \t]*eqv\. {strcpy(yylval.na,yytext);return TOK_EQV;} 147 153 \.[ \t]*eq\. {strcpy(yylval.na,yytext);return TOK_EQ;} 148 154 \.[ \t]*gt\. {strcpy(yylval.na,yytext);return TOK_GT;} … … 150 156 \.[ \t]*lt\. {strcpy(yylval.na,yytext);return TOK_LT;} 151 157 \.[ \t]*le\. {strcpy(yylval.na,yytext);return TOK_LE;} 158 \.[ \t]*neqv\. {strcpy(yylval.na,yytext);return TOK_NEQV;} 152 159 \.[ \t]*ne\. {strcpy(yylval.na,yytext);return TOK_NE;} 153 160 \.[ \t]*not\. {strcpy(yylval.na,yytext);return TOK_NOT;} … … 188 195 ^[ \t]*type[ \t\,]+ {return TOK_TYPE;} 189 196 ^[ \t]*type[ \t]*\( {return TOK_TYPEPAR;} 190 stat { return TOK_STAT;}197 stat {if (inallocate == 1) return TOK_STAT; else {strcpy(yylval.na,yytext);return TOK_NAME;}} 191 198 end[ \t]*type {return TOK_ENDTYPE;} 192 199 open return TOK_OPEN; … … 228 235 exist[ \t]*\= {return TOK_EXIST;} 229 236 min[ \t]*\( {return TOK_MIN;} 230 int {return TOK_INT;}231 237 nint {return TOK_NINT;} 232 238 float {return TOK_FLOAT;} … … 271 277 \'|\" {return TOK_QUOTE;} 272 278 \. {} 273 ;|\(|\)|:|\[|\]|\+|\-|\*|\% {strcpy(yylval.na,yytext);return (int) *yytext;} 279 \(|\)|:|\[|\]|\+|\-|\*|\% {strcpy(yylval.na,yytext);return (int) *yytext;} 280 \; {return TOK_SEMICOLON;} 274 281 \, {return (int) *yytext;} 275 \; {return (int) *yytext;}276 282 \= {return (int) *yytext;} 277 283 \< {return (int) *yytext;} … … 285 291 {NEXTLINEF90} {line_num_fortran++;line_num_fortran_common++;newlinef90=1;colnum=0;} 286 292 {NEXTLINEF77} {line_num_fortran++;line_num_fortran_common++;colnum=0;} 287 {COMMENTAIRESFORTRAN77} {293 <fortran77style>{COMMENTAIRESFORTRAN77} { 288 294 convert2lower(motparse1); 289 295 if ( strncasecmp(motparse1,"contains",8) == 0 ) … … 323 329 printf("%s line %d, file %s\n",s,line_num_fortran_common,curfile); 324 330 } 331 /*exit(0);*/ 325 332 } 326 333
Note: See TracChangeset
for help on using the changeset viewer.