[1901] | 1 | /******************************************************************************/ |
---|
| 2 | /* */ |
---|
| 3 | /* CONV (converter) for Agrif (Adaptive Grid Refinement In Fortran) */ |
---|
| 4 | /* */ |
---|
| 5 | /* Copyright or or Copr. Laurent Debreu (Laurent.Debreu@imag.fr) */ |
---|
| 6 | /* Cyril Mazauric (Cyril_Mazauric@yahoo.fr) */ |
---|
| 7 | /* This software is governed by the CeCILL-C license under French law and */ |
---|
| 8 | /* abiding by the rules of distribution of free software. You can use, */ |
---|
| 9 | /* modify and/ or redistribute the software under the terms of the CeCILL-C */ |
---|
| 10 | /* license as circulated by CEA, CNRS and INRIA at the following URL */ |
---|
| 11 | /* "http://www.cecill.info". */ |
---|
| 12 | /* */ |
---|
| 13 | /* As a counterpart to the access to the source code and rights to copy, */ |
---|
| 14 | /* modify and redistribute granted by the license, users are provided only */ |
---|
| 15 | /* with a limited warranty and the software's author, the holder of the */ |
---|
| 16 | /* economic rights, and the successive licensors have only limited */ |
---|
| 17 | /* liability. */ |
---|
| 18 | /* */ |
---|
| 19 | /* In this respect, the user's attention is drawn to the risks associated */ |
---|
| 20 | /* with loading, using, modifying and/or developing or reproducing the */ |
---|
| 21 | /* software by the user in light of its specific status of free software, */ |
---|
| 22 | /* that may mean that it is complicated to manipulate, and that also */ |
---|
| 23 | /* therefore means that it is reserved for developers and experienced */ |
---|
| 24 | /* professionals having in-depth computer knowledge. Users are therefore */ |
---|
| 25 | /* encouraged to load and test the software's suitability as regards their */ |
---|
| 26 | /* requirements in conditions enabling the security of their systems and/or */ |
---|
| 27 | /* data to be ensured and, more generally, to use and operate it in the */ |
---|
| 28 | /* same conditions as regards security. */ |
---|
| 29 | /* */ |
---|
| 30 | /* The fact that you are presently reading this means that you have had */ |
---|
| 31 | /* knowledge of the CeCILL-C license and that you accept its terms. */ |
---|
| 32 | /******************************************************************************/ |
---|
| 33 | /* version 1.7 */ |
---|
| 34 | /******************************************************************************/ |
---|
| 35 | %x parameter |
---|
| 36 | %s character |
---|
| 37 | %x donottreat |
---|
| 38 | %s fortran77style |
---|
| 39 | %s fortran90style |
---|
| 40 | %{ |
---|
| 41 | #include <math.h> |
---|
| 42 | #include <stdlib.h> |
---|
| 43 | #include <string.h> |
---|
| 44 | extern FILE * yyin; |
---|
| 45 | #define MAX_INCLUDE_DEPTH 30 |
---|
| 46 | #define tabsize 6 |
---|
| 47 | YY_BUFFER_STATE include_stack[MAX_INCLUDE_DEPTH]; |
---|
| 48 | int line_num_fortran=1; |
---|
| 49 | int line_num_fortran_common=1; |
---|
| 50 | int newlinef90 = 0; |
---|
| 51 | char *tmp; |
---|
| 52 | char tmpc; |
---|
| 53 | /******************************************************************************/ |
---|
| 54 | /**************PETITS PB NON PREVUS *******************************************/ |
---|
| 55 | /******************************************************************************/ |
---|
| 56 | /* NEXTLINF77 un ligne fortran 77 peut commencer par - &a=b or on */ |
---|
| 57 | /* a prevu seulement & a=b avec l'espace entre le symbole */ |
---|
| 58 | /* de la 7eme et le debut de la ligne de commande */ |
---|
| 59 | /* le ! est aussi interdit comme symbole de la 7 eme colonne */ |
---|
| 60 | /* Normalement NEXTLINEF77 \n+[ ]{5}[^ ] */ |
---|
| 61 | /******************************************************************************/ |
---|
| 62 | #define YY_USER_ACTION \ |
---|
| 63 | {\ |
---|
| 64 | if (firstpass == 0) \ |
---|
| 65 | {\ |
---|
| 66 | strcat(curbuf,yytext); \ |
---|
| 67 | Save_Length(curbuf,38); \ |
---|
| 68 | strcpy(motparse,yytext);\ |
---|
| 69 | Save_Length(motparse,32); \ |
---|
| 70 | colnum = colnum + strlen(motparse);\ |
---|
| 71 | ECHO; \ |
---|
| 72 | }\ |
---|
| 73 | strcpy(motparse1,yytext);\ |
---|
[2715] | 74 | /* printf("yytext = %s\n",yytext);*/\ |
---|
[1901] | 75 | /*if ( firstpass == 1 ) |
---|
| 76 | printf("yytext = %s %d\n",yytext,strlen(yytext));*/\ |
---|
| 77 | } |
---|
| 78 | %} |
---|
| 79 | AGRIFDEB "Agrif_debut" |
---|
| 80 | AGRIFFIN "Agrif_fin" |
---|
| 81 | REAL8 "real*8"[ \t]*"(a-h,o-z)" |
---|
| 82 | NOTTREAT Agrif_do_not_treat |
---|
| 83 | ENDNOTTREAT Agrif_end_do_not_treat |
---|
| 84 | |
---|
| 85 | NIMPORTEQUOI . |
---|
| 86 | SLASH "/" |
---|
| 87 | DSLASH "/"[ \t]*"/" |
---|
| 88 | NAME [a-zA-Z\_][a-zA-Z0-9\_]* |
---|
| 89 | DIGIT [0-9]+ |
---|
| 90 | INT {DIGIT} |
---|
| 91 | EXPONENT e[-+]?{DIGIT} |
---|
| 92 | DEXPONENT d[-+]?{DIGIT} |
---|
| 93 | QEXPONENT q[-+]?{DIGIT} |
---|
| 94 | REAL (({DIGIT}\.[0-9]+|[0-9]*\.{DIGIT}){EXPONENT}?)|{DIGIT}\.{EXPONENT} |
---|
| 95 | REALDP (({DIGIT}\.[0-9]+|[0-9]*\.{DIGIT}){DEXPONENT}?)|{DIGIT}\.{DEXPONENT} |
---|
| 96 | REALQP (({DIGIT}\.[0-9]+|[0-9]*\.{DIGIT}){QEXPONENT}?)|{DIGIT}\.{QEXPONENT} |
---|
| 97 | ENDFUNCTION end[ \t]*function |
---|
| 98 | DOUBLEPRECISION double[ \t]*precision |
---|
| 99 | DOUBLECOMPLEX double[ \t]*complex |
---|
| 100 | |
---|
| 101 | COMMENTAIRESFORTRAN77 ^([Cc*](([ \t]*\n)|([^AaHhOo\n]{NIMPORTEQUOI}*\n))) |
---|
[2715] | 102 | COMMENTAIRESFORTRAN77_2 \n([Cc*](([ \t]*\n)|([^AaHhOo\n]{NIMPORTEQUOI}*\n))) |
---|
[1901] | 103 | COMMENTAIRESFORTRAN90 ^([ \t]*!{NIMPORTEQUOI}*\n) |
---|
| 104 | COMMENTAIRESFORTRAN90_2 (!{NIMPORTEQUOI}*) |
---|
| 105 | NEXTLINEF90 "&"{NIMPORTEQUOI}*[\n]* |
---|
[2715] | 106 | NEXTLINEF77 [\n \t]*\n[ \t]{5}("&"|"+"|"$"|"*"|"1"|"2"|"3"|"4"|"5"|"6"|"7"|"8"|"9"|"."|"#") |
---|
[1901] | 107 | %% |
---|
| 108 | if (infixed) BEGIN(fortran77style) ; |
---|
| 109 | if (infree) BEGIN(fortran90style) ; |
---|
| 110 | |
---|
| 111 | ^C${AGRIFDEB} return TOK_DEBUT; |
---|
| 112 | ^C${AGRIFFIN} return TOK_FIN; |
---|
| 113 | ^C$OMP[ \t]*{NIMPORTEQUOI}* return TOK_OMP; |
---|
| 114 | ^C$[ \t]*{NIMPORTEQUOI}* return TOK_DOLLAR; |
---|
| 115 | |
---|
| 116 | {REAL8} {return TOK_REAL8;} |
---|
| 117 | subroutine {return TOK_SUBROUTINE;} |
---|
| 118 | program {return TOK_PROGRAM;} |
---|
| 119 | allocate {inallocate = 1; return TOK_ALLOCATE;} |
---|
[2715] | 120 | nullify {return TOK_NULLIFY;} |
---|
[1901] | 121 | deallocate {inallocate = 1; return TOK_DEALLOCATE;} |
---|
| 122 | result {return TOK_RESULT;} |
---|
| 123 | function {return TOK_FUNCTION;} |
---|
| 124 | end[ \t]*subroutine {strcpy(yylval.na,yytext);return TOK_ENDSUBROUTINE;} |
---|
| 125 | end[ \t]*program {strcpy(yylval.na,yytext);return TOK_ENDPROGRAM;} |
---|
| 126 | end[ \t]*function {strcpy(yylval.na,yytext);return TOK_ENDFUNCTION;} |
---|
| 127 | end {strcpy(yylval.na,yytext);return TOK_ENDUNIT;} |
---|
| 128 | include return TOK_INCLUDE; |
---|
| 129 | ^[ \t]*use[ ]+ { |
---|
| 130 | strcpy(yylval.na,yytext); |
---|
| 131 | tmpc = input(); |
---|
| 132 | unput(tmpc); |
---|
| 133 | if ( ( |
---|
| 134 | tmpc >= 'a' && tmpc <= 'z' |
---|
| 135 | ) || ( |
---|
| 136 | tmpc >= 'A' && tmpc <= 'Z' |
---|
| 137 | ) ) |
---|
| 138 | { |
---|
| 139 | return TOK_USE; |
---|
| 140 | } |
---|
| 141 | else |
---|
| 142 | { |
---|
| 143 | return TOK_NAME; |
---|
| 144 | } |
---|
| 145 | } |
---|
| 146 | rewind {return TOK_REWIND;} |
---|
| 147 | implicit return TOK_IMPLICIT; |
---|
| 148 | none return TOK_NONE; |
---|
| 149 | call return TOK_CALL; |
---|
| 150 | .true. return TOK_TRUE; |
---|
| 151 | .false. return TOK_FALSE; |
---|
| 152 | \=\> {return TOK_POINT_TO;} |
---|
| 153 | \*\* {strcpy(yylval.na,yytext);return TOK_DASTER;} |
---|
| 154 | \.[ \t]*eqv\. {strcpy(yylval.na,yytext);return TOK_EQV;} |
---|
| 155 | \.[ \t]*eq\. {strcpy(yylval.na,yytext);return TOK_EQ;} |
---|
| 156 | \.[ \t]*gt\. {strcpy(yylval.na,yytext);return TOK_GT;} |
---|
| 157 | \.[ \t]*ge\. {strcpy(yylval.na,yytext);return TOK_GE;} |
---|
| 158 | \.[ \t]*lt\. {strcpy(yylval.na,yytext);return TOK_LT;} |
---|
| 159 | \.[ \t]*le\. {strcpy(yylval.na,yytext);return TOK_LE;} |
---|
| 160 | \.[ \t]*neqv\. {strcpy(yylval.na,yytext);return TOK_NEQV;} |
---|
| 161 | \.[ \t]*ne\. {strcpy(yylval.na,yytext);return TOK_NE;} |
---|
| 162 | \.[ \t]*not\. {strcpy(yylval.na,yytext);return TOK_NOT;} |
---|
| 163 | \.[ \t]*or\. {strcpy(yylval.na,yytext);return TOK_OR;} |
---|
| 164 | \.[ \t]*xor\. {strcpy(yylval.na,yytext);return TOK_XOR;} |
---|
| 165 | \.[ \t]*and\. {strcpy(yylval.na,yytext);return TOK_AND;} |
---|
| 166 | module {return TOK_MODULE;} |
---|
| 167 | do[ 0-9\t]*while {return TOK_DOWHILE;} |
---|
| 168 | end[ \t]*module return TOK_ENDMODULE; |
---|
| 169 | end[ \t]*do return TOK_ENDDO; |
---|
| 170 | do {return TOK_PLAINDO;} |
---|
| 171 | real {strcpy(yylval.na,yytext);return TOK_REAL;} |
---|
| 172 | integer {strcpy(yylval.na,yytext);return TOK_INTEGER;} |
---|
| 173 | logical {strcpy(yylval.na,yytext);return TOK_LOGICAL;} |
---|
| 174 | character {strcpy(yylval.na,yytext);return TOK_CHARACTER;} |
---|
| 175 | allocatable {return TOK_ALLOCATABLE;} |
---|
| 176 | close return TOK_CLOSE; |
---|
| 177 | inquire return TOK_INQUIRE; |
---|
| 178 | dimension {return TOK_DIMENSION;} |
---|
| 179 | pause return TOK_PAUSE; |
---|
| 180 | equivalence return TOK_EQUIVALENCE; |
---|
| 181 | stop return TOK_STOP; |
---|
| 182 | where return TOK_WHERE; |
---|
| 183 | end[ \t]*where return TOK_ENDWHERE; |
---|
| 184 | else[ \t]*where return TOK_ELSEWHERE; |
---|
| 185 | complex {return TOK_COMPLEX;} |
---|
| 186 | ^[ \t]*contains {return TOK_CONTAINS;} |
---|
| 187 | only {return TOK_ONLY;} |
---|
| 188 | parameter {return TOK_PARAMETER;} |
---|
| 189 | recursive {return TOK_RECURSIVE;} |
---|
| 190 | common {return TOK_COMMON;} |
---|
| 191 | ^[ \t]*global[ \t]+ {return TOK_GLOBAL;} |
---|
| 192 | external {return TOK_EXTERNAL;} |
---|
| 193 | intent {return TOK_INTENT;} |
---|
| 194 | pointer {return TOK_POINTER;} |
---|
| 195 | optional {return TOK_OPTIONAL;} |
---|
| 196 | save {return TOK_SAVE;} |
---|
| 197 | ^[ \t]*type[ \t\,]+ {return TOK_TYPE;} |
---|
| 198 | ^[ \t]*type[ \t]*\( {return TOK_TYPEPAR;} |
---|
| 199 | stat {if (inallocate == 1) return TOK_STAT; else {strcpy(yylval.na,yytext);return TOK_NAME;}} |
---|
| 200 | end[ \t]*type {return TOK_ENDTYPE;} |
---|
| 201 | open return TOK_OPEN; |
---|
| 202 | return return TOK_RETURN; |
---|
| 203 | exit[^(] return TOK_EXIT; |
---|
| 204 | print return TOK_PRINT; |
---|
| 205 | module[ \t]*procedure {return TOK_PROCEDURE;} |
---|
| 206 | read {return TOK_READ;} |
---|
| 207 | namelist {return TOK_NAMELIST;} |
---|
| 208 | write {return TOK_WRITE;} |
---|
| 209 | target {return TOK_TARGET;} |
---|
| 210 | public {return TOK_PUBLIC;} |
---|
| 211 | private {return TOK_PRIVATE;} |
---|
| 212 | in {strcpy(yylval.nac,yytext);return TOK_IN;} |
---|
| 213 | ^[ \t]*data[ \t]+ {strcpy(yylval.na,yytext);return TOK_DATA;} |
---|
| 214 | continue return TOK_CONTINUE; |
---|
| 215 | go[ \t]*to {return TOK_PLAINGOTO;} |
---|
| 216 | out {strcpy(yylval.nac,yytext);return TOK_OUT;} |
---|
| 217 | inout {strcpy(yylval.nac,yytext);return TOK_INOUT;} |
---|
| 218 | intrinsic {return TOK_INTRINSIC;} |
---|
| 219 | then {return TOK_THEN;} |
---|
| 220 | else[ \t]*if {return TOK_ELSEIF;} |
---|
| 221 | else {return TOK_ELSE;} |
---|
| 222 | end[ \t]*if {return TOK_ENDIF;} |
---|
| 223 | if[ \t]*\( {return TOK_LOGICALIF;} |
---|
| 224 | sum[ \t]*\( {return TOK_SUM;} |
---|
| 225 | max[ \t]*\( {return TOK_MAX;} |
---|
| 226 | tanh {return TOK_TANH;} |
---|
| 227 | maxval {return TOK_MAXVAL;} |
---|
| 228 | trim {return TOK_TRIM;} |
---|
| 229 | sqrt\( {return TOK_SQRT;} |
---|
| 230 | select[ \t]*case {return TOK_SELECTCASE;} |
---|
| 231 | ^[ \t]*case[ \t]*\( {return TOK_CASE;} |
---|
| 232 | ^[ \t]*case[ \t]*default {return TOK_CASEDEFAULT;} |
---|
| 233 | end[ \t]*select {return TOK_ENDSELECT;} |
---|
| 234 | file[ \t]*\= {return TOK_FILE;} |
---|
| 235 | end[ \t]*\= {return TOK_END;} |
---|
| 236 | err[ \t]*\= {return TOK_ERR;} |
---|
| 237 | exist[ \t]*\= {return TOK_EXIST;} |
---|
| 238 | min[ \t]*\( {return TOK_MIN;} |
---|
| 239 | nint {return TOK_NINT;} |
---|
| 240 | float {return TOK_FLOAT;} |
---|
| 241 | exp {return TOK_EXP;} |
---|
| 242 | cos {return TOK_COS;} |
---|
| 243 | cosh {return TOK_COSH;} |
---|
| 244 | acos {return TOK_ACOS;} |
---|
| 245 | sin {return TOK_SIN;} |
---|
| 246 | sinh {return TOK_SINH;} |
---|
| 247 | asin {return TOK_ASIN;} |
---|
| 248 | log {return TOK_LOG;} |
---|
| 249 | tan {return TOK_TAN;} |
---|
| 250 | atan {return TOK_ATAN;} |
---|
| 251 | cycle {return TOK_CYCLE;} |
---|
| 252 | abs\( {return TOK_ABS;} |
---|
| 253 | mod {return TOK_MOD;} |
---|
| 254 | sign {return TOK_SIGN;} |
---|
| 255 | minloc {return TOK_MINLOC;} |
---|
| 256 | maxloc {return TOK_MAXLOC;} |
---|
| 257 | minval {return TOK_MINVAL;} |
---|
| 258 | backspace {return TOK_BACKSPACE;} |
---|
| 259 | \({SLASH} {return TOK_LEFTAB;} |
---|
| 260 | {SLASH}\) {return TOK_RIGHTAB;} |
---|
| 261 | format[ \t]*\(({NIMPORTEQUOI}|{NEXTLINEF90}|{NEXTLINEF77})*\) {return TOK_FORMAT;} |
---|
| 262 | {DOUBLEPRECISION} {strcpy(yylval.na,yytext);return TOK_DOUBLEPRECISION;} |
---|
| 263 | {DOUBLECOMPLEX} {strcpy(yylval.na,yytext);return TOK_DOUBLECOMPLEX;} |
---|
| 264 | {SLASH} {strcpy(yylval.na,yytext);return TOK_SLASH;} |
---|
| 265 | DSLASH {strcpy(yylval.na,yytext);return TOK_DSLASH;} |
---|
| 266 | (\')[^']*&{0,1}\n[ \t]*&{0,1}[^']*(\') {strcpy(yylval.na,yytext);return TOK_CHAR_CUT;} |
---|
| 267 | (\')[^\n']*(\') {strcpy(yylval.na,yytext);return TOK_CHAR_CONSTANT;} |
---|
| 268 | (\")[^\n"]*(\") {strcpy(yylval.na,yytext);return TOK_CHAR_MESSAGE;} |
---|
| 269 | ({NAME}{REAL}) {strcpy(yylval.na,yytext);return TOK_CHAR_INT;} |
---|
[2715] | 270 | ^[ \t]*interface {printf("debug interfacer\n");BEGIN(donottreat);} |
---|
| 271 | <donottreat>^[ \t]*end[ \t]*interface[ \t]*\n { |
---|
| 272 | BEGIN(INITIAL); |
---|
| 273 | if (infixed) BEGIN(fortran77style) ; |
---|
| 274 | if (infree) BEGIN(fortran90style) ; |
---|
| 275 | line_num_fortran++;line_num_fortran_common++; |
---|
| 276 | return '\n'; |
---|
| 277 | } |
---|
[1901] | 278 | {NAME} {strcpy(yylval.na,yytext);return TOK_NAME;} |
---|
| 279 | {REAL} {strcpy(yylval.na,yytext);return TOK_CSTREAL;} |
---|
| 280 | {REALDP} {strcpy(yylval.na,yytext);return TOK_CSTREALDP;} |
---|
| 281 | {REALQP} {strcpy(yylval.na,yytext);return TOK_CSTREALQP;} |
---|
| 282 | ({DIGIT}\.)/[^{NAME}|"and."|"false."|"true."|"eq."|"or."|"gt."|"ge."|"lt."|"le."|"not."|"ne."] {strcpy(yylval.na,yytext);return TOK_CSTREAL;} |
---|
| 283 | {INT} {strcpy(yylval.na,yytext);return TOK_CSTINT;} |
---|
| 284 | \$ {} |
---|
| 285 | \'|\" {return TOK_QUOTE;} |
---|
| 286 | \. {} |
---|
[2715] | 287 | \(|\)|:|\[|\]|\+|\-|\* {strcpy(yylval.na,yytext);return (int) *yytext;} |
---|
| 288 | \% {afterpercent = 1; strcpy(yylval.na,yytext);return (int) *yytext;} |
---|
[1901] | 289 | \; {return TOK_SEMICOLON;} |
---|
| 290 | \, {return (int) *yytext;} |
---|
| 291 | \= {return (int) *yytext;} |
---|
| 292 | \< {return (int) *yytext;} |
---|
| 293 | \> {return (int) *yytext;} |
---|
| 294 | \n {colnum=0;line_num_fortran++;line_num_fortran_common++; return (int) *yytext;} |
---|
| 295 | ^[ ]*$ |
---|
| 296 | ^(((" "|[0-9]){1,5})|([ \t]{1,5}))[ &]+ {if (newlinef90 == 0) return TOK_LABEL; else newlinef90 = 0;} |
---|
| 297 | [ ]+ |
---|
| 298 | [\t]+ {colnum=colnum-1+tabsize;} |
---|
| 299 | [ \t]+ ; |
---|
| 300 | {NEXTLINEF90} {line_num_fortran++;line_num_fortran_common++;newlinef90=1;colnum=0;} |
---|
| 301 | {NEXTLINEF77} {line_num_fortran++;line_num_fortran_common++;colnum=0;} |
---|
| 302 | <fortran77style>{COMMENTAIRESFORTRAN77} { |
---|
| 303 | convert2lower(motparse1); |
---|
| 304 | if ( strncasecmp(motparse1,"contains",8) == 0 ) |
---|
| 305 | { |
---|
| 306 | return TOK_CONTAINS; |
---|
| 307 | } |
---|
| 308 | else |
---|
| 309 | { |
---|
[2715] | 310 | /* colnum=0;line_num_fortran++;line_num_fortran_common++;*/ |
---|
| 311 | if ( !strcasecmp(motparse1,"C$AGRIF_DO_NOT_TREAT\n")) |
---|
| 312 | return TOK_DONOTTREAT; |
---|
[1901] | 313 | if ( !strcasecmp(motparse1,"C$AGRIF_END_DO_NOT_TREAT\n")) return TOK_ENDDONOTTREAT; |
---|
[2715] | 314 | unput('\n'); |
---|
[1901] | 315 | } |
---|
| 316 | } |
---|
[2715] | 317 | <fortran77style>{COMMENTAIRESFORTRAN77_2} { |
---|
| 318 | convert2lower(&motparse1[1]); |
---|
| 319 | if ( strncasecmp(&motparse1[1],"contains",8) == 0 ) |
---|
| 320 | { |
---|
| 321 | return TOK_CONTAINS; |
---|
| 322 | } |
---|
| 323 | else |
---|
| 324 | { |
---|
| 325 | /* colnum=0;line_num_fortran++;line_num_fortran_common++;*/ |
---|
| 326 | if ( !strcasecmp(&motparse1[1],"C$AGRIF_DO_NOT_TREAT\n")) |
---|
| 327 | return TOK_DONOTTREAT; |
---|
| 328 | if ( !strcasecmp(&motparse1[1],"C$AGRIF_END_DO_NOT_TREAT\n")) return TOK_ENDDONOTTREAT; |
---|
| 329 | unput('\n'); |
---|
| 330 | } |
---|
| 331 | } |
---|
| 332 | ^"!$AGRIF_DO_NOT_TREAT"[ \t]*\n { |
---|
| 333 | BEGIN(donottreat); |
---|
| 334 | } |
---|
| 335 | <donottreat>^"!$AGRIF_END_DO_NOT_TREAT"[ \t]*\n { |
---|
| 336 | BEGIN(INITIAL); |
---|
| 337 | if (infixed) BEGIN(fortran77style) ; |
---|
| 338 | if (infree) BEGIN(fortran90style) ; |
---|
| 339 | line_num_fortran++;line_num_fortran_common++; |
---|
| 340 | return '\n'; |
---|
| 341 | } |
---|
| 342 | <donottreat>.*\n {line_num_fortran++;line_num_fortran_common++;} |
---|
[1901] | 343 | {COMMENTAIRESFORTRAN90} { |
---|
| 344 | colnum = 0; |
---|
| 345 | if ( !strcasecmp(motparse1,"!$AGRIF_DO_NOT_TREAT\n")) return TOK_DONOTTREAT; |
---|
| 346 | if ( !strcasecmp(motparse1,"!$AGRIF_END_DO_NOT_TREAT\n")) return TOK_ENDDONOTTREAT; |
---|
| 347 | } |
---|
| 348 | {COMMENTAIRESFORTRAN90_2} { |
---|
| 349 | colnum = 0; |
---|
| 350 | if ( !strcasecmp(motparse1,"!$AGRIF_DO_NOT_TREAT\n")) return TOK_DONOTTREAT; |
---|
| 351 | if ( !strcasecmp(motparse1,"!$AGRIF_END_DO_NOT_TREAT\n")) return TOK_ENDDONOTTREAT; |
---|
| 352 | } |
---|
| 353 | %% |
---|
| 354 | |
---|
| 355 | fortranerror(char *s) |
---|
| 356 | { |
---|
| 357 | if (!strcasecmp(curfile,mainfile)) |
---|
| 358 | { |
---|
[2715] | 359 | printf("%s line %d, file %s motclef = %s\n",s,line_num_fortran,curfile,yytext); |
---|
[1901] | 360 | } |
---|
| 361 | else |
---|
| 362 | { |
---|
[2715] | 363 | printf("%s line %d, file %s motclef = %s curbuf = %s\n",s,line_num_fortran_common,curfile,yytext,curbuf); |
---|
[1901] | 364 | } |
---|
[2715] | 365 | /* exit(0);*/ |
---|
[1901] | 366 | } |
---|
| 367 | |
---|
| 368 | int fortranwrap() |
---|
| 369 | { |
---|
| 370 | } |
---|