[396] | 1 | #ifndef lint |
---|
[1349] | 2 | static char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93"; |
---|
[396] | 3 | #endif |
---|
| 4 | #define YYBYACC 1 |
---|
| 5 | #define YYMAJOR 1 |
---|
| 6 | #define YYMINOR 9 |
---|
[1349] | 7 | #define yyclearin (yychar=(-1)) |
---|
| 8 | #define yyerrok (yyerrflag=0) |
---|
| 9 | #define YYRECOVERING (yyerrflag!=0) |
---|
[396] | 10 | #define YYPREFIX "yy" |
---|
[530] | 11 | #line 36 "convert.y" |
---|
[396] | 12 | #include <stdlib.h> |
---|
| 13 | #include <stdio.h> |
---|
| 14 | #include <string.h> |
---|
| 15 | #include "decl.h" |
---|
[530] | 16 | #line 42 "convert.y" |
---|
[396] | 17 | typedef union { |
---|
| 18 | int ival; |
---|
[774] | 19 | char na[LONG_C]; |
---|
[396] | 20 | listnom * ln; |
---|
| 21 | } YYSTYPE; |
---|
[1349] | 22 | #line 23 "y.tab.c" |
---|
[396] | 23 | #define TOK_SEP 257 |
---|
| 24 | #define TOK_USE 258 |
---|
[530] | 25 | #define TOK_MODULEMAIN 259 |
---|
| 26 | #define TOK_NOTGRIDDEP 260 |
---|
| 27 | #define TOK_USEITEM 261 |
---|
| 28 | #define TOK_NAME 262 |
---|
| 29 | #define TOK_PROBTYPE 263 |
---|
[396] | 30 | #define YYERRCODE 256 |
---|
| 31 | short yylhs[] = { -1, |
---|
[530] | 32 | 0, 0, 1, 1, 1, 1, 1, 1, 1, |
---|
[396] | 33 | }; |
---|
| 34 | short yylen[] = { 2, |
---|
[530] | 35 | 0, 2, 1, 3, 5, 7, 3, 4, 3, |
---|
[396] | 36 | }; |
---|
| 37 | short yydefred[] = { 1, |
---|
[530] | 38 | 0, 0, 0, 0, 0, 3, 2, 0, 0, 0, |
---|
| 39 | 0, 9, 7, 0, 0, 4, 8, 0, 0, 5, |
---|
| 40 | 0, 6, |
---|
[396] | 41 | }; |
---|
| 42 | short yydgoto[] = { 1, |
---|
[530] | 43 | 7, |
---|
[396] | 44 | }; |
---|
| 45 | short yysindex[] = { 0, |
---|
[530] | 46 | -10, -258, -257, -253, -256, 0, 0, -52, -51, -252, |
---|
| 47 | -43, 0, 0, -50, -251, 0, 0, -42, -250, 0, |
---|
| 48 | -46, 0, |
---|
[396] | 49 | }; |
---|
| 50 | short yyrindex[] = { 0, |
---|
| 51 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
---|
| 52 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
---|
[530] | 53 | 0, 0, |
---|
[396] | 54 | }; |
---|
| 55 | short yygindex[] = { 0, |
---|
| 56 | 0, |
---|
| 57 | }; |
---|
[530] | 58 | #define YYTABLESIZE 253 |
---|
| 59 | short yytable[] = { 6, |
---|
| 60 | 15, 19, 8, 10, 9, 11, 12, 13, 17, 14, |
---|
| 61 | 18, 21, 22, 0, 0, 16, 20, 0, 0, 0, |
---|
[396] | 62 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
---|
| 63 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
---|
| 64 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
---|
| 65 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
---|
| 66 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
---|
| 67 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
---|
| 68 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
---|
| 69 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
---|
| 70 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
---|
| 71 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
---|
| 72 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
---|
| 73 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
---|
| 74 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
---|
| 75 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
---|
| 76 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
---|
| 77 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
---|
| 78 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
---|
| 79 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
---|
| 80 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
---|
[530] | 81 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
---|
| 82 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
---|
| 83 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
---|
[396] | 84 | 0, 0, 0, 0, 0, 0, 0, 2, 3, 4, |
---|
[530] | 85 | 0, 0, 5, |
---|
[396] | 86 | }; |
---|
| 87 | short yycheck[] = { 10, |
---|
[530] | 88 | 44, 44, 261, 257, 262, 262, 59, 59, 59, 262, |
---|
| 89 | 262, 262, 59, -1, -1, 59, 59, -1, -1, -1, |
---|
[396] | 90 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
---|
| 91 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
---|
| 92 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
---|
| 93 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
---|
| 94 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
---|
| 95 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
---|
| 96 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
---|
| 97 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
---|
| 98 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
---|
| 99 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
---|
| 100 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
---|
| 101 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
---|
| 102 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
---|
| 103 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
---|
| 104 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
---|
| 105 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
---|
| 106 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
---|
| 107 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
---|
| 108 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
---|
[530] | 109 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
---|
| 110 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
---|
| 111 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
---|
[396] | 112 | -1, -1, -1, -1, -1, -1, -1, 258, 259, 260, |
---|
[530] | 113 | -1, -1, 263, |
---|
[396] | 114 | }; |
---|
| 115 | #define YYFINAL 1 |
---|
| 116 | #ifndef YYDEBUG |
---|
| 117 | #define YYDEBUG 1 |
---|
| 118 | #endif |
---|
[530] | 119 | #define YYMAXTOKEN 263 |
---|
[396] | 120 | #if YYDEBUG |
---|
| 121 | char *yyname[] = { |
---|
| 122 | "end-of-file",0,0,0,0,0,0,0,0,0,"'\\n'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, |
---|
| 123 | 0,0,0,0,0,0,0,0,0,"'('","')'",0,0,"','",0,0,0,0,0,0,0,0,0,0,0,0,0,"':'","';'",0, |
---|
| 124 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"'['",0,"']'",0,0,0, |
---|
| 125 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, |
---|
| 126 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, |
---|
| 127 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, |
---|
| 128 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, |
---|
[530] | 129 | "TOK_SEP","TOK_USE","TOK_MODULEMAIN","TOK_NOTGRIDDEP","TOK_USEITEM","TOK_NAME", |
---|
| 130 | "TOK_PROBTYPE", |
---|
[396] | 131 | }; |
---|
| 132 | char *yyrule[] = { |
---|
| 133 | "$accept : input", |
---|
| 134 | "input :", |
---|
| 135 | "input : input line", |
---|
| 136 | "line : '\\n'", |
---|
| 137 | "line : TOK_PROBTYPE TOK_NAME ';'", |
---|
| 138 | "line : TOK_PROBTYPE TOK_NAME ',' TOK_NAME ';'", |
---|
| 139 | "line : TOK_PROBTYPE TOK_NAME ',' TOK_NAME ',' TOK_NAME ';'", |
---|
| 140 | "line : TOK_MODULEMAIN TOK_NAME ';'", |
---|
| 141 | "line : TOK_NOTGRIDDEP TOK_SEP TOK_NAME ';'", |
---|
| 142 | "line : TOK_USE TOK_USEITEM ';'", |
---|
| 143 | }; |
---|
| 144 | #endif |
---|
| 145 | #ifdef YYSTACKSIZE |
---|
| 146 | #undef YYMAXDEPTH |
---|
[1349] | 147 | #define YYMAXDEPTH YYSTACKSIZE |
---|
[396] | 148 | #else |
---|
| 149 | #ifdef YYMAXDEPTH |
---|
| 150 | #define YYSTACKSIZE YYMAXDEPTH |
---|
| 151 | #else |
---|
| 152 | #define YYSTACKSIZE 500 |
---|
[1349] | 153 | #define YYMAXDEPTH 500 |
---|
[396] | 154 | #endif |
---|
| 155 | #endif |
---|
[1349] | 156 | int yydebug; |
---|
| 157 | int yynerrs; |
---|
| 158 | int yyerrflag; |
---|
| 159 | int yychar; |
---|
| 160 | short *yyssp; |
---|
[396] | 161 | YYSTYPE *yyvsp; |
---|
[1349] | 162 | YYSTYPE yyval; |
---|
| 163 | YYSTYPE yylval; |
---|
| 164 | short yyss[YYSTACKSIZE]; |
---|
| 165 | YYSTYPE yyvs[YYSTACKSIZE]; |
---|
| 166 | #define yystacksize YYSTACKSIZE |
---|
[663] | 167 | #line 83 "convert.y" |
---|
[396] | 168 | |
---|
| 169 | int main(int argc,char *argv[]) |
---|
| 170 | { |
---|
| 171 | extern FILE * yyin ; |
---|
| 172 | FILE *dependglobaloutput; |
---|
| 173 | int i; |
---|
| 174 | listnom *parcours; |
---|
[663] | 175 | listvar *newvar; |
---|
[1200] | 176 | int stylegiven = 0; |
---|
| 177 | int infreegiven ; |
---|
| 178 | int infixedgiven ; |
---|
| 179 | int lengthmainfile; |
---|
[396] | 180 | |
---|
[663] | 181 | if (argc < 2) |
---|
[530] | 182 | { |
---|
| 183 | printf("usage : conv <file> [-rm] [-incdir <directory>] \n"); |
---|
| 184 | printf(" [-comdirin <directory>] [-comdirout <directory>]\n"); |
---|
[663] | 185 | printf(" [-convfile <FILENAME >] -SubloopScalar -SubloopScalar1 \n"); |
---|
[1200] | 186 | printf(" [-free|-fixed]\n"); |
---|
[530] | 187 | exit(0); |
---|
| 188 | } |
---|
[396] | 189 | /******************************************************************************/ |
---|
| 190 | /* 1- Variables initialization */ |
---|
| 191 | /******************************************************************************/ |
---|
[663] | 192 | List_Global_Var=(listvar *)NULL; |
---|
| 193 | List_GlobalParameter_Var=(listvar *)NULL; |
---|
| 194 | List_Allocate_Var=(listallocate *)NULL; |
---|
| 195 | List_Common_Var=(listvar *)NULL; |
---|
| 196 | List_SubroutineWhereAgrifUsed=(listnom *)NULL; |
---|
| 197 | List_Subroutine_For_Alloc=(listnom *)NULL; |
---|
| 198 | List_Include=(listusemodule *)NULL; |
---|
| 199 | List_NameOfModuleUsed=(listusemodule *)NULL; |
---|
[396] | 200 | listofmoduletmp=(listusemodule *)NULL; |
---|
[663] | 201 | List_SubroutineDeclaration_Var=(listvar *)NULL; |
---|
| 202 | List_UsedInSubroutine_Var=(listvar *)NULL; |
---|
| 203 | List_NotGridDepend_Var=(listvar *)NULL; |
---|
[396] | 204 | Listofavailableindices=(listindice *)NULL; |
---|
[663] | 205 | List_CouplePointed_Var=(listvarpointtovar *)NULL; |
---|
| 206 | List_ModuleUsed_Var = (listvar *)NULL; |
---|
| 207 | List_ModuleUsedInModuleUsed_Var = (listvar *)NULL; |
---|
| 208 | List_GlobParamModuleUsed_Var = (listparameter *)NULL; |
---|
| 209 | List_GlobParamModuleUsedInModuleUsed_Var = (listparameter *)NULL; |
---|
| 210 | List_SubroutineArgument_Var = (listvar *)NULL; |
---|
| 211 | List_FunctionType_Var = (listvar *)NULL; |
---|
| 212 | tmpuselocallist = (listusemodule *)NULL; |
---|
| 213 | List_ContainsSubroutine = (listnom *)NULL; |
---|
[1200] | 214 | oldfortranout = (FILE *)NULL; |
---|
[663] | 215 | |
---|
| 216 | strcpy(mainfile,argv[1]); |
---|
[396] | 217 | strcpy(nomdir,"AGRIF_INC"); |
---|
| 218 | strcpy(commondirin,"."); |
---|
| 219 | strcpy(commondirout,"."); |
---|
[663] | 220 | strcpy(filetoparse," "); |
---|
| 221 | strcpy(subofagrifinitgrids,""); |
---|
[396] | 222 | strcpy(meetagrifinitgrids,""); |
---|
| 223 | strcpy(mpiinitvar,""); |
---|
| 224 | |
---|
[774] | 225 | length_last = 0 ; |
---|
| 226 | length_first = 0 ; |
---|
| 227 | length_v_typevar = 0 ; |
---|
| 228 | length_v_nomvar = 0 ; |
---|
| 229 | length_v_dimchar = 0 ; |
---|
| 230 | length_v_modulename = 0 ; |
---|
| 231 | length_v_commonname = 0 ; |
---|
| 232 | length_v_vallengspec = 0 ; |
---|
| 233 | length_v_nameinttypename = 0 ; |
---|
| 234 | length_v_commoninfile = 0 ; |
---|
| 235 | length_v_subroutinename = 0 ; |
---|
| 236 | length_v_precision = 0 ; |
---|
| 237 | length_v_IntentSpec = 0 ; |
---|
| 238 | length_v_initialvalue = 0 ; |
---|
| 239 | length_v_readedlistdimension = 0 ; |
---|
| 240 | length_u_usemodule = 0 ; |
---|
| 241 | length_u_charusemodule = 0 ; |
---|
| 242 | length_u_cursubroutine = 0 ; |
---|
| 243 | length_u_modulename = 0 ; |
---|
| 244 | length_n_name = 0 ; |
---|
| 245 | length_c_namevar = 0 ; |
---|
| 246 | length_c_namepointedvar = 0 ; |
---|
| 247 | length_o_nom = 0 ; |
---|
| 248 | length_o_module = 0 ; |
---|
| 249 | length_a_nomvar = 0 ; |
---|
| 250 | length_a_subroutine = 0 ; |
---|
| 251 | length_a_module = 0 ; |
---|
| 252 | length_t_usemodule = 0 ; |
---|
| 253 | length_t_cursubroutine = 0 ; |
---|
| 254 | length_curfilename = 0 ; |
---|
| 255 | length_nomfileoutput = 0 ; |
---|
| 256 | length_motparse = 0 ; |
---|
| 257 | length_mainfile = 0 ; |
---|
| 258 | length_nomdir = 0 ; |
---|
| 259 | length_commondirout = 0 ; |
---|
| 260 | length_commondirin = 0 ; |
---|
| 261 | length_filetoparse = 0 ; |
---|
| 262 | length_curbuf = 0 ; |
---|
| 263 | length_toprintglob = 0 ; |
---|
| 264 | length_tmpvargridname = 0 ; |
---|
| 265 | length_ligne_Subloop = 0 ; |
---|
| 266 | length_lvargridname_toamr = 0 ; |
---|
| 267 | length_toprint_utilagrif = 0 ; |
---|
| 268 | length_toprinttmp_utilchar = 0 ; |
---|
| 269 | length_ligne_writedecl = 0 ; |
---|
| 270 | length_newname_toamr = 0 ; |
---|
| 271 | length_newname_writedecl = 0 ; |
---|
| 272 | length_ligne_toamr = 0 ; |
---|
| 273 | length_tmpligne_writedecl = 0 ; |
---|
| 274 | value_char_size = 0 ; |
---|
| 275 | value_char_size1 = 0 ; |
---|
| 276 | value_char_size2 = 0 ; |
---|
| 277 | value_char_size3 = 0 ; |
---|
[1200] | 278 | inallocate = 0; |
---|
| 279 | infixed = 1; |
---|
| 280 | infree = 0; |
---|
[774] | 281 | |
---|
[396] | 282 | checkexistcommon=1; |
---|
| 283 | todebug=0; |
---|
| 284 | onlyfixedgrids=0; |
---|
| 285 | fixedgrids=0; |
---|
| 286 | InAgrifParentDef = 0; |
---|
| 287 | IndicenbmaillesX=0; |
---|
| 288 | IndicenbmaillesY=0; |
---|
| 289 | IndicenbmaillesZ=0; |
---|
[530] | 290 | created_dimensionlist = 1; |
---|
[396] | 291 | indicemaxtabvars = 0; /* current indice in the table tabvars */ |
---|
| 292 | SubloopScalar = 0; |
---|
[663] | 293 | todebug = 0; |
---|
| 294 | todebugfree = 0; |
---|
| 295 | retour77 = 1 ; |
---|
| 296 | mark = 0 ; |
---|
| 297 | shouldincludempif = 0 ; |
---|
[774] | 298 | Read_val_max(); |
---|
[396] | 299 | /******************************************************************************/ |
---|
| 300 | /* 2- Program arguments */ |
---|
| 301 | /******************************************************************************/ |
---|
| 302 | |
---|
[663] | 303 | if ((yyin=fopen(argv[1],"r"))==NULL) |
---|
[396] | 304 | { |
---|
| 305 | printf("the file %s doesn't exist \n",argv[1]); |
---|
[663] | 306 | exit(0); |
---|
[396] | 307 | } |
---|
| 308 | |
---|
| 309 | i=2; |
---|
| 310 | while (i<argc) |
---|
| 311 | { |
---|
[663] | 312 | if (!strcasecmp(argv[i],"-incdir")) |
---|
[396] | 313 | { |
---|
| 314 | strcpy(nomdir,argv[i+1]); |
---|
| 315 | i++; |
---|
| 316 | } |
---|
| 317 | else if (!strcasecmp(argv[i],"-comdirin")) /* input directory */ |
---|
[663] | 318 | { |
---|
[396] | 319 | strcpy(commondirin,argv[i+1]); |
---|
| 320 | i++; |
---|
| 321 | } |
---|
| 322 | else if (!strcasecmp(argv[i],"-comdirout")) /* output directory */ |
---|
| 323 | { |
---|
| 324 | strcpy(commondirout,argv[i+1]); |
---|
| 325 | i++; |
---|
[663] | 326 | } |
---|
[396] | 327 | else if (!strcasecmp(argv[i],"-convfile")) /* file to parse */ |
---|
[663] | 328 | { |
---|
[396] | 329 | strcpy(filetoparse,argv[i+1]); |
---|
| 330 | i++; |
---|
[1200] | 331 | lengthmainfile = strlen(filetoparse); |
---|
| 332 | if (!strcasecmp(&filetoparse[lengthmainfile-4],".f90")) |
---|
| 333 | { |
---|
| 334 | infixed = 0; |
---|
| 335 | infree = 1; |
---|
| 336 | } |
---|
| 337 | else |
---|
| 338 | { |
---|
| 339 | infixed = 1; |
---|
| 340 | infree = 0; |
---|
| 341 | } |
---|
[663] | 342 | } |
---|
[1200] | 343 | else if (!strcasecmp(argv[i],"-free")) /* file to parse */ |
---|
| 344 | { |
---|
| 345 | stylegiven = 1; |
---|
| 346 | infreegiven = 1 ; |
---|
| 347 | infixedgiven = 0; |
---|
| 348 | } |
---|
| 349 | else if (!strcasecmp(argv[i],"-fixed")) /* file to parse */ |
---|
| 350 | { |
---|
| 351 | stylegiven = 1; |
---|
| 352 | infreegiven = 0; |
---|
| 353 | infixedgiven = 1; |
---|
| 354 | } |
---|
[396] | 355 | else if (!strcasecmp(argv[i],"-SubloopScalar")) /* file to parse */ |
---|
[663] | 356 | { |
---|
[396] | 357 | SubloopScalar = 1 ; |
---|
[663] | 358 | } |
---|
[396] | 359 | else if (!strcasecmp(argv[i],"-SubloopScalar1")) /* file to parse */ |
---|
[663] | 360 | { |
---|
[396] | 361 | SubloopScalar = 2 ; |
---|
[663] | 362 | } |
---|
| 363 | else if (!strcasecmp(argv[i],"-todebug")) /* file to parse */ |
---|
| 364 | { |
---|
| 365 | todebug = 1 ; |
---|
| 366 | } |
---|
| 367 | else if (!strcasecmp(argv[i],"-mark")) /* file to parse */ |
---|
| 368 | { |
---|
| 369 | mark = 1 ; |
---|
| 370 | } |
---|
| 371 | else if (!strcasecmp(argv[i],"-todebugfree")) /* file to parse */ |
---|
| 372 | { |
---|
| 373 | todebugfree = 1 ; |
---|
| 374 | } |
---|
| 375 | else if (!strcasecmp(argv[i],"-rm")) |
---|
| 376 | { |
---|
[396] | 377 | checkexistcommon=0; |
---|
| 378 | } |
---|
[663] | 379 | else |
---|
[396] | 380 | { |
---|
| 381 | printf("Unkwon option : %s\n",argv[i]); |
---|
| 382 | exit(0); |
---|
| 383 | } |
---|
[663] | 384 | i++; |
---|
| 385 | } |
---|
[396] | 386 | |
---|
[1200] | 387 | if (stylegiven == 1) |
---|
| 388 | { |
---|
| 389 | infree = infreegiven; |
---|
| 390 | infixed = infixedgiven; |
---|
| 391 | } |
---|
[774] | 392 | Save_Length(nomdir,34); |
---|
| 393 | Save_Length(commondirout,35); |
---|
| 394 | Save_Length(commondirin,36); |
---|
| 395 | Save_Length(filetoparse,37); |
---|
| 396 | |
---|
[396] | 397 | /******************************************************************************/ |
---|
| 398 | /* 3- Parsing of the conv file <name>.in */ |
---|
| 399 | /******************************************************************************/ |
---|
| 400 | |
---|
[663] | 401 | if ((yyin=fopen(argv[1],"r"))==NULL) |
---|
[396] | 402 | { |
---|
| 403 | printf("the file %s doesn't exist \n",argv[1]); |
---|
[663] | 404 | exit(0); |
---|
[396] | 405 | } |
---|
[663] | 406 | strcpy(mainfile,argv[1]); |
---|
[774] | 407 | Save_Length(mainfile,33); |
---|
[396] | 408 | |
---|
[663] | 409 | if ( strstr(filetoparse,".f90") || |
---|
| 410 | strstr(filetoparse,".F90") ) retour77 = 0; |
---|
| 411 | |
---|
[396] | 412 | yyparse(); |
---|
| 413 | |
---|
| 414 | /******************************************************************************/ |
---|
| 415 | /* 4- Preparation of the file parsing */ |
---|
| 416 | /******************************************************************************/ |
---|
| 417 | if ((yyin=fopen(filetoparse,"r"))==NULL) /* Is the file to parse exist ? */ |
---|
| 418 | { |
---|
| 419 | printf("the file %s doesn't exist \n",filetoparse); |
---|
[663] | 420 | exit(0); |
---|
[396] | 421 | } |
---|
| 422 | /* mainfile : the name of the file to parse */ |
---|
[663] | 423 | strcpy(mainfile,filetoparse); |
---|
| 424 | /* */ |
---|
| 425 | if ((dependglobaloutput=fopen(".dependglobal_agrif","r"))!=NULL) |
---|
[396] | 426 | { |
---|
[663] | 427 | fscanf(dependglobaloutput,"%d\n",&indicemaxtabvars); |
---|
| 428 | fclose(dependglobaloutput); |
---|
| 429 | } |
---|
| 430 | Readthedependavailablefile(); |
---|
| 431 | /* Read the .dependnbxnby file which contains indices of nbmaillsX, */ |
---|
[396] | 432 | /* nbmailleY and nbmailleZ */ |
---|
| 433 | Readthedependnbxnbyfile(); |
---|
[663] | 434 | Read_Subroutine_For_Alloc(); |
---|
[396] | 435 | /******************************************************************************/ |
---|
[663] | 436 | /* 5- Parsing of the input file (2 times) */ |
---|
[396] | 437 | /******************************************************************************/ |
---|
[663] | 438 | /* Record all variable in list */ |
---|
| 439 | firstpass = 1; |
---|
[396] | 440 | processfortran(filetoparse); |
---|
[663] | 441 | /* */ |
---|
| 442 | CompleteThelistvarindoloop(); |
---|
| 443 | /* Read list of module used */ |
---|
| 444 | RecordUseModulesVariables(); |
---|
| 445 | /* Read list of module used in module used */ |
---|
| 446 | RecordUseModulesUseModulesVariables(); |
---|
| 447 | /* Save variables are considered as globals ones */ |
---|
| 448 | Update_List_Global_Var_From_List_Save_Var(); |
---|
| 449 | /* Update all lists */ |
---|
| 450 | ListUpdate(); |
---|
[774] | 451 | /* */ |
---|
| 452 | Clean_List_Global_Var(); |
---|
[663] | 453 | /* Indice tabvars identification */ |
---|
| 454 | IndiceTabvarsIdentification(); |
---|
| 455 | /* Update all lists */ |
---|
| 456 | ListUpdate(); |
---|
| 457 | /* The allocation subroutine is necessary ???? */ |
---|
| 458 | New_Allocate_Subroutine_Is_Necessary(); |
---|
| 459 | /* The allocation subroutine is necessary for common list */ |
---|
| 460 | New_Allocate_Subroutine_For_Common_Is_Necessary(); |
---|
| 461 | /* Sort List_SubroutineArgument_Var */ |
---|
| 462 | Sort_List_SubroutineArgument_Var(); |
---|
| 463 | /* Clean all lists */ |
---|
| 464 | ListClean(); |
---|
| 465 | /* Update Indice of List_UsedInSubroutine_Var from module used */ |
---|
| 466 | List_UsedInSubroutine_Var_Update_From_Module_Used(); |
---|
| 467 | /* Update List_SubroutineWhereAgrifUsed */ |
---|
| 468 | UpdateList_SubroutineWhereAgrifUsed(); |
---|
| 469 | /* Update List_UsedInSubroutine_Var with v_readedlistdimension */ |
---|
| 470 | UpdateList_UsedInSubroutine_With_dimension();; |
---|
| 471 | /* */ |
---|
| 472 | ModifyThelistvarindoloop(); |
---|
| 473 | /* */ |
---|
| 474 | UpdateListDeclarationWithDimensionList(); |
---|
| 475 | /* */ |
---|
| 476 | GiveTypeOfVariables(); |
---|
| 477 | Affiche(); |
---|
| 478 | /* Build new subroutines */ |
---|
| 479 | firstpass = 0; |
---|
| 480 | processfortran(filetoparse); |
---|
[396] | 481 | |
---|
[774] | 482 | newvar = (listvar *)NULL; |
---|
| 483 | /*newvar = List_Global_Var; */ |
---|
| 484 | while ( newvar ) |
---|
| 485 | { |
---|
| 486 | printf("++++ %s %d %s %s %s\n", |
---|
| 487 | newvar->var->v_nomvar, |
---|
| 488 | newvar->var->v_nbdim, |
---|
| 489 | newvar->var->v_subroutinename, |
---|
| 490 | newvar->var->v_modulename, |
---|
| 491 | newvar->var->v_typevar |
---|
| 492 | ); |
---|
| 493 | newvar = newvar->suiv; |
---|
| 494 | } |
---|
[396] | 495 | /******************************************************************************/ |
---|
[663] | 496 | /* 6- Write informations in output files */ |
---|
[396] | 497 | /******************************************************************************/ |
---|
| 498 | |
---|
[663] | 499 | /* Write the .dependglobal_agrif file which contain the max indice */ |
---|
| 500 | /* of the tabvars table */ |
---|
| 501 | dependglobaloutput = fopen(".dependglobal_agrif","w"); |
---|
| 502 | fprintf(dependglobaloutput,"%d\n",indicemaxtabvars); |
---|
| 503 | fclose(dependglobaloutput); |
---|
| 504 | /* Write the list of available indice */ |
---|
| 505 | Writethedependavailablefile(); |
---|
| 506 | /* Write the .dependnbxnby file which contains indices of nbmaillsX, */ |
---|
| 507 | /* nbmailleY and nbmailleZ */ |
---|
| 508 | Writethedependnbxnbyfile(); |
---|
| 509 | /* Write the .depend<namefile> file which contain general informations */ |
---|
| 510 | /* about variable of this file */ |
---|
| 511 | parcours = List_NameOfModule; |
---|
| 512 | while( parcours ) |
---|
[396] | 513 | { |
---|
[663] | 514 | Writethedependlistofmoduleused(parcours->o_nom); |
---|
| 515 | WritedependParameterList(parcours->o_nom); |
---|
| 516 | Writethedependfile(parcours->o_nom,List_Global_Var); |
---|
| 517 | parcours=parcours->suiv; |
---|
[396] | 518 | } |
---|
[663] | 519 | parcours = List_NameOfCommon; |
---|
| 520 | while( parcours ) |
---|
[396] | 521 | { |
---|
[663] | 522 | Writethedependfile(parcours->o_nom,List_Common_Var); |
---|
| 523 | parcours=parcours->suiv; |
---|
[396] | 524 | } |
---|
[663] | 525 | Write_Subroutine_For_Alloc(); |
---|
[396] | 526 | /******************************************************************************/ |
---|
[663] | 527 | /* 7- Create files in AGRIF_INC directory */ |
---|
[396] | 528 | /******************************************************************************/ |
---|
| 529 | creefichieramr(NameTamponfile); |
---|
[663] | 530 | |
---|
[774] | 531 | Write_val_max(); |
---|
[663] | 532 | |
---|
| 533 | if ( todebug == 1 ) printf("Out of CONV \n"); |
---|
[396] | 534 | return 0; |
---|
| 535 | } |
---|
[1349] | 536 | #line 537 "y.tab.c" |
---|
[396] | 537 | #define YYABORT goto yyabort |
---|
| 538 | #define YYREJECT goto yyabort |
---|
| 539 | #define YYACCEPT goto yyaccept |
---|
| 540 | #define YYERROR goto yyerrlab |
---|
| 541 | int |
---|
[1349] | 542 | yyparse() |
---|
[396] | 543 | { |
---|
| 544 | register int yym, yyn, yystate; |
---|
| 545 | #if YYDEBUG |
---|
[1349] | 546 | register char *yys; |
---|
| 547 | extern char *getenv(); |
---|
[396] | 548 | |
---|
[1349] | 549 | if (yys = getenv("YYDEBUG")) |
---|
[396] | 550 | { |
---|
| 551 | yyn = *yys; |
---|
| 552 | if (yyn >= '0' && yyn <= '9') |
---|
| 553 | yydebug = yyn - '0'; |
---|
| 554 | } |
---|
| 555 | #endif |
---|
| 556 | |
---|
| 557 | yynerrs = 0; |
---|
| 558 | yyerrflag = 0; |
---|
[1349] | 559 | yychar = (-1); |
---|
[396] | 560 | |
---|
| 561 | yyssp = yyss; |
---|
| 562 | yyvsp = yyvs; |
---|
| 563 | *yyssp = yystate = 0; |
---|
| 564 | |
---|
| 565 | yyloop: |
---|
[1349] | 566 | if (yyn = yydefred[yystate]) goto yyreduce; |
---|
[396] | 567 | if (yychar < 0) |
---|
| 568 | { |
---|
| 569 | if ((yychar = yylex()) < 0) yychar = 0; |
---|
| 570 | #if YYDEBUG |
---|
| 571 | if (yydebug) |
---|
| 572 | { |
---|
| 573 | yys = 0; |
---|
| 574 | if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; |
---|
| 575 | if (!yys) yys = "illegal-symbol"; |
---|
| 576 | printf("%sdebug: state %d, reading %d (%s)\n", |
---|
| 577 | YYPREFIX, yystate, yychar, yys); |
---|
| 578 | } |
---|
| 579 | #endif |
---|
| 580 | } |
---|
| 581 | if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 && |
---|
| 582 | yyn <= YYTABLESIZE && yycheck[yyn] == yychar) |
---|
| 583 | { |
---|
| 584 | #if YYDEBUG |
---|
| 585 | if (yydebug) |
---|
| 586 | printf("%sdebug: state %d, shifting to state %d\n", |
---|
| 587 | YYPREFIX, yystate, yytable[yyn]); |
---|
| 588 | #endif |
---|
[1349] | 589 | if (yyssp >= yyss + yystacksize - 1) |
---|
[396] | 590 | { |
---|
| 591 | goto yyoverflow; |
---|
| 592 | } |
---|
| 593 | *++yyssp = yystate = yytable[yyn]; |
---|
| 594 | *++yyvsp = yylval; |
---|
[1349] | 595 | yychar = (-1); |
---|
[396] | 596 | if (yyerrflag > 0) --yyerrflag; |
---|
| 597 | goto yyloop; |
---|
| 598 | } |
---|
| 599 | if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 && |
---|
| 600 | yyn <= YYTABLESIZE && yycheck[yyn] == yychar) |
---|
| 601 | { |
---|
| 602 | yyn = yytable[yyn]; |
---|
| 603 | goto yyreduce; |
---|
| 604 | } |
---|
| 605 | if (yyerrflag) goto yyinrecovery; |
---|
[1349] | 606 | #ifdef lint |
---|
| 607 | goto yynewerror; |
---|
| 608 | #endif |
---|
| 609 | yynewerror: |
---|
[396] | 610 | yyerror("syntax error"); |
---|
| 611 | #ifdef lint |
---|
| 612 | goto yyerrlab; |
---|
| 613 | #endif |
---|
| 614 | yyerrlab: |
---|
| 615 | ++yynerrs; |
---|
| 616 | yyinrecovery: |
---|
| 617 | if (yyerrflag < 3) |
---|
| 618 | { |
---|
| 619 | yyerrflag = 3; |
---|
| 620 | for (;;) |
---|
| 621 | { |
---|
| 622 | if ((yyn = yysindex[*yyssp]) && (yyn += YYERRCODE) >= 0 && |
---|
| 623 | yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE) |
---|
| 624 | { |
---|
| 625 | #if YYDEBUG |
---|
| 626 | if (yydebug) |
---|
| 627 | printf("%sdebug: state %d, error recovery shifting\ |
---|
| 628 | to state %d\n", YYPREFIX, *yyssp, yytable[yyn]); |
---|
| 629 | #endif |
---|
[1349] | 630 | if (yyssp >= yyss + yystacksize - 1) |
---|
[396] | 631 | { |
---|
| 632 | goto yyoverflow; |
---|
| 633 | } |
---|
| 634 | *++yyssp = yystate = yytable[yyn]; |
---|
| 635 | *++yyvsp = yylval; |
---|
| 636 | goto yyloop; |
---|
| 637 | } |
---|
| 638 | else |
---|
| 639 | { |
---|
| 640 | #if YYDEBUG |
---|
| 641 | if (yydebug) |
---|
| 642 | printf("%sdebug: error recovery discarding state %d\n", |
---|
| 643 | YYPREFIX, *yyssp); |
---|
| 644 | #endif |
---|
| 645 | if (yyssp <= yyss) goto yyabort; |
---|
| 646 | --yyssp; |
---|
| 647 | --yyvsp; |
---|
| 648 | } |
---|
| 649 | } |
---|
| 650 | } |
---|
| 651 | else |
---|
| 652 | { |
---|
| 653 | if (yychar == 0) goto yyabort; |
---|
| 654 | #if YYDEBUG |
---|
| 655 | if (yydebug) |
---|
| 656 | { |
---|
| 657 | yys = 0; |
---|
| 658 | if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; |
---|
| 659 | if (!yys) yys = "illegal-symbol"; |
---|
| 660 | printf("%sdebug: state %d, error recovery discards token %d (%s)\n", |
---|
| 661 | YYPREFIX, yystate, yychar, yys); |
---|
| 662 | } |
---|
| 663 | #endif |
---|
[1349] | 664 | yychar = (-1); |
---|
[396] | 665 | goto yyloop; |
---|
| 666 | } |
---|
| 667 | yyreduce: |
---|
| 668 | #if YYDEBUG |
---|
| 669 | if (yydebug) |
---|
| 670 | printf("%sdebug: state %d, reducing by rule %d (%s)\n", |
---|
| 671 | YYPREFIX, yystate, yyn, yyrule[yyn]); |
---|
| 672 | #endif |
---|
| 673 | yym = yylen[yyn]; |
---|
| 674 | yyval = yyvsp[1-yym]; |
---|
| 675 | switch (yyn) |
---|
| 676 | { |
---|
| 677 | case 4: |
---|
[530] | 678 | #line 67 "convert.y" |
---|
[396] | 679 | {initdimprob(1,yyvsp[-1].na,"0","0");} |
---|
| 680 | break; |
---|
| 681 | case 5: |
---|
[530] | 682 | #line 68 "convert.y" |
---|
[396] | 683 | {initdimprob(2,yyvsp[-3].na, yyvsp[-1].na,"0");} |
---|
| 684 | break; |
---|
| 685 | case 6: |
---|
[530] | 686 | #line 70 "convert.y" |
---|
[396] | 687 | {initdimprob(3,yyvsp[-5].na, yyvsp[-3].na, yyvsp[-1].na);} |
---|
| 688 | break; |
---|
| 689 | case 7: |
---|
[530] | 690 | #line 72 "convert.y" |
---|
[663] | 691 | {listofmodules = Addtolistnom(yyvsp[-1].na,listofmodules,0); |
---|
| 692 | Addmoduletothelist(yyvsp[-1].na);} |
---|
[396] | 693 | break; |
---|
| 694 | case 8: |
---|
[530] | 695 | #line 74 "convert.y" |
---|
[663] | 696 | {Add_NotGridDepend_Var_1(yyvsp[-1].na);} |
---|
[396] | 697 | break; |
---|
| 698 | case 9: |
---|
| 699 | #line 75 "convert.y" |
---|
| 700 | { |
---|
| 701 | if (!strcasecmp(yyvsp[-1].na,"FIXED_GRIDS")) |
---|
| 702 | fixedgrids=1; |
---|
| 703 | if (!strcasecmp(yyvsp[-1].na,"ONLY_FIXED_GRIDS")) |
---|
| 704 | onlyfixedgrids=1; |
---|
| 705 | } |
---|
| 706 | break; |
---|
[1349] | 707 | #line 708 "y.tab.c" |
---|
[396] | 708 | } |
---|
| 709 | yyssp -= yym; |
---|
| 710 | yystate = *yyssp; |
---|
| 711 | yyvsp -= yym; |
---|
| 712 | yym = yylhs[yyn]; |
---|
| 713 | if (yystate == 0 && yym == 0) |
---|
| 714 | { |
---|
| 715 | #if YYDEBUG |
---|
| 716 | if (yydebug) |
---|
| 717 | printf("%sdebug: after reduction, shifting from state 0 to\ |
---|
| 718 | state %d\n", YYPREFIX, YYFINAL); |
---|
| 719 | #endif |
---|
| 720 | yystate = YYFINAL; |
---|
| 721 | *++yyssp = YYFINAL; |
---|
| 722 | *++yyvsp = yyval; |
---|
| 723 | if (yychar < 0) |
---|
| 724 | { |
---|
| 725 | if ((yychar = yylex()) < 0) yychar = 0; |
---|
| 726 | #if YYDEBUG |
---|
| 727 | if (yydebug) |
---|
| 728 | { |
---|
| 729 | yys = 0; |
---|
| 730 | if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; |
---|
| 731 | if (!yys) yys = "illegal-symbol"; |
---|
| 732 | printf("%sdebug: state %d, reading %d (%s)\n", |
---|
| 733 | YYPREFIX, YYFINAL, yychar, yys); |
---|
| 734 | } |
---|
| 735 | #endif |
---|
| 736 | } |
---|
| 737 | if (yychar == 0) goto yyaccept; |
---|
| 738 | goto yyloop; |
---|
| 739 | } |
---|
| 740 | if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 && |
---|
| 741 | yyn <= YYTABLESIZE && yycheck[yyn] == yystate) |
---|
| 742 | yystate = yytable[yyn]; |
---|
| 743 | else |
---|
| 744 | yystate = yydgoto[yym]; |
---|
| 745 | #if YYDEBUG |
---|
| 746 | if (yydebug) |
---|
| 747 | printf("%sdebug: after reduction, shifting from state %d \ |
---|
| 748 | to state %d\n", YYPREFIX, *yyssp, yystate); |
---|
| 749 | #endif |
---|
[1349] | 750 | if (yyssp >= yyss + yystacksize - 1) |
---|
[396] | 751 | { |
---|
| 752 | goto yyoverflow; |
---|
| 753 | } |
---|
| 754 | *++yyssp = yystate; |
---|
| 755 | *++yyvsp = yyval; |
---|
| 756 | goto yyloop; |
---|
| 757 | yyoverflow: |
---|
| 758 | yyerror("yacc stack overflow"); |
---|
| 759 | yyabort: |
---|
| 760 | return (1); |
---|
| 761 | yyaccept: |
---|
| 762 | return (0); |
---|
| 763 | } |
---|
| 764 | #line 2 "convert.yy.c" |
---|
[1349] | 765 | /* A lexical scanner generated by flex */ |
---|
[1200] | 766 | |
---|
[1349] | 767 | /* Scanner skeleton version: |
---|
| 768 | * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $ |
---|
| 769 | */ |
---|
[1200] | 770 | |
---|
[396] | 771 | #define FLEX_SCANNER |
---|
| 772 | #define YY_FLEX_MAJOR_VERSION 2 |
---|
| 773 | #define YY_FLEX_MINOR_VERSION 5 |
---|
| 774 | |
---|
| 775 | #include <stdio.h> |
---|
| 776 | |
---|
| 777 | |
---|
[1349] | 778 | /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ |
---|
| 779 | #ifdef c_plusplus |
---|
| 780 | #ifndef __cplusplus |
---|
| 781 | #define __cplusplus |
---|
[396] | 782 | #endif |
---|
| 783 | #endif |
---|
| 784 | |
---|
| 785 | |
---|
| 786 | #ifdef __cplusplus |
---|
| 787 | |
---|
[1349] | 788 | #include <stdlib.h> |
---|
| 789 | #include <unistd.h> |
---|
| 790 | |
---|
| 791 | /* Use prototypes in function declarations. */ |
---|
| 792 | #define YY_USE_PROTOS |
---|
| 793 | |
---|
[396] | 794 | /* The "const" storage-class-modifier is valid. */ |
---|
| 795 | #define YY_USE_CONST |
---|
| 796 | |
---|
| 797 | #else /* ! __cplusplus */ |
---|
| 798 | |
---|
| 799 | #if __STDC__ |
---|
| 800 | |
---|
[1349] | 801 | #define YY_USE_PROTOS |
---|
[396] | 802 | #define YY_USE_CONST |
---|
| 803 | |
---|
| 804 | #endif /* __STDC__ */ |
---|
| 805 | #endif /* ! __cplusplus */ |
---|
| 806 | |
---|
[1349] | 807 | #ifdef __TURBOC__ |
---|
| 808 | #pragma warn -rch |
---|
| 809 | #pragma warn -use |
---|
| 810 | #include <io.h> |
---|
| 811 | #include <stdlib.h> |
---|
| 812 | #define YY_USE_CONST |
---|
| 813 | #define YY_USE_PROTOS |
---|
| 814 | #endif |
---|
| 815 | |
---|
[396] | 816 | #ifdef YY_USE_CONST |
---|
| 817 | #define yyconst const |
---|
| 818 | #else |
---|
| 819 | #define yyconst |
---|
| 820 | #endif |
---|
| 821 | |
---|
[1349] | 822 | |
---|
| 823 | #ifdef YY_USE_PROTOS |
---|
| 824 | #define YY_PROTO(proto) proto |
---|
| 825 | #else |
---|
| 826 | #define YY_PROTO(proto) () |
---|
| 827 | #endif |
---|
| 828 | |
---|
[396] | 829 | /* Returned upon end-of-file. */ |
---|
| 830 | #define YY_NULL 0 |
---|
| 831 | |
---|
| 832 | /* Promotes a possibly negative, possibly signed char to an unsigned |
---|
| 833 | * integer for use as an array index. If the signed char is negative, |
---|
| 834 | * we want to instead treat it as an 8-bit unsigned char, hence the |
---|
| 835 | * double cast. |
---|
| 836 | */ |
---|
| 837 | #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) |
---|
| 838 | |
---|
| 839 | /* Enter a start condition. This macro really ought to take a parameter, |
---|
| 840 | * but we do it the disgusting crufty way forced on us by the ()-less |
---|
| 841 | * definition of BEGIN. |
---|
| 842 | */ |
---|
[1349] | 843 | #define BEGIN yy_start = 1 + 2 * |
---|
[396] | 844 | |
---|
| 845 | /* Translate the current start state into a value that can be later handed |
---|
| 846 | * to BEGIN to return to the state. The YYSTATE alias is for lex |
---|
| 847 | * compatibility. |
---|
| 848 | */ |
---|
[1349] | 849 | #define YY_START ((yy_start - 1) / 2) |
---|
[396] | 850 | #define YYSTATE YY_START |
---|
| 851 | |
---|
| 852 | /* Action number for EOF rule of a given start state. */ |
---|
| 853 | #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) |
---|
| 854 | |
---|
| 855 | /* Special action meaning "start processing a new file". */ |
---|
[1349] | 856 | #define YY_NEW_FILE yyrestart( yyin ) |
---|
[396] | 857 | |
---|
| 858 | #define YY_END_OF_BUFFER_CHAR 0 |
---|
| 859 | |
---|
| 860 | /* Size of default input buffer. */ |
---|
| 861 | #define YY_BUF_SIZE 16384 |
---|
| 862 | |
---|
| 863 | typedef struct yy_buffer_state *YY_BUFFER_STATE; |
---|
| 864 | |
---|
| 865 | extern int yyleng; |
---|
| 866 | extern FILE *yyin, *yyout; |
---|
| 867 | |
---|
| 868 | #define EOB_ACT_CONTINUE_SCAN 0 |
---|
| 869 | #define EOB_ACT_END_OF_FILE 1 |
---|
| 870 | #define EOB_ACT_LAST_MATCH 2 |
---|
| 871 | |
---|
[1349] | 872 | /* The funky do-while in the following #define is used to turn the definition |
---|
| 873 | * int a single C statement (which needs a semi-colon terminator). This |
---|
| 874 | * avoids problems with code like: |
---|
| 875 | * |
---|
| 876 | * if ( condition_holds ) |
---|
| 877 | * yyless( 5 ); |
---|
| 878 | * else |
---|
| 879 | * do_something_else(); |
---|
| 880 | * |
---|
| 881 | * Prior to using the do-while the compiler would get upset at the |
---|
| 882 | * "else" because it interpreted the "if" statement as being all |
---|
| 883 | * done when it reached the ';' after the yyless() call. |
---|
| 884 | */ |
---|
| 885 | |
---|
| 886 | /* Return all but the first 'n' matched characters back to the input stream. */ |
---|
| 887 | |
---|
[396] | 888 | #define yyless(n) \ |
---|
| 889 | do \ |
---|
| 890 | { \ |
---|
| 891 | /* Undo effects of setting up yytext. */ \ |
---|
[1349] | 892 | *yy_cp = yy_hold_char; \ |
---|
[396] | 893 | YY_RESTORE_YY_MORE_OFFSET \ |
---|
[1349] | 894 | yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ |
---|
[396] | 895 | YY_DO_BEFORE_ACTION; /* set up yytext again */ \ |
---|
| 896 | } \ |
---|
| 897 | while ( 0 ) |
---|
| 898 | |
---|
[1349] | 899 | #define unput(c) yyunput( c, yytext_ptr ) |
---|
[396] | 900 | |
---|
| 901 | /* The following is because we cannot portably get our hands on size_t |
---|
| 902 | * (without autoconf's help, which isn't available because we want |
---|
| 903 | * flex-generated scanners to compile on their own). |
---|
| 904 | */ |
---|
| 905 | typedef unsigned int yy_size_t; |
---|
| 906 | |
---|
[1349] | 907 | |
---|
[396] | 908 | struct yy_buffer_state |
---|
| 909 | { |
---|
| 910 | FILE *yy_input_file; |
---|
| 911 | |
---|
| 912 | char *yy_ch_buf; /* input buffer */ |
---|
| 913 | char *yy_buf_pos; /* current position in input buffer */ |
---|
| 914 | |
---|
| 915 | /* Size of input buffer in bytes, not including room for EOB |
---|
| 916 | * characters. |
---|
| 917 | */ |
---|
| 918 | yy_size_t yy_buf_size; |
---|
| 919 | |
---|
| 920 | /* Number of characters read into yy_ch_buf, not including EOB |
---|
| 921 | * characters. |
---|
| 922 | */ |
---|
| 923 | int yy_n_chars; |
---|
| 924 | |
---|
| 925 | /* Whether we "own" the buffer - i.e., we know we created it, |
---|
| 926 | * and can realloc() it to grow it, and should free() it to |
---|
| 927 | * delete it. |
---|
| 928 | */ |
---|
| 929 | int yy_is_our_buffer; |
---|
| 930 | |
---|
| 931 | /* Whether this is an "interactive" input source; if so, and |
---|
| 932 | * if we're using stdio for input, then we want to use getc() |
---|
| 933 | * instead of fread(), to make sure we stop fetching input after |
---|
| 934 | * each newline. |
---|
| 935 | */ |
---|
| 936 | int yy_is_interactive; |
---|
| 937 | |
---|
| 938 | /* Whether we're considered to be at the beginning of a line. |
---|
| 939 | * If so, '^' rules will be active on the next match, otherwise |
---|
| 940 | * not. |
---|
| 941 | */ |
---|
| 942 | int yy_at_bol; |
---|
| 943 | |
---|
| 944 | /* Whether to try to fill the input buffer when we reach the |
---|
| 945 | * end of it. |
---|
| 946 | */ |
---|
| 947 | int yy_fill_buffer; |
---|
| 948 | |
---|
| 949 | int yy_buffer_status; |
---|
| 950 | #define YY_BUFFER_NEW 0 |
---|
| 951 | #define YY_BUFFER_NORMAL 1 |
---|
| 952 | /* When an EOF's been seen but there's still some text to process |
---|
| 953 | * then we mark the buffer as YY_EOF_PENDING, to indicate that we |
---|
| 954 | * shouldn't try reading from the input source any more. We might |
---|
| 955 | * still have a bunch of tokens to match, though, because of |
---|
| 956 | * possible backing-up. |
---|
| 957 | * |
---|
| 958 | * When we actually see the EOF, we change the status to "new" |
---|
| 959 | * (via yyrestart()), so that the user can continue scanning by |
---|
| 960 | * just pointing yyin at a new input file. |
---|
| 961 | */ |
---|
| 962 | #define YY_BUFFER_EOF_PENDING 2 |
---|
| 963 | }; |
---|
| 964 | |
---|
[1349] | 965 | static YY_BUFFER_STATE yy_current_buffer = 0; |
---|
[396] | 966 | |
---|
| 967 | /* We provide macros for accessing buffer states in case in the |
---|
| 968 | * future we want to put the buffer states in a more general |
---|
| 969 | * "scanner state". |
---|
| 970 | */ |
---|
[1349] | 971 | #define YY_CURRENT_BUFFER yy_current_buffer |
---|
[396] | 972 | |
---|
| 973 | |
---|
| 974 | /* yy_hold_char holds the character lost when yytext is formed. */ |
---|
| 975 | static char yy_hold_char; |
---|
[1349] | 976 | |
---|
[396] | 977 | static int yy_n_chars; /* number of characters read into yy_ch_buf */ |
---|
[1349] | 978 | |
---|
| 979 | |
---|
[396] | 980 | int yyleng; |
---|
| 981 | |
---|
| 982 | /* Points to current character in buffer. */ |
---|
| 983 | static char *yy_c_buf_p = (char *) 0; |
---|
[1349] | 984 | static int yy_init = 1; /* whether we need to initialize */ |
---|
[396] | 985 | static int yy_start = 0; /* start state number */ |
---|
| 986 | |
---|
| 987 | /* Flag which is used to allow yywrap()'s to do buffer switches |
---|
| 988 | * instead of setting up a fresh yyin. A bit of a hack ... |
---|
| 989 | */ |
---|
| 990 | static int yy_did_buffer_switch_on_eof; |
---|
| 991 | |
---|
[1349] | 992 | void yyrestart YY_PROTO(( FILE *input_file )); |
---|
[396] | 993 | |
---|
[1349] | 994 | void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); |
---|
| 995 | void yy_load_buffer_state YY_PROTO(( void )); |
---|
| 996 | YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); |
---|
| 997 | void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); |
---|
| 998 | void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); |
---|
| 999 | void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); |
---|
| 1000 | #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) |
---|
[396] | 1001 | |
---|
[1349] | 1002 | YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); |
---|
| 1003 | YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); |
---|
| 1004 | YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); |
---|
[396] | 1005 | |
---|
[1349] | 1006 | static void *yy_flex_alloc YY_PROTO(( yy_size_t )); |
---|
| 1007 | static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); |
---|
| 1008 | static void yy_flex_free YY_PROTO(( void * )); |
---|
[396] | 1009 | |
---|
| 1010 | #define yy_new_buffer yy_create_buffer |
---|
| 1011 | |
---|
| 1012 | #define yy_set_interactive(is_interactive) \ |
---|
| 1013 | { \ |
---|
[1349] | 1014 | if ( ! yy_current_buffer ) \ |
---|
| 1015 | yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ |
---|
| 1016 | yy_current_buffer->yy_is_interactive = is_interactive; \ |
---|
[396] | 1017 | } |
---|
| 1018 | |
---|
| 1019 | #define yy_set_bol(at_bol) \ |
---|
| 1020 | { \ |
---|
[1349] | 1021 | if ( ! yy_current_buffer ) \ |
---|
| 1022 | yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ |
---|
| 1023 | yy_current_buffer->yy_at_bol = at_bol; \ |
---|
[396] | 1024 | } |
---|
| 1025 | |
---|
[1349] | 1026 | #define YY_AT_BOL() (yy_current_buffer->yy_at_bol) |
---|
[396] | 1027 | |
---|
| 1028 | typedef unsigned char YY_CHAR; |
---|
| 1029 | FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; |
---|
| 1030 | typedef int yy_state_type; |
---|
| 1031 | extern char *yytext; |
---|
| 1032 | #define yytext_ptr yytext |
---|
| 1033 | |
---|
[1349] | 1034 | static yy_state_type yy_get_previous_state YY_PROTO(( void )); |
---|
| 1035 | static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); |
---|
| 1036 | static int yy_get_next_buffer YY_PROTO(( void )); |
---|
| 1037 | static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); |
---|
[396] | 1038 | |
---|
| 1039 | /* Done after the current pattern has been matched and before the |
---|
| 1040 | * corresponding action - sets up yytext. |
---|
| 1041 | */ |
---|
| 1042 | #define YY_DO_BEFORE_ACTION \ |
---|
[1349] | 1043 | yytext_ptr = yy_bp; \ |
---|
| 1044 | yyleng = (int) (yy_cp - yy_bp); \ |
---|
| 1045 | yy_hold_char = *yy_cp; \ |
---|
[396] | 1046 | *yy_cp = '\0'; \ |
---|
[1349] | 1047 | yy_c_buf_p = yy_cp; |
---|
[396] | 1048 | |
---|
[530] | 1049 | #define YY_NUM_RULES 12 |
---|
| 1050 | #define YY_END_OF_BUFFER 13 |
---|
[1349] | 1051 | static yyconst short int yy_accept[74] = |
---|
[396] | 1052 | { 0, |
---|
[530] | 1053 | 0, 0, 0, 0, 13, 12, 11, 10, 12, 9, |
---|
| 1054 | 12, 12, 12, 9, 8, 8, 8, 8, 8, 8, |
---|
[663] | 1055 | 11, 0, 4, 7, 5, 8, 8, 8, 8, 8, |
---|
| 1056 | 8, 8, 6, 8, 8, 8, 8, 3, 8, 8, |
---|
[530] | 1057 | 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, |
---|
[663] | 1058 | 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, |
---|
| 1059 | 8, 8, 8, 2, 8, 8, 8, 1, 8, 8, |
---|
| 1060 | 8, 8, 0 |
---|
[396] | 1061 | } ; |
---|
| 1062 | |
---|
[1349] | 1063 | static yyconst int yy_ec[256] = |
---|
[396] | 1064 | { 0, |
---|
| 1065 | 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, |
---|
| 1066 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
---|
| 1067 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
---|
| 1068 | 1, 2, 1, 1, 1, 1, 4, 1, 1, 5, |
---|
[530] | 1069 | 6, 1, 1, 7, 1, 1, 1, 8, 9, 10, |
---|
[663] | 1070 | 11, 8, 8, 8, 12, 8, 8, 13, 14, 1, |
---|
| 1071 | 1, 1, 1, 1, 18, 19, 19, 20, 21, 22, |
---|
[530] | 1072 | 23, 19, 24, 19, 19, 25, 26, 27, 28, 29, |
---|
| 1073 | 19, 30, 31, 32, 33, 19, 19, 34, 35, 19, |
---|
[663] | 1074 | 15, 1, 16, 1, 17, 1, 18, 19, 19, 20, |
---|
[396] | 1075 | |
---|
[530] | 1076 | 21, 22, 23, 19, 24, 19, 19, 25, 26, 27, |
---|
| 1077 | 28, 29, 19, 30, 31, 32, 33, 19, 19, 34, |
---|
| 1078 | 35, 19, 1, 1, 1, 1, 1, 1, 1, 1, |
---|
[396] | 1079 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
---|
| 1080 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
---|
| 1081 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
---|
| 1082 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
---|
| 1083 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
---|
| 1084 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
---|
| 1085 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
---|
| 1086 | |
---|
| 1087 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
---|
| 1088 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
---|
| 1089 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
---|
| 1090 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
---|
| 1091 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
---|
| 1092 | 1, 1, 1, 1, 1 |
---|
| 1093 | } ; |
---|
| 1094 | |
---|
[1349] | 1095 | static yyconst int yy_meta[36] = |
---|
[396] | 1096 | { 0, |
---|
[530] | 1097 | 1, 1, 2, 1, 1, 1, 1, 3, 3, 3, |
---|
[663] | 1098 | 3, 3, 1, 1, 1, 1, 3, 3, 3, 3, |
---|
[530] | 1099 | 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, |
---|
| 1100 | 3, 3, 3, 3, 3 |
---|
[396] | 1101 | } ; |
---|
| 1102 | |
---|
[1349] | 1103 | static yyconst short int yy_base[76] = |
---|
[396] | 1104 | { 0, |
---|
[663] | 1105 | 0, 0, 0, 0, 96, 97, 93, 97, 90, 97, |
---|
| 1106 | 73, 72, 71, 77, 0, 24, 61, 61, 69, 55, |
---|
| 1107 | 83, 80, 79, 97, 97, 0, 70, 47, 48, 54, |
---|
| 1108 | 48, 56, 0, 55, 52, 39, 55, 0, 52, 41, |
---|
| 1109 | 53, 43, 51, 43, 44, 39, 41, 43, 38, 33, |
---|
| 1110 | 30, 39, 24, 37, 32, 34, 33, 20, 32, 21, |
---|
| 1111 | 27, 21, 14, 0, 27, 22, 19, 0, 11, 16, |
---|
| 1112 | 19, 7, 97, 48, 34 |
---|
[396] | 1113 | } ; |
---|
| 1114 | |
---|
[1349] | 1115 | static yyconst short int yy_def[76] = |
---|
[396] | 1116 | { 0, |
---|
[663] | 1117 | 73, 1, 1, 1, 73, 73, 73, 73, 74, 73, |
---|
| 1118 | 73, 73, 73, 73, 75, 75, 75, 75, 75, 75, |
---|
| 1119 | 73, 74, 74, 73, 73, 75, 75, 75, 75, 75, |
---|
| 1120 | 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, |
---|
| 1121 | 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, |
---|
| 1122 | 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, |
---|
| 1123 | 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, |
---|
| 1124 | 75, 75, 0, 73, 73 |
---|
[396] | 1125 | } ; |
---|
| 1126 | |
---|
[1349] | 1127 | static yyconst short int yy_nxt[133] = |
---|
[396] | 1128 | { 0, |
---|
| 1129 | 6, 7, 8, 9, 10, 10, 10, 6, 11, 12, |
---|
[663] | 1130 | 13, 6, 14, 10, 10, 10, 15, 15, 15, 15, |
---|
| 1131 | 15, 16, 15, 15, 15, 15, 17, 18, 19, 15, |
---|
| 1132 | 15, 15, 20, 15, 15, 27, 26, 33, 72, 71, |
---|
| 1133 | 70, 69, 68, 67, 33, 66, 65, 28, 22, 64, |
---|
| 1134 | 22, 63, 62, 61, 60, 59, 58, 57, 56, 55, |
---|
| 1135 | 54, 53, 52, 51, 50, 49, 48, 47, 46, 45, |
---|
| 1136 | 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, |
---|
| 1137 | 34, 33, 23, 23, 21, 32, 31, 30, 29, 25, |
---|
| 1138 | 24, 24, 24, 23, 21, 73, 5, 73, 73, 73, |
---|
[396] | 1139 | |
---|
[663] | 1140 | 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, |
---|
| 1141 | 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, |
---|
| 1142 | 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, |
---|
| 1143 | 73, 73 |
---|
[396] | 1144 | } ; |
---|
| 1145 | |
---|
[1349] | 1146 | static yyconst short int yy_chk[133] = |
---|
[396] | 1147 | { 0, |
---|
| 1148 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
---|
| 1149 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
---|
| 1150 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
---|
[663] | 1151 | 1, 1, 1, 1, 1, 16, 75, 72, 71, 70, |
---|
| 1152 | 69, 67, 66, 65, 63, 62, 61, 16, 74, 60, |
---|
| 1153 | 74, 59, 58, 57, 56, 55, 54, 53, 52, 51, |
---|
| 1154 | 50, 49, 48, 47, 46, 45, 44, 43, 42, 41, |
---|
| 1155 | 40, 39, 37, 36, 35, 34, 32, 31, 30, 29, |
---|
| 1156 | 28, 27, 23, 22, 21, 20, 19, 18, 17, 14, |
---|
| 1157 | 13, 12, 11, 9, 7, 5, 73, 73, 73, 73, |
---|
[396] | 1158 | |
---|
[663] | 1159 | 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, |
---|
| 1160 | 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, |
---|
| 1161 | 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, |
---|
| 1162 | 73, 73 |
---|
[396] | 1163 | } ; |
---|
| 1164 | |
---|
| 1165 | static yy_state_type yy_last_accepting_state; |
---|
| 1166 | static char *yy_last_accepting_cpos; |
---|
| 1167 | |
---|
| 1168 | /* The intent behind this definition is that it'll catch |
---|
| 1169 | * any uses of REJECT which flex missed. |
---|
| 1170 | */ |
---|
| 1171 | #define REJECT reject_used_but_not_detected |
---|
| 1172 | #define yymore() yymore_used_but_not_detected |
---|
| 1173 | #define YY_MORE_ADJ 0 |
---|
| 1174 | #define YY_RESTORE_YY_MORE_OFFSET |
---|
| 1175 | char *yytext; |
---|
| 1176 | #line 1 "convert.lex" |
---|
[1349] | 1177 | #define INITIAL 0 |
---|
[396] | 1178 | /******************************************************************************/ |
---|
| 1179 | /* */ |
---|
| 1180 | /* CONV (converter) for Agrif (Adaptive Grid Refinement In Fortran) */ |
---|
| 1181 | /* */ |
---|
[663] | 1182 | /* Copyright or or Copr. Laurent Debreu (Laurent.Debreu@imag.fr) */ |
---|
| 1183 | /* Cyril Mazauric (Cyril_Mazauric@yahoo.fr) */ |
---|
[530] | 1184 | /* This software is governed by the CeCILL-C license under French law and */ |
---|
| 1185 | /* abiding by the rules of distribution of free software. You can use, */ |
---|
| 1186 | /* modify and/ or redistribute the software under the terms of the CeCILL-C */ |
---|
| 1187 | /* license as circulated by CEA, CNRS and INRIA at the following URL */ |
---|
| 1188 | /* "http://www.cecill.info". */ |
---|
[396] | 1189 | /* */ |
---|
[530] | 1190 | /* As a counterpart to the access to the source code and rights to copy, */ |
---|
| 1191 | /* modify and redistribute granted by the license, users are provided only */ |
---|
| 1192 | /* with a limited warranty and the software's author, the holder of the */ |
---|
| 1193 | /* economic rights, and the successive licensors have only limited */ |
---|
| 1194 | /* liability. */ |
---|
[396] | 1195 | /* */ |
---|
[530] | 1196 | /* In this respect, the user's attention is drawn to the risks associated */ |
---|
| 1197 | /* with loading, using, modifying and/or developing or reproducing the */ |
---|
| 1198 | /* software by the user in light of its specific status of free software, */ |
---|
| 1199 | /* that may mean that it is complicated to manipulate, and that also */ |
---|
| 1200 | /* therefore means that it is reserved for developers and experienced */ |
---|
| 1201 | /* professionals having in-depth computer knowledge. Users are therefore */ |
---|
| 1202 | /* encouraged to load and test the software's suitability as regards their */ |
---|
| 1203 | /* requirements in conditions enabling the security of their systems and/or */ |
---|
| 1204 | /* data to be ensured and, more generally, to use and operate it in the */ |
---|
| 1205 | /* same conditions as regards security. */ |
---|
[396] | 1206 | /* */ |
---|
[530] | 1207 | /* The fact that you are presently reading this means that you have had */ |
---|
| 1208 | /* knowledge of the CeCILL-C license and that you accept its terms. */ |
---|
[396] | 1209 | /******************************************************************************/ |
---|
[774] | 1210 | /* version 1.7 */ |
---|
[530] | 1211 | /******************************************************************************/ |
---|
[1349] | 1212 | #define character 1 |
---|
[396] | 1213 | |
---|
[530] | 1214 | #line 37 "convert.lex" |
---|
[396] | 1215 | #include <math.h> |
---|
| 1216 | #include <stdlib.h> |
---|
| 1217 | #include <string.h> |
---|
| 1218 | int line_num=1; |
---|
| 1219 | extern FILE * yyin; |
---|
| 1220 | #define MAX_INCLUDE_DEPTH 30 |
---|
| 1221 | YY_BUFFER_STATE include_stack[MAX_INCLUDE_DEPTH]; |
---|
[1349] | 1222 | #line 460 "convert.yy.c" |
---|
[396] | 1223 | |
---|
| 1224 | /* Macros after this point can all be overridden by user definitions in |
---|
| 1225 | * section 1. |
---|
| 1226 | */ |
---|
| 1227 | |
---|
| 1228 | #ifndef YY_SKIP_YYWRAP |
---|
| 1229 | #ifdef __cplusplus |
---|
[1349] | 1230 | extern "C" int yywrap YY_PROTO(( void )); |
---|
[396] | 1231 | #else |
---|
[1349] | 1232 | extern int yywrap YY_PROTO(( void )); |
---|
[396] | 1233 | #endif |
---|
| 1234 | #endif |
---|
| 1235 | |
---|
[1349] | 1236 | #ifndef YY_NO_UNPUT |
---|
| 1237 | static void yyunput YY_PROTO(( int c, char *buf_ptr )); |
---|
| 1238 | #endif |
---|
| 1239 | |
---|
[396] | 1240 | #ifndef yytext_ptr |
---|
[1349] | 1241 | static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); |
---|
[396] | 1242 | #endif |
---|
| 1243 | |
---|
| 1244 | #ifdef YY_NEED_STRLEN |
---|
[1349] | 1245 | static int yy_flex_strlen YY_PROTO(( yyconst char * )); |
---|
[396] | 1246 | #endif |
---|
| 1247 | |
---|
| 1248 | #ifndef YY_NO_INPUT |
---|
| 1249 | #ifdef __cplusplus |
---|
[1349] | 1250 | static int yyinput YY_PROTO(( void )); |
---|
[396] | 1251 | #else |
---|
[1349] | 1252 | static int input YY_PROTO(( void )); |
---|
[396] | 1253 | #endif |
---|
[1349] | 1254 | #endif |
---|
[396] | 1255 | |
---|
[1349] | 1256 | #if YY_STACK_USED |
---|
| 1257 | static int yy_start_stack_ptr = 0; |
---|
| 1258 | static int yy_start_stack_depth = 0; |
---|
| 1259 | static int *yy_start_stack = 0; |
---|
| 1260 | #ifndef YY_NO_PUSH_STATE |
---|
| 1261 | static void yy_push_state YY_PROTO(( int new_state )); |
---|
[396] | 1262 | #endif |
---|
[1349] | 1263 | #ifndef YY_NO_POP_STATE |
---|
| 1264 | static void yy_pop_state YY_PROTO(( void )); |
---|
| 1265 | #endif |
---|
| 1266 | #ifndef YY_NO_TOP_STATE |
---|
| 1267 | static int yy_top_state YY_PROTO(( void )); |
---|
| 1268 | #endif |
---|
[396] | 1269 | |
---|
[1349] | 1270 | #else |
---|
| 1271 | #define YY_NO_PUSH_STATE 1 |
---|
| 1272 | #define YY_NO_POP_STATE 1 |
---|
| 1273 | #define YY_NO_TOP_STATE 1 |
---|
| 1274 | #endif |
---|
| 1275 | |
---|
| 1276 | #ifdef YY_MALLOC_DECL |
---|
| 1277 | YY_MALLOC_DECL |
---|
| 1278 | #else |
---|
| 1279 | #if __STDC__ |
---|
| 1280 | #ifndef __cplusplus |
---|
| 1281 | #include <stdlib.h> |
---|
| 1282 | #endif |
---|
| 1283 | #else |
---|
| 1284 | /* Just try to get by without declaring the routines. This will fail |
---|
| 1285 | * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) |
---|
| 1286 | * or sizeof(void*) != sizeof(int). |
---|
| 1287 | */ |
---|
| 1288 | #endif |
---|
| 1289 | #endif |
---|
| 1290 | |
---|
[396] | 1291 | /* Amount of stuff to slurp up with each read. */ |
---|
| 1292 | #ifndef YY_READ_BUF_SIZE |
---|
| 1293 | #define YY_READ_BUF_SIZE 8192 |
---|
| 1294 | #endif |
---|
| 1295 | |
---|
| 1296 | /* Copy whatever the last rule matched to the standard output. */ |
---|
[1349] | 1297 | |
---|
[396] | 1298 | #ifndef ECHO |
---|
| 1299 | /* This used to be an fputs(), but since the string might contain NUL's, |
---|
| 1300 | * we now use fwrite(). |
---|
| 1301 | */ |
---|
| 1302 | #define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) |
---|
| 1303 | #endif |
---|
| 1304 | |
---|
| 1305 | /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, |
---|
| 1306 | * is returned in "result". |
---|
| 1307 | */ |
---|
| 1308 | #ifndef YY_INPUT |
---|
| 1309 | #define YY_INPUT(buf,result,max_size) \ |
---|
[1349] | 1310 | if ( yy_current_buffer->yy_is_interactive ) \ |
---|
[396] | 1311 | { \ |
---|
[1349] | 1312 | int c = '*', n; \ |
---|
[396] | 1313 | for ( n = 0; n < max_size && \ |
---|
| 1314 | (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ |
---|
| 1315 | buf[n] = (char) c; \ |
---|
| 1316 | if ( c == '\n' ) \ |
---|
| 1317 | buf[n++] = (char) c; \ |
---|
| 1318 | if ( c == EOF && ferror( yyin ) ) \ |
---|
| 1319 | YY_FATAL_ERROR( "input in flex scanner failed" ); \ |
---|
| 1320 | result = n; \ |
---|
| 1321 | } \ |
---|
[1349] | 1322 | else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \ |
---|
| 1323 | && ferror( yyin ) ) \ |
---|
| 1324 | YY_FATAL_ERROR( "input in flex scanner failed" ); |
---|
[396] | 1325 | #endif |
---|
| 1326 | |
---|
| 1327 | /* No semi-colon after return; correct usage is to write "yyterminate();" - |
---|
| 1328 | * we don't want an extra ';' after the "return" because that will cause |
---|
| 1329 | * some compilers to complain about unreachable statements. |
---|
| 1330 | */ |
---|
| 1331 | #ifndef yyterminate |
---|
| 1332 | #define yyterminate() return YY_NULL |
---|
| 1333 | #endif |
---|
| 1334 | |
---|
| 1335 | /* Number of entries by which start-condition stack grows. */ |
---|
| 1336 | #ifndef YY_START_STACK_INCR |
---|
| 1337 | #define YY_START_STACK_INCR 25 |
---|
| 1338 | #endif |
---|
| 1339 | |
---|
| 1340 | /* Report a fatal error. */ |
---|
| 1341 | #ifndef YY_FATAL_ERROR |
---|
| 1342 | #define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) |
---|
| 1343 | #endif |
---|
| 1344 | |
---|
| 1345 | /* Default declaration of generated scanner - a define so the user can |
---|
| 1346 | * easily add parameters. |
---|
| 1347 | */ |
---|
| 1348 | #ifndef YY_DECL |
---|
[1349] | 1349 | #define YY_DECL int yylex YY_PROTO(( void )) |
---|
| 1350 | #endif |
---|
[396] | 1351 | |
---|
| 1352 | /* Code executed at the beginning of each rule, after yytext and yyleng |
---|
| 1353 | * have been set up. |
---|
| 1354 | */ |
---|
| 1355 | #ifndef YY_USER_ACTION |
---|
| 1356 | #define YY_USER_ACTION |
---|
| 1357 | #endif |
---|
| 1358 | |
---|
| 1359 | /* Code executed at the end of each rule. */ |
---|
| 1360 | #ifndef YY_BREAK |
---|
| 1361 | #define YY_BREAK break; |
---|
| 1362 | #endif |
---|
| 1363 | |
---|
| 1364 | #define YY_RULE_SETUP \ |
---|
| 1365 | YY_USER_ACTION |
---|
| 1366 | |
---|
| 1367 | YY_DECL |
---|
[1349] | 1368 | { |
---|
[396] | 1369 | register yy_state_type yy_current_state; |
---|
| 1370 | register char *yy_cp, *yy_bp; |
---|
| 1371 | register int yy_act; |
---|
[1349] | 1372 | |
---|
[530] | 1373 | #line 55 "convert.lex" |
---|
[396] | 1374 | |
---|
[1349] | 1375 | #line 613 "convert.yy.c" |
---|
[396] | 1376 | |
---|
[1349] | 1377 | if ( yy_init ) |
---|
[396] | 1378 | { |
---|
[1349] | 1379 | yy_init = 0; |
---|
[396] | 1380 | |
---|
| 1381 | #ifdef YY_USER_INIT |
---|
| 1382 | YY_USER_INIT; |
---|
| 1383 | #endif |
---|
| 1384 | |
---|
[1349] | 1385 | if ( ! yy_start ) |
---|
| 1386 | yy_start = 1; /* first start state */ |
---|
[396] | 1387 | |
---|
| 1388 | if ( ! yyin ) |
---|
| 1389 | yyin = stdin; |
---|
| 1390 | |
---|
| 1391 | if ( ! yyout ) |
---|
| 1392 | yyout = stdout; |
---|
| 1393 | |
---|
[1349] | 1394 | if ( ! yy_current_buffer ) |
---|
| 1395 | yy_current_buffer = |
---|
| 1396 | yy_create_buffer( yyin, YY_BUF_SIZE ); |
---|
[396] | 1397 | |
---|
[1349] | 1398 | yy_load_buffer_state(); |
---|
[396] | 1399 | } |
---|
| 1400 | |
---|
| 1401 | while ( 1 ) /* loops until end-of-file is reached */ |
---|
| 1402 | { |
---|
[1349] | 1403 | yy_cp = yy_c_buf_p; |
---|
[396] | 1404 | |
---|
| 1405 | /* Support of yytext. */ |
---|
[1349] | 1406 | *yy_cp = yy_hold_char; |
---|
[396] | 1407 | |
---|
| 1408 | /* yy_bp points to the position in yy_ch_buf of the start of |
---|
| 1409 | * the current run. |
---|
| 1410 | */ |
---|
| 1411 | yy_bp = yy_cp; |
---|
| 1412 | |
---|
[1349] | 1413 | yy_current_state = yy_start; |
---|
[396] | 1414 | yy_match: |
---|
| 1415 | do |
---|
| 1416 | { |
---|
| 1417 | register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; |
---|
| 1418 | if ( yy_accept[yy_current_state] ) |
---|
| 1419 | { |
---|
[1349] | 1420 | yy_last_accepting_state = yy_current_state; |
---|
| 1421 | yy_last_accepting_cpos = yy_cp; |
---|
[396] | 1422 | } |
---|
| 1423 | while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) |
---|
| 1424 | { |
---|
| 1425 | yy_current_state = (int) yy_def[yy_current_state]; |
---|
[663] | 1426 | if ( yy_current_state >= 74 ) |
---|
[396] | 1427 | yy_c = yy_meta[(unsigned int) yy_c]; |
---|
| 1428 | } |
---|
| 1429 | yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; |
---|
| 1430 | ++yy_cp; |
---|
| 1431 | } |
---|
[663] | 1432 | while ( yy_base[yy_current_state] != 97 ); |
---|
[396] | 1433 | |
---|
| 1434 | yy_find_action: |
---|
| 1435 | yy_act = yy_accept[yy_current_state]; |
---|
| 1436 | if ( yy_act == 0 ) |
---|
| 1437 | { /* have to back up */ |
---|
[1349] | 1438 | yy_cp = yy_last_accepting_cpos; |
---|
| 1439 | yy_current_state = yy_last_accepting_state; |
---|
[396] | 1440 | yy_act = yy_accept[yy_current_state]; |
---|
| 1441 | } |
---|
| 1442 | |
---|
| 1443 | YY_DO_BEFORE_ACTION; |
---|
| 1444 | |
---|
[1349] | 1445 | |
---|
[396] | 1446 | do_action: /* This label is used only to access EOF actions. */ |
---|
| 1447 | |
---|
[1349] | 1448 | |
---|
[396] | 1449 | switch ( yy_act ) |
---|
| 1450 | { /* beginning of action switch */ |
---|
| 1451 | case 0: /* must back up */ |
---|
| 1452 | /* undo the effects of YY_DO_BEFORE_ACTION */ |
---|
[1349] | 1453 | *yy_cp = yy_hold_char; |
---|
| 1454 | yy_cp = yy_last_accepting_cpos; |
---|
| 1455 | yy_current_state = yy_last_accepting_state; |
---|
[396] | 1456 | goto yy_find_action; |
---|
| 1457 | |
---|
| 1458 | case 1: |
---|
| 1459 | YY_RULE_SETUP |
---|
[530] | 1460 | #line 56 "convert.lex" |
---|
| 1461 | return TOK_MODULEMAIN; /* name of the module */ |
---|
[396] | 1462 | YY_BREAK |
---|
| 1463 | case 2: |
---|
| 1464 | YY_RULE_SETUP |
---|
[530] | 1465 | #line 57 "convert.lex" |
---|
| 1466 | return TOK_NOTGRIDDEP; /* variable which are not grid dependent */ |
---|
[396] | 1467 | YY_BREAK |
---|
| 1468 | case 3: |
---|
| 1469 | YY_RULE_SETUP |
---|
[530] | 1470 | #line 58 "convert.lex" |
---|
| 1471 | return TOK_USE; |
---|
[396] | 1472 | YY_BREAK |
---|
| 1473 | case 4: |
---|
| 1474 | YY_RULE_SETUP |
---|
[530] | 1475 | #line 59 "convert.lex" |
---|
| 1476 | {} |
---|
[396] | 1477 | YY_BREAK |
---|
| 1478 | case 5: |
---|
| 1479 | YY_RULE_SETUP |
---|
[530] | 1480 | #line 60 "convert.lex" |
---|
| 1481 | return TOK_SEP; |
---|
[396] | 1482 | YY_BREAK |
---|
| 1483 | case 6: |
---|
| 1484 | YY_RULE_SETUP |
---|
[530] | 1485 | #line 61 "convert.lex" |
---|
| 1486 | {strcpy(yylval.na,yytext); return TOK_USEITEM;} |
---|
[396] | 1487 | YY_BREAK |
---|
| 1488 | case 7: |
---|
| 1489 | YY_RULE_SETUP |
---|
[530] | 1490 | #line 62 "convert.lex" |
---|
[396] | 1491 | {strcpy(yylval.na,yytext); return TOK_PROBTYPE;} |
---|
| 1492 | YY_BREAK |
---|
| 1493 | /* dimension of the problem */ |
---|
[530] | 1494 | case 8: |
---|
[396] | 1495 | YY_RULE_SETUP |
---|
[530] | 1496 | #line 64 "convert.lex" |
---|
[396] | 1497 | {strcpy(yylval.na,yytext); return TOK_NAME;} |
---|
| 1498 | YY_BREAK |
---|
[530] | 1499 | case 9: |
---|
[396] | 1500 | YY_RULE_SETUP |
---|
| 1501 | #line 65 "convert.lex" |
---|
| 1502 | {return (int) *yytext;} |
---|
| 1503 | YY_BREAK |
---|
[530] | 1504 | case 10: |
---|
[396] | 1505 | YY_RULE_SETUP |
---|
| 1506 | #line 66 "convert.lex" |
---|
| 1507 | {line_num++;return (int) *yytext;} |
---|
| 1508 | YY_BREAK |
---|
[530] | 1509 | case 11: |
---|
[396] | 1510 | YY_RULE_SETUP |
---|
| 1511 | #line 67 "convert.lex" |
---|
| 1512 | ; |
---|
| 1513 | YY_BREAK |
---|
[530] | 1514 | case 12: |
---|
[396] | 1515 | YY_RULE_SETUP |
---|
| 1516 | #line 68 "convert.lex" |
---|
| 1517 | ECHO; |
---|
| 1518 | YY_BREAK |
---|
[1349] | 1519 | #line 757 "convert.yy.c" |
---|
[396] | 1520 | case YY_STATE_EOF(INITIAL): |
---|
| 1521 | case YY_STATE_EOF(character): |
---|
| 1522 | yyterminate(); |
---|
| 1523 | |
---|
| 1524 | case YY_END_OF_BUFFER: |
---|
| 1525 | { |
---|
| 1526 | /* Amount of text matched not including the EOB char. */ |
---|
[1349] | 1527 | int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1; |
---|
[396] | 1528 | |
---|
| 1529 | /* Undo the effects of YY_DO_BEFORE_ACTION. */ |
---|
[1349] | 1530 | *yy_cp = yy_hold_char; |
---|
[396] | 1531 | YY_RESTORE_YY_MORE_OFFSET |
---|
| 1532 | |
---|
[1349] | 1533 | if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) |
---|
[396] | 1534 | { |
---|
| 1535 | /* We're scanning a new file or input source. It's |
---|
| 1536 | * possible that this happened because the user |
---|
| 1537 | * just pointed yyin at a new source and called |
---|
| 1538 | * yylex(). If so, then we have to assure |
---|
[1349] | 1539 | * consistency between yy_current_buffer and our |
---|
[396] | 1540 | * globals. Here is the right place to do so, because |
---|
| 1541 | * this is the first action (other than possibly a |
---|
| 1542 | * back-up) that will match for the new input source. |
---|
| 1543 | */ |
---|
[1349] | 1544 | yy_n_chars = yy_current_buffer->yy_n_chars; |
---|
| 1545 | yy_current_buffer->yy_input_file = yyin; |
---|
| 1546 | yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; |
---|
[396] | 1547 | } |
---|
| 1548 | |
---|
| 1549 | /* Note that here we test for yy_c_buf_p "<=" to the position |
---|
| 1550 | * of the first EOB in the buffer, since yy_c_buf_p will |
---|
| 1551 | * already have been incremented past the NUL character |
---|
| 1552 | * (since all states make transitions on EOB to the |
---|
| 1553 | * end-of-buffer state). Contrast this with the test |
---|
| 1554 | * in input(). |
---|
| 1555 | */ |
---|
[1349] | 1556 | if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) |
---|
[396] | 1557 | { /* This was really a NUL. */ |
---|
| 1558 | yy_state_type yy_next_state; |
---|
| 1559 | |
---|
[1349] | 1560 | yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; |
---|
[396] | 1561 | |
---|
[1349] | 1562 | yy_current_state = yy_get_previous_state(); |
---|
[396] | 1563 | |
---|
| 1564 | /* Okay, we're now positioned to make the NUL |
---|
| 1565 | * transition. We couldn't have |
---|
| 1566 | * yy_get_previous_state() go ahead and do it |
---|
| 1567 | * for us because it doesn't know how to deal |
---|
| 1568 | * with the possibility of jamming (and we don't |
---|
| 1569 | * want to build jamming into it because then it |
---|
| 1570 | * will run more slowly). |
---|
| 1571 | */ |
---|
| 1572 | |
---|
| 1573 | yy_next_state = yy_try_NUL_trans( yy_current_state ); |
---|
| 1574 | |
---|
[1349] | 1575 | yy_bp = yytext_ptr + YY_MORE_ADJ; |
---|
[396] | 1576 | |
---|
| 1577 | if ( yy_next_state ) |
---|
| 1578 | { |
---|
| 1579 | /* Consume the NUL. */ |
---|
[1349] | 1580 | yy_cp = ++yy_c_buf_p; |
---|
[396] | 1581 | yy_current_state = yy_next_state; |
---|
| 1582 | goto yy_match; |
---|
| 1583 | } |
---|
| 1584 | |
---|
| 1585 | else |
---|
| 1586 | { |
---|
[1349] | 1587 | yy_cp = yy_c_buf_p; |
---|
[396] | 1588 | goto yy_find_action; |
---|
| 1589 | } |
---|
| 1590 | } |
---|
| 1591 | |
---|
[1349] | 1592 | else switch ( yy_get_next_buffer() ) |
---|
[396] | 1593 | { |
---|
| 1594 | case EOB_ACT_END_OF_FILE: |
---|
| 1595 | { |
---|
[1349] | 1596 | yy_did_buffer_switch_on_eof = 0; |
---|
[396] | 1597 | |
---|
[1349] | 1598 | if ( yywrap() ) |
---|
[396] | 1599 | { |
---|
| 1600 | /* Note: because we've taken care in |
---|
| 1601 | * yy_get_next_buffer() to have set up |
---|
| 1602 | * yytext, we can now set up |
---|
| 1603 | * yy_c_buf_p so that if some total |
---|
| 1604 | * hoser (like flex itself) wants to |
---|
| 1605 | * call the scanner after we return the |
---|
| 1606 | * YY_NULL, it'll still work - another |
---|
| 1607 | * YY_NULL will get returned. |
---|
| 1608 | */ |
---|
[1349] | 1609 | yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; |
---|
[396] | 1610 | |
---|
| 1611 | yy_act = YY_STATE_EOF(YY_START); |
---|
| 1612 | goto do_action; |
---|
| 1613 | } |
---|
| 1614 | |
---|
| 1615 | else |
---|
| 1616 | { |
---|
[1349] | 1617 | if ( ! yy_did_buffer_switch_on_eof ) |
---|
[396] | 1618 | YY_NEW_FILE; |
---|
| 1619 | } |
---|
| 1620 | break; |
---|
| 1621 | } |
---|
| 1622 | |
---|
| 1623 | case EOB_ACT_CONTINUE_SCAN: |
---|
[1349] | 1624 | yy_c_buf_p = |
---|
| 1625 | yytext_ptr + yy_amount_of_matched_text; |
---|
[396] | 1626 | |
---|
[1349] | 1627 | yy_current_state = yy_get_previous_state(); |
---|
[396] | 1628 | |
---|
[1349] | 1629 | yy_cp = yy_c_buf_p; |
---|
| 1630 | yy_bp = yytext_ptr + YY_MORE_ADJ; |
---|
[396] | 1631 | goto yy_match; |
---|
| 1632 | |
---|
| 1633 | case EOB_ACT_LAST_MATCH: |
---|
[1349] | 1634 | yy_c_buf_p = |
---|
| 1635 | &yy_current_buffer->yy_ch_buf[yy_n_chars]; |
---|
[396] | 1636 | |
---|
[1349] | 1637 | yy_current_state = yy_get_previous_state(); |
---|
[396] | 1638 | |
---|
[1349] | 1639 | yy_cp = yy_c_buf_p; |
---|
| 1640 | yy_bp = yytext_ptr + YY_MORE_ADJ; |
---|
[396] | 1641 | goto yy_find_action; |
---|
| 1642 | } |
---|
| 1643 | break; |
---|
| 1644 | } |
---|
| 1645 | |
---|
| 1646 | default: |
---|
| 1647 | YY_FATAL_ERROR( |
---|
| 1648 | "fatal flex scanner internal error--no action found" ); |
---|
| 1649 | } /* end of action switch */ |
---|
| 1650 | } /* end of scanning one token */ |
---|
[1349] | 1651 | } /* end of yylex */ |
---|
[396] | 1652 | |
---|
[1349] | 1653 | |
---|
[396] | 1654 | /* yy_get_next_buffer - try to read in a new buffer |
---|
| 1655 | * |
---|
| 1656 | * Returns a code representing an action: |
---|
| 1657 | * EOB_ACT_LAST_MATCH - |
---|
| 1658 | * EOB_ACT_CONTINUE_SCAN - continue scanning from current position |
---|
| 1659 | * EOB_ACT_END_OF_FILE - end of file |
---|
| 1660 | */ |
---|
[1349] | 1661 | |
---|
| 1662 | static int yy_get_next_buffer() |
---|
| 1663 | { |
---|
| 1664 | register char *dest = yy_current_buffer->yy_ch_buf; |
---|
| 1665 | register char *source = yytext_ptr; |
---|
[396] | 1666 | register int number_to_move, i; |
---|
| 1667 | int ret_val; |
---|
| 1668 | |
---|
[1349] | 1669 | if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) |
---|
[396] | 1670 | YY_FATAL_ERROR( |
---|
| 1671 | "fatal flex scanner internal error--end of buffer missed" ); |
---|
| 1672 | |
---|
[1349] | 1673 | if ( yy_current_buffer->yy_fill_buffer == 0 ) |
---|
[396] | 1674 | { /* Don't try to fill the buffer, so this is an EOF. */ |
---|
[1349] | 1675 | if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 ) |
---|
[396] | 1676 | { |
---|
| 1677 | /* We matched a single character, the EOB, so |
---|
| 1678 | * treat this as a final EOF. |
---|
| 1679 | */ |
---|
| 1680 | return EOB_ACT_END_OF_FILE; |
---|
| 1681 | } |
---|
| 1682 | |
---|
| 1683 | else |
---|
| 1684 | { |
---|
| 1685 | /* We matched some text prior to the EOB, first |
---|
| 1686 | * process it. |
---|
| 1687 | */ |
---|
| 1688 | return EOB_ACT_LAST_MATCH; |
---|
| 1689 | } |
---|
| 1690 | } |
---|
| 1691 | |
---|
| 1692 | /* Try to read more data. */ |
---|
| 1693 | |
---|
| 1694 | /* First move last chars to start of buffer. */ |
---|
[1349] | 1695 | number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1; |
---|
[396] | 1696 | |
---|
| 1697 | for ( i = 0; i < number_to_move; ++i ) |
---|
| 1698 | *(dest++) = *(source++); |
---|
| 1699 | |
---|
[1349] | 1700 | if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) |
---|
[396] | 1701 | /* don't do the read, it's not guaranteed to return an EOF, |
---|
| 1702 | * just force an EOF |
---|
| 1703 | */ |
---|
[1349] | 1704 | yy_current_buffer->yy_n_chars = yy_n_chars = 0; |
---|
[396] | 1705 | |
---|
| 1706 | else |
---|
| 1707 | { |
---|
[1349] | 1708 | int num_to_read = |
---|
| 1709 | yy_current_buffer->yy_buf_size - number_to_move - 1; |
---|
[396] | 1710 | |
---|
| 1711 | while ( num_to_read <= 0 ) |
---|
| 1712 | { /* Not enough room in the buffer - grow it. */ |
---|
[1349] | 1713 | #ifdef YY_USES_REJECT |
---|
| 1714 | YY_FATAL_ERROR( |
---|
| 1715 | "input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); |
---|
| 1716 | #else |
---|
[396] | 1717 | |
---|
| 1718 | /* just a shorter name for the current buffer */ |
---|
[1349] | 1719 | YY_BUFFER_STATE b = yy_current_buffer; |
---|
[396] | 1720 | |
---|
| 1721 | int yy_c_buf_p_offset = |
---|
[1349] | 1722 | (int) (yy_c_buf_p - b->yy_ch_buf); |
---|
[396] | 1723 | |
---|
| 1724 | if ( b->yy_is_our_buffer ) |
---|
| 1725 | { |
---|
| 1726 | int new_size = b->yy_buf_size * 2; |
---|
| 1727 | |
---|
| 1728 | if ( new_size <= 0 ) |
---|
| 1729 | b->yy_buf_size += b->yy_buf_size / 8; |
---|
| 1730 | else |
---|
| 1731 | b->yy_buf_size *= 2; |
---|
| 1732 | |
---|
| 1733 | b->yy_ch_buf = (char *) |
---|
| 1734 | /* Include room in for 2 EOB chars. */ |
---|
[1349] | 1735 | yy_flex_realloc( (void *) b->yy_ch_buf, |
---|
| 1736 | b->yy_buf_size + 2 ); |
---|
[396] | 1737 | } |
---|
| 1738 | else |
---|
| 1739 | /* Can't grow it, we don't own it. */ |
---|
| 1740 | b->yy_ch_buf = 0; |
---|
| 1741 | |
---|
| 1742 | if ( ! b->yy_ch_buf ) |
---|
| 1743 | YY_FATAL_ERROR( |
---|
| 1744 | "fatal error - scanner input buffer overflow" ); |
---|
| 1745 | |
---|
[1349] | 1746 | yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; |
---|
[396] | 1747 | |
---|
[1349] | 1748 | num_to_read = yy_current_buffer->yy_buf_size - |
---|
[396] | 1749 | number_to_move - 1; |
---|
[1349] | 1750 | #endif |
---|
[396] | 1751 | } |
---|
| 1752 | |
---|
| 1753 | if ( num_to_read > YY_READ_BUF_SIZE ) |
---|
| 1754 | num_to_read = YY_READ_BUF_SIZE; |
---|
| 1755 | |
---|
| 1756 | /* Read in more data. */ |
---|
[1349] | 1757 | YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), |
---|
| 1758 | yy_n_chars, num_to_read ); |
---|
[396] | 1759 | |
---|
[1349] | 1760 | yy_current_buffer->yy_n_chars = yy_n_chars; |
---|
[396] | 1761 | } |
---|
| 1762 | |
---|
[1349] | 1763 | if ( yy_n_chars == 0 ) |
---|
[396] | 1764 | { |
---|
| 1765 | if ( number_to_move == YY_MORE_ADJ ) |
---|
| 1766 | { |
---|
| 1767 | ret_val = EOB_ACT_END_OF_FILE; |
---|
[1349] | 1768 | yyrestart( yyin ); |
---|
[396] | 1769 | } |
---|
| 1770 | |
---|
| 1771 | else |
---|
| 1772 | { |
---|
| 1773 | ret_val = EOB_ACT_LAST_MATCH; |
---|
[1349] | 1774 | yy_current_buffer->yy_buffer_status = |
---|
[396] | 1775 | YY_BUFFER_EOF_PENDING; |
---|
| 1776 | } |
---|
| 1777 | } |
---|
| 1778 | |
---|
| 1779 | else |
---|
| 1780 | ret_val = EOB_ACT_CONTINUE_SCAN; |
---|
| 1781 | |
---|
[1349] | 1782 | yy_n_chars += number_to_move; |
---|
| 1783 | yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; |
---|
| 1784 | yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; |
---|
[396] | 1785 | |
---|
[1349] | 1786 | yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; |
---|
[396] | 1787 | |
---|
| 1788 | return ret_val; |
---|
[1349] | 1789 | } |
---|
[396] | 1790 | |
---|
[1349] | 1791 | |
---|
[396] | 1792 | /* yy_get_previous_state - get the state just before the EOB char was reached */ |
---|
| 1793 | |
---|
[1349] | 1794 | static yy_state_type yy_get_previous_state() |
---|
| 1795 | { |
---|
[396] | 1796 | register yy_state_type yy_current_state; |
---|
| 1797 | register char *yy_cp; |
---|
| 1798 | |
---|
[1349] | 1799 | yy_current_state = yy_start; |
---|
| 1800 | |
---|
| 1801 | for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) |
---|
[396] | 1802 | { |
---|
| 1803 | register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); |
---|
| 1804 | if ( yy_accept[yy_current_state] ) |
---|
| 1805 | { |
---|
[1349] | 1806 | yy_last_accepting_state = yy_current_state; |
---|
| 1807 | yy_last_accepting_cpos = yy_cp; |
---|
[396] | 1808 | } |
---|
| 1809 | while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) |
---|
| 1810 | { |
---|
| 1811 | yy_current_state = (int) yy_def[yy_current_state]; |
---|
[663] | 1812 | if ( yy_current_state >= 74 ) |
---|
[396] | 1813 | yy_c = yy_meta[(unsigned int) yy_c]; |
---|
| 1814 | } |
---|
| 1815 | yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; |
---|
| 1816 | } |
---|
| 1817 | |
---|
| 1818 | return yy_current_state; |
---|
[1349] | 1819 | } |
---|
[396] | 1820 | |
---|
[1349] | 1821 | |
---|
[396] | 1822 | /* yy_try_NUL_trans - try to make a transition on the NUL character |
---|
| 1823 | * |
---|
| 1824 | * synopsis |
---|
| 1825 | * next_state = yy_try_NUL_trans( current_state ); |
---|
| 1826 | */ |
---|
[1349] | 1827 | |
---|
| 1828 | #ifdef YY_USE_PROTOS |
---|
| 1829 | static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) |
---|
| 1830 | #else |
---|
| 1831 | static yy_state_type yy_try_NUL_trans( yy_current_state ) |
---|
| 1832 | yy_state_type yy_current_state; |
---|
| 1833 | #endif |
---|
| 1834 | { |
---|
[396] | 1835 | register int yy_is_jam; |
---|
[1349] | 1836 | register char *yy_cp = yy_c_buf_p; |
---|
[396] | 1837 | |
---|
| 1838 | register YY_CHAR yy_c = 1; |
---|
| 1839 | if ( yy_accept[yy_current_state] ) |
---|
| 1840 | { |
---|
[1349] | 1841 | yy_last_accepting_state = yy_current_state; |
---|
| 1842 | yy_last_accepting_cpos = yy_cp; |
---|
[396] | 1843 | } |
---|
| 1844 | while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) |
---|
| 1845 | { |
---|
| 1846 | yy_current_state = (int) yy_def[yy_current_state]; |
---|
[663] | 1847 | if ( yy_current_state >= 74 ) |
---|
[396] | 1848 | yy_c = yy_meta[(unsigned int) yy_c]; |
---|
| 1849 | } |
---|
| 1850 | yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; |
---|
[663] | 1851 | yy_is_jam = (yy_current_state == 73); |
---|
[396] | 1852 | |
---|
| 1853 | return yy_is_jam ? 0 : yy_current_state; |
---|
[1349] | 1854 | } |
---|
[396] | 1855 | |
---|
| 1856 | |
---|
[1349] | 1857 | #ifndef YY_NO_UNPUT |
---|
| 1858 | #ifdef YY_USE_PROTOS |
---|
| 1859 | static void yyunput( int c, register char *yy_bp ) |
---|
| 1860 | #else |
---|
| 1861 | static void yyunput( c, yy_bp ) |
---|
| 1862 | int c; |
---|
| 1863 | register char *yy_bp; |
---|
| 1864 | #endif |
---|
| 1865 | { |
---|
| 1866 | register char *yy_cp = yy_c_buf_p; |
---|
| 1867 | |
---|
[396] | 1868 | /* undo effects of setting up yytext */ |
---|
[1349] | 1869 | *yy_cp = yy_hold_char; |
---|
[396] | 1870 | |
---|
[1349] | 1871 | if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) |
---|
[396] | 1872 | { /* need to shift things up to make room */ |
---|
| 1873 | /* +2 for EOB chars. */ |
---|
[1349] | 1874 | register int number_to_move = yy_n_chars + 2; |
---|
| 1875 | register char *dest = &yy_current_buffer->yy_ch_buf[ |
---|
| 1876 | yy_current_buffer->yy_buf_size + 2]; |
---|
[396] | 1877 | register char *source = |
---|
[1349] | 1878 | &yy_current_buffer->yy_ch_buf[number_to_move]; |
---|
[396] | 1879 | |
---|
[1349] | 1880 | while ( source > yy_current_buffer->yy_ch_buf ) |
---|
[396] | 1881 | *--dest = *--source; |
---|
| 1882 | |
---|
| 1883 | yy_cp += (int) (dest - source); |
---|
| 1884 | yy_bp += (int) (dest - source); |
---|
[1349] | 1885 | yy_current_buffer->yy_n_chars = |
---|
| 1886 | yy_n_chars = yy_current_buffer->yy_buf_size; |
---|
[396] | 1887 | |
---|
[1349] | 1888 | if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) |
---|
[396] | 1889 | YY_FATAL_ERROR( "flex scanner push-back overflow" ); |
---|
| 1890 | } |
---|
| 1891 | |
---|
| 1892 | *--yy_cp = (char) c; |
---|
| 1893 | |
---|
| 1894 | |
---|
[1349] | 1895 | yytext_ptr = yy_bp; |
---|
| 1896 | yy_hold_char = *yy_cp; |
---|
| 1897 | yy_c_buf_p = yy_cp; |
---|
| 1898 | } |
---|
| 1899 | #endif /* ifndef YY_NO_UNPUT */ |
---|
| 1900 | |
---|
| 1901 | |
---|
[396] | 1902 | #ifdef __cplusplus |
---|
[1349] | 1903 | static int yyinput() |
---|
[396] | 1904 | #else |
---|
[1349] | 1905 | static int input() |
---|
[396] | 1906 | #endif |
---|
[1349] | 1907 | { |
---|
[396] | 1908 | int c; |
---|
| 1909 | |
---|
[1349] | 1910 | *yy_c_buf_p = yy_hold_char; |
---|
| 1911 | |
---|
| 1912 | if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) |
---|
[396] | 1913 | { |
---|
| 1914 | /* yy_c_buf_p now points to the character we want to return. |
---|
| 1915 | * If this occurs *before* the EOB characters, then it's a |
---|
| 1916 | * valid NUL; if not, then we've hit the end of the buffer. |
---|
| 1917 | */ |
---|
[1349] | 1918 | if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) |
---|
[396] | 1919 | /* This was really a NUL. */ |
---|
[1349] | 1920 | *yy_c_buf_p = '\0'; |
---|
[396] | 1921 | |
---|
| 1922 | else |
---|
| 1923 | { /* need more input */ |
---|
[1349] | 1924 | int offset = yy_c_buf_p - yytext_ptr; |
---|
| 1925 | ++yy_c_buf_p; |
---|
[396] | 1926 | |
---|
[1349] | 1927 | switch ( yy_get_next_buffer() ) |
---|
[396] | 1928 | { |
---|
| 1929 | case EOB_ACT_LAST_MATCH: |
---|
| 1930 | /* This happens because yy_g_n_b() |
---|
| 1931 | * sees that we've accumulated a |
---|
| 1932 | * token and flags that we need to |
---|
| 1933 | * try matching the token before |
---|
| 1934 | * proceeding. But for input(), |
---|
| 1935 | * there's no matching to consider. |
---|
| 1936 | * So convert the EOB_ACT_LAST_MATCH |
---|
| 1937 | * to EOB_ACT_END_OF_FILE. |
---|
| 1938 | */ |
---|
| 1939 | |
---|
| 1940 | /* Reset buffer status. */ |
---|
[1349] | 1941 | yyrestart( yyin ); |
---|
[396] | 1942 | |
---|
[1349] | 1943 | /* fall through */ |
---|
[396] | 1944 | |
---|
| 1945 | case EOB_ACT_END_OF_FILE: |
---|
| 1946 | { |
---|
[1349] | 1947 | if ( yywrap() ) |
---|
| 1948 | return EOF; |
---|
[396] | 1949 | |
---|
[1349] | 1950 | if ( ! yy_did_buffer_switch_on_eof ) |
---|
[396] | 1951 | YY_NEW_FILE; |
---|
| 1952 | #ifdef __cplusplus |
---|
| 1953 | return yyinput(); |
---|
| 1954 | #else |
---|
| 1955 | return input(); |
---|
| 1956 | #endif |
---|
| 1957 | } |
---|
| 1958 | |
---|
| 1959 | case EOB_ACT_CONTINUE_SCAN: |
---|
[1349] | 1960 | yy_c_buf_p = yytext_ptr + offset; |
---|
[396] | 1961 | break; |
---|
| 1962 | } |
---|
| 1963 | } |
---|
| 1964 | } |
---|
| 1965 | |
---|
[1349] | 1966 | c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ |
---|
| 1967 | *yy_c_buf_p = '\0'; /* preserve yytext */ |
---|
| 1968 | yy_hold_char = *++yy_c_buf_p; |
---|
[396] | 1969 | |
---|
[1349] | 1970 | |
---|
[396] | 1971 | return c; |
---|
[1349] | 1972 | } |
---|
[396] | 1973 | |
---|
[1349] | 1974 | |
---|
| 1975 | #ifdef YY_USE_PROTOS |
---|
| 1976 | void yyrestart( FILE *input_file ) |
---|
| 1977 | #else |
---|
| 1978 | void yyrestart( input_file ) |
---|
| 1979 | FILE *input_file; |
---|
| 1980 | #endif |
---|
| 1981 | { |
---|
| 1982 | if ( ! yy_current_buffer ) |
---|
| 1983 | yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); |
---|
| 1984 | |
---|
| 1985 | yy_init_buffer( yy_current_buffer, input_file ); |
---|
| 1986 | yy_load_buffer_state(); |
---|
[396] | 1987 | } |
---|
| 1988 | |
---|
| 1989 | |
---|
[1349] | 1990 | #ifdef YY_USE_PROTOS |
---|
| 1991 | void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) |
---|
| 1992 | #else |
---|
| 1993 | void yy_switch_to_buffer( new_buffer ) |
---|
| 1994 | YY_BUFFER_STATE new_buffer; |
---|
| 1995 | #endif |
---|
| 1996 | { |
---|
| 1997 | if ( yy_current_buffer == new_buffer ) |
---|
[396] | 1998 | return; |
---|
| 1999 | |
---|
[1349] | 2000 | if ( yy_current_buffer ) |
---|
[396] | 2001 | { |
---|
| 2002 | /* Flush out information for old buffer. */ |
---|
[1349] | 2003 | *yy_c_buf_p = yy_hold_char; |
---|
| 2004 | yy_current_buffer->yy_buf_pos = yy_c_buf_p; |
---|
| 2005 | yy_current_buffer->yy_n_chars = yy_n_chars; |
---|
[396] | 2006 | } |
---|
| 2007 | |
---|
[1349] | 2008 | yy_current_buffer = new_buffer; |
---|
| 2009 | yy_load_buffer_state(); |
---|
[396] | 2010 | |
---|
| 2011 | /* We don't actually know whether we did this switch during |
---|
| 2012 | * EOF (yywrap()) processing, but the only time this flag |
---|
| 2013 | * is looked at is after yywrap() is called, so it's safe |
---|
| 2014 | * to go ahead and always set it. |
---|
| 2015 | */ |
---|
[1349] | 2016 | yy_did_buffer_switch_on_eof = 1; |
---|
| 2017 | } |
---|
[396] | 2018 | |
---|
| 2019 | |
---|
[1349] | 2020 | #ifdef YY_USE_PROTOS |
---|
| 2021 | void yy_load_buffer_state( void ) |
---|
| 2022 | #else |
---|
| 2023 | void yy_load_buffer_state() |
---|
| 2024 | #endif |
---|
| 2025 | { |
---|
| 2026 | yy_n_chars = yy_current_buffer->yy_n_chars; |
---|
| 2027 | yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; |
---|
| 2028 | yyin = yy_current_buffer->yy_input_file; |
---|
| 2029 | yy_hold_char = *yy_c_buf_p; |
---|
| 2030 | } |
---|
| 2031 | |
---|
| 2032 | |
---|
| 2033 | #ifdef YY_USE_PROTOS |
---|
| 2034 | YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ) |
---|
| 2035 | #else |
---|
| 2036 | YY_BUFFER_STATE yy_create_buffer( file, size ) |
---|
| 2037 | FILE *file; |
---|
| 2038 | int size; |
---|
| 2039 | #endif |
---|
| 2040 | { |
---|
[396] | 2041 | YY_BUFFER_STATE b; |
---|
[1349] | 2042 | |
---|
| 2043 | b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); |
---|
[396] | 2044 | if ( ! b ) |
---|
| 2045 | YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); |
---|
| 2046 | |
---|
| 2047 | b->yy_buf_size = size; |
---|
| 2048 | |
---|
| 2049 | /* yy_ch_buf has to be 2 characters longer than the size given because |
---|
| 2050 | * we need to put in 2 end-of-buffer characters. |
---|
| 2051 | */ |
---|
[1349] | 2052 | b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); |
---|
[396] | 2053 | if ( ! b->yy_ch_buf ) |
---|
| 2054 | YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); |
---|
| 2055 | |
---|
| 2056 | b->yy_is_our_buffer = 1; |
---|
| 2057 | |
---|
[1349] | 2058 | yy_init_buffer( b, file ); |
---|
[396] | 2059 | |
---|
| 2060 | return b; |
---|
[1349] | 2061 | } |
---|
[396] | 2062 | |
---|
[1349] | 2063 | |
---|
| 2064 | #ifdef YY_USE_PROTOS |
---|
| 2065 | void yy_delete_buffer( YY_BUFFER_STATE b ) |
---|
| 2066 | #else |
---|
| 2067 | void yy_delete_buffer( b ) |
---|
| 2068 | YY_BUFFER_STATE b; |
---|
| 2069 | #endif |
---|
| 2070 | { |
---|
[396] | 2071 | if ( ! b ) |
---|
| 2072 | return; |
---|
| 2073 | |
---|
[1349] | 2074 | if ( b == yy_current_buffer ) |
---|
| 2075 | yy_current_buffer = (YY_BUFFER_STATE) 0; |
---|
[396] | 2076 | |
---|
| 2077 | if ( b->yy_is_our_buffer ) |
---|
[1349] | 2078 | yy_flex_free( (void *) b->yy_ch_buf ); |
---|
[396] | 2079 | |
---|
[1349] | 2080 | yy_flex_free( (void *) b ); |
---|
| 2081 | } |
---|
[396] | 2082 | |
---|
| 2083 | |
---|
[1349] | 2084 | #ifndef YY_ALWAYS_INTERACTIVE |
---|
| 2085 | #ifndef YY_NEVER_INTERACTIVE |
---|
| 2086 | extern int isatty YY_PROTO(( int )); |
---|
| 2087 | #endif |
---|
| 2088 | #endif |
---|
[396] | 2089 | |
---|
[1349] | 2090 | #ifdef YY_USE_PROTOS |
---|
| 2091 | void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) |
---|
| 2092 | #else |
---|
| 2093 | void yy_init_buffer( b, file ) |
---|
| 2094 | YY_BUFFER_STATE b; |
---|
| 2095 | FILE *file; |
---|
| 2096 | #endif |
---|
| 2097 | |
---|
| 2098 | |
---|
| 2099 | { |
---|
| 2100 | yy_flush_buffer( b ); |
---|
| 2101 | |
---|
[396] | 2102 | b->yy_input_file = file; |
---|
| 2103 | b->yy_fill_buffer = 1; |
---|
| 2104 | |
---|
[1349] | 2105 | #if YY_ALWAYS_INTERACTIVE |
---|
| 2106 | b->yy_is_interactive = 1; |
---|
| 2107 | #else |
---|
| 2108 | #if YY_NEVER_INTERACTIVE |
---|
| 2109 | b->yy_is_interactive = 0; |
---|
| 2110 | #else |
---|
| 2111 | b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; |
---|
| 2112 | #endif |
---|
| 2113 | #endif |
---|
| 2114 | } |
---|
[396] | 2115 | |
---|
| 2116 | |
---|
[1349] | 2117 | #ifdef YY_USE_PROTOS |
---|
| 2118 | void yy_flush_buffer( YY_BUFFER_STATE b ) |
---|
| 2119 | #else |
---|
| 2120 | void yy_flush_buffer( b ) |
---|
| 2121 | YY_BUFFER_STATE b; |
---|
| 2122 | #endif |
---|
| 2123 | |
---|
| 2124 | { |
---|
| 2125 | if ( ! b ) |
---|
[396] | 2126 | return; |
---|
| 2127 | |
---|
| 2128 | b->yy_n_chars = 0; |
---|
| 2129 | |
---|
| 2130 | /* We always need two end-of-buffer characters. The first causes |
---|
| 2131 | * a transition to the end-of-buffer state. The second causes |
---|
| 2132 | * a jam in that state. |
---|
| 2133 | */ |
---|
| 2134 | b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; |
---|
| 2135 | b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; |
---|
| 2136 | |
---|
| 2137 | b->yy_buf_pos = &b->yy_ch_buf[0]; |
---|
| 2138 | |
---|
| 2139 | b->yy_at_bol = 1; |
---|
| 2140 | b->yy_buffer_status = YY_BUFFER_NEW; |
---|
| 2141 | |
---|
[1349] | 2142 | if ( b == yy_current_buffer ) |
---|
| 2143 | yy_load_buffer_state(); |
---|
[396] | 2144 | } |
---|
| 2145 | |
---|
| 2146 | |
---|
[1349] | 2147 | #ifndef YY_NO_SCAN_BUFFER |
---|
| 2148 | #ifdef YY_USE_PROTOS |
---|
| 2149 | YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size ) |
---|
| 2150 | #else |
---|
| 2151 | YY_BUFFER_STATE yy_scan_buffer( base, size ) |
---|
| 2152 | char *base; |
---|
| 2153 | yy_size_t size; |
---|
| 2154 | #endif |
---|
| 2155 | { |
---|
| 2156 | YY_BUFFER_STATE b; |
---|
[1200] | 2157 | |
---|
[396] | 2158 | if ( size < 2 || |
---|
| 2159 | base[size-2] != YY_END_OF_BUFFER_CHAR || |
---|
| 2160 | base[size-1] != YY_END_OF_BUFFER_CHAR ) |
---|
| 2161 | /* They forgot to leave room for the EOB's. */ |
---|
| 2162 | return 0; |
---|
| 2163 | |
---|
[1349] | 2164 | b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); |
---|
[396] | 2165 | if ( ! b ) |
---|
| 2166 | YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); |
---|
| 2167 | |
---|
| 2168 | b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ |
---|
| 2169 | b->yy_buf_pos = b->yy_ch_buf = base; |
---|
| 2170 | b->yy_is_our_buffer = 0; |
---|
| 2171 | b->yy_input_file = 0; |
---|
| 2172 | b->yy_n_chars = b->yy_buf_size; |
---|
| 2173 | b->yy_is_interactive = 0; |
---|
| 2174 | b->yy_at_bol = 1; |
---|
| 2175 | b->yy_fill_buffer = 0; |
---|
| 2176 | b->yy_buffer_status = YY_BUFFER_NEW; |
---|
| 2177 | |
---|
[1349] | 2178 | yy_switch_to_buffer( b ); |
---|
[396] | 2179 | |
---|
| 2180 | return b; |
---|
[1349] | 2181 | } |
---|
| 2182 | #endif |
---|
[396] | 2183 | |
---|
| 2184 | |
---|
[1349] | 2185 | #ifndef YY_NO_SCAN_STRING |
---|
| 2186 | #ifdef YY_USE_PROTOS |
---|
| 2187 | YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str ) |
---|
| 2188 | #else |
---|
| 2189 | YY_BUFFER_STATE yy_scan_string( yy_str ) |
---|
| 2190 | yyconst char *yy_str; |
---|
| 2191 | #endif |
---|
| 2192 | { |
---|
| 2193 | int len; |
---|
| 2194 | for ( len = 0; yy_str[len]; ++len ) |
---|
| 2195 | ; |
---|
| 2196 | |
---|
| 2197 | return yy_scan_bytes( yy_str, len ); |
---|
| 2198 | } |
---|
| 2199 | #endif |
---|
| 2200 | |
---|
| 2201 | |
---|
| 2202 | #ifndef YY_NO_SCAN_BYTES |
---|
| 2203 | #ifdef YY_USE_PROTOS |
---|
| 2204 | YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len ) |
---|
| 2205 | #else |
---|
| 2206 | YY_BUFFER_STATE yy_scan_bytes( bytes, len ) |
---|
| 2207 | yyconst char *bytes; |
---|
| 2208 | int len; |
---|
| 2209 | #endif |
---|
| 2210 | { |
---|
[396] | 2211 | YY_BUFFER_STATE b; |
---|
| 2212 | char *buf; |
---|
| 2213 | yy_size_t n; |
---|
| 2214 | int i; |
---|
[1349] | 2215 | |
---|
[396] | 2216 | /* Get memory for full buffer, including space for trailing EOB's. */ |
---|
[1349] | 2217 | n = len + 2; |
---|
| 2218 | buf = (char *) yy_flex_alloc( n ); |
---|
[396] | 2219 | if ( ! buf ) |
---|
| 2220 | YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); |
---|
| 2221 | |
---|
[1349] | 2222 | for ( i = 0; i < len; ++i ) |
---|
| 2223 | buf[i] = bytes[i]; |
---|
[396] | 2224 | |
---|
[1349] | 2225 | buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; |
---|
[396] | 2226 | |
---|
[1349] | 2227 | b = yy_scan_buffer( buf, n ); |
---|
[396] | 2228 | if ( ! b ) |
---|
| 2229 | YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); |
---|
| 2230 | |
---|
| 2231 | /* It's okay to grow etc. this buffer, and we should throw it |
---|
| 2232 | * away when we're done. |
---|
| 2233 | */ |
---|
| 2234 | b->yy_is_our_buffer = 1; |
---|
| 2235 | |
---|
| 2236 | return b; |
---|
[1349] | 2237 | } |
---|
[396] | 2238 | #endif |
---|
| 2239 | |
---|
| 2240 | |
---|
[1349] | 2241 | #ifndef YY_NO_PUSH_STATE |
---|
| 2242 | #ifdef YY_USE_PROTOS |
---|
| 2243 | static void yy_push_state( int new_state ) |
---|
| 2244 | #else |
---|
| 2245 | static void yy_push_state( new_state ) |
---|
| 2246 | int new_state; |
---|
| 2247 | #endif |
---|
| 2248 | { |
---|
| 2249 | if ( yy_start_stack_ptr >= yy_start_stack_depth ) |
---|
| 2250 | { |
---|
| 2251 | yy_size_t new_size; |
---|
[396] | 2252 | |
---|
[1349] | 2253 | yy_start_stack_depth += YY_START_STACK_INCR; |
---|
| 2254 | new_size = yy_start_stack_depth * sizeof( int ); |
---|
[396] | 2255 | |
---|
[1349] | 2256 | if ( ! yy_start_stack ) |
---|
| 2257 | yy_start_stack = (int *) yy_flex_alloc( new_size ); |
---|
[396] | 2258 | |
---|
[1349] | 2259 | else |
---|
| 2260 | yy_start_stack = (int *) yy_flex_realloc( |
---|
| 2261 | (void *) yy_start_stack, new_size ); |
---|
[396] | 2262 | |
---|
[1349] | 2263 | if ( ! yy_start_stack ) |
---|
| 2264 | YY_FATAL_ERROR( |
---|
| 2265 | "out of memory expanding start-condition stack" ); |
---|
| 2266 | } |
---|
[396] | 2267 | |
---|
[1349] | 2268 | yy_start_stack[yy_start_stack_ptr++] = YY_START; |
---|
[396] | 2269 | |
---|
[1349] | 2270 | BEGIN(new_state); |
---|
| 2271 | } |
---|
| 2272 | #endif |
---|
[396] | 2273 | |
---|
| 2274 | |
---|
[1349] | 2275 | #ifndef YY_NO_POP_STATE |
---|
| 2276 | static void yy_pop_state() |
---|
| 2277 | { |
---|
| 2278 | if ( --yy_start_stack_ptr < 0 ) |
---|
| 2279 | YY_FATAL_ERROR( "start-condition stack underflow" ); |
---|
[396] | 2280 | |
---|
[1349] | 2281 | BEGIN(yy_start_stack[yy_start_stack_ptr]); |
---|
| 2282 | } |
---|
| 2283 | #endif |
---|
[396] | 2284 | |
---|
| 2285 | |
---|
[1349] | 2286 | #ifndef YY_NO_TOP_STATE |
---|
| 2287 | static int yy_top_state() |
---|
| 2288 | { |
---|
| 2289 | return yy_start_stack[yy_start_stack_ptr - 1]; |
---|
| 2290 | } |
---|
| 2291 | #endif |
---|
[396] | 2292 | |
---|
[1349] | 2293 | #ifndef YY_EXIT_FAILURE |
---|
| 2294 | #define YY_EXIT_FAILURE 2 |
---|
| 2295 | #endif |
---|
[396] | 2296 | |
---|
[1349] | 2297 | #ifdef YY_USE_PROTOS |
---|
| 2298 | static void yy_fatal_error( yyconst char msg[] ) |
---|
[396] | 2299 | #else |
---|
[1349] | 2300 | static void yy_fatal_error( msg ) |
---|
| 2301 | char msg[]; |
---|
[396] | 2302 | #endif |
---|
[1349] | 2303 | { |
---|
| 2304 | (void) fprintf( stderr, "%s\n", msg ); |
---|
| 2305 | exit( YY_EXIT_FAILURE ); |
---|
| 2306 | } |
---|
[396] | 2307 | |
---|
| 2308 | |
---|
| 2309 | |
---|
[1349] | 2310 | /* Redefine yyless() so it works in section 3 code. */ |
---|
[396] | 2311 | |
---|
[1349] | 2312 | #undef yyless |
---|
| 2313 | #define yyless(n) \ |
---|
| 2314 | do \ |
---|
| 2315 | { \ |
---|
| 2316 | /* Undo effects of setting up yytext. */ \ |
---|
| 2317 | yytext[yyleng] = yy_hold_char; \ |
---|
| 2318 | yy_c_buf_p = yytext + n; \ |
---|
| 2319 | yy_hold_char = *yy_c_buf_p; \ |
---|
| 2320 | *yy_c_buf_p = '\0'; \ |
---|
| 2321 | yyleng = n; \ |
---|
| 2322 | } \ |
---|
| 2323 | while ( 0 ) |
---|
[396] | 2324 | |
---|
| 2325 | |
---|
[1349] | 2326 | /* Internal utility routines. */ |
---|
[396] | 2327 | |
---|
| 2328 | #ifndef yytext_ptr |
---|
[1349] | 2329 | #ifdef YY_USE_PROTOS |
---|
| 2330 | static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) |
---|
| 2331 | #else |
---|
| 2332 | static void yy_flex_strncpy( s1, s2, n ) |
---|
| 2333 | char *s1; |
---|
| 2334 | yyconst char *s2; |
---|
| 2335 | int n; |
---|
| 2336 | #endif |
---|
| 2337 | { |
---|
[396] | 2338 | register int i; |
---|
| 2339 | for ( i = 0; i < n; ++i ) |
---|
| 2340 | s1[i] = s2[i]; |
---|
[1349] | 2341 | } |
---|
[396] | 2342 | #endif |
---|
| 2343 | |
---|
| 2344 | #ifdef YY_NEED_STRLEN |
---|
[1349] | 2345 | #ifdef YY_USE_PROTOS |
---|
| 2346 | static int yy_flex_strlen( yyconst char *s ) |
---|
| 2347 | #else |
---|
| 2348 | static int yy_flex_strlen( s ) |
---|
| 2349 | yyconst char *s; |
---|
| 2350 | #endif |
---|
| 2351 | { |
---|
[396] | 2352 | register int n; |
---|
| 2353 | for ( n = 0; s[n]; ++n ) |
---|
| 2354 | ; |
---|
| 2355 | |
---|
| 2356 | return n; |
---|
[1349] | 2357 | } |
---|
[396] | 2358 | #endif |
---|
| 2359 | |
---|
[1349] | 2360 | |
---|
| 2361 | #ifdef YY_USE_PROTOS |
---|
| 2362 | static void *yy_flex_alloc( yy_size_t size ) |
---|
| 2363 | #else |
---|
| 2364 | static void *yy_flex_alloc( size ) |
---|
| 2365 | yy_size_t size; |
---|
| 2366 | #endif |
---|
| 2367 | { |
---|
[396] | 2368 | return (void *) malloc( size ); |
---|
[1349] | 2369 | } |
---|
[396] | 2370 | |
---|
[1349] | 2371 | #ifdef YY_USE_PROTOS |
---|
| 2372 | static void *yy_flex_realloc( void *ptr, yy_size_t size ) |
---|
| 2373 | #else |
---|
| 2374 | static void *yy_flex_realloc( ptr, size ) |
---|
| 2375 | void *ptr; |
---|
| 2376 | yy_size_t size; |
---|
| 2377 | #endif |
---|
| 2378 | { |
---|
[396] | 2379 | /* The cast to (char *) in the following accommodates both |
---|
| 2380 | * implementations that use char* generic pointers, and those |
---|
| 2381 | * that use void* generic pointers. It works with the latter |
---|
| 2382 | * because both ANSI C and C++ allow castless assignment from |
---|
| 2383 | * any pointer type to void*, and deal with argument conversions |
---|
| 2384 | * as though doing an assignment. |
---|
| 2385 | */ |
---|
| 2386 | return (void *) realloc( (char *) ptr, size ); |
---|
[1349] | 2387 | } |
---|
[396] | 2388 | |
---|
[1349] | 2389 | #ifdef YY_USE_PROTOS |
---|
| 2390 | static void yy_flex_free( void *ptr ) |
---|
| 2391 | #else |
---|
| 2392 | static void yy_flex_free( ptr ) |
---|
| 2393 | void *ptr; |
---|
| 2394 | #endif |
---|
| 2395 | { |
---|
| 2396 | free( ptr ); |
---|
| 2397 | } |
---|
[396] | 2398 | |
---|
[1349] | 2399 | #if YY_MAIN |
---|
| 2400 | int main() |
---|
| 2401 | { |
---|
| 2402 | yylex(); |
---|
| 2403 | return 0; |
---|
| 2404 | } |
---|
| 2405 | #endif |
---|
[396] | 2406 | #line 68 "convert.lex" |
---|
| 2407 | |
---|
| 2408 | |
---|
| 2409 | |
---|
| 2410 | int yywrap() |
---|
| 2411 | { |
---|
| 2412 | } |
---|
| 2413 | |
---|
| 2414 | |
---|
| 2415 | yyerror(char *s) |
---|
| 2416 | { |
---|
| 2417 | if (!strcasecmp(curfile,mainfile)) |
---|
| 2418 | { |
---|
| 2419 | printf("Dans convert %s line %d, fichier %s\n",s,line_num,curfile); |
---|
| 2420 | } |
---|
| 2421 | else |
---|
| 2422 | { |
---|
| 2423 | printf("Dans convert %s line %d, fichier %s\n",s,line_num,curfile); |
---|
| 2424 | } |
---|
| 2425 | exit(0); |
---|
| 2426 | } |
---|