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

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
main.c in branches/nemo_v3_3_beta/NEMOGCM/EXTERNAL/AGRIF/LIB – NEMO

source: branches/nemo_v3_3_beta/NEMOGCM/EXTERNAL/AGRIF/LIB/main.c @ 2281

Last change on this file since 2281 was 2281, checked in by smasson, 13 years ago

set proper svn properties to all files...

  • Property svn:keywords set to Id
File size: 66.7 KB
Line 
1#ifndef lint
2static char yysccsid[] = "@(#)yaccpar  1.9 (Berkeley) 02/21/93";
3#endif
4#define YYBYACC 1
5#define YYMAJOR 1
6#define YYMINOR 9
7#define yyclearin (yychar=(-1))
8#define yyerrok (yyerrflag=0)
9#define YYRECOVERING (yyerrflag!=0)
10#define YYPREFIX "yy"
11#line 36 "convert.y"
12#include <stdlib.h>
13#include <stdio.h>
14#include <string.h>
15#include "decl.h"
16#line 42 "convert.y"
17typedef union {
18       int ival;
19       char na[LONG_C];
20       listnom * ln;
21       } YYSTYPE;
22#line 23 "y.tab.c"
23#define TOK_SEP 257
24#define TOK_USE 258
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
30#define YYERRCODE 256
31short yylhs[] = {                                        -1,
32    0,    0,    1,    1,    1,    1,    1,    1,    1,
33};
34short yylen[] = {                                         2,
35    0,    2,    1,    3,    5,    7,    3,    4,    3,
36};
37short yydefred[] = {                                      1,
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,
41};
42short yydgoto[] = {                                       1,
43    7,
44};
45short yysindex[] = {                                      0,
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,
49};
50short yyrindex[] = {                                      0,
51    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
52    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
53    0,    0,
54};
55short yygindex[] = {                                      0,
56    0,
57};
58#define YYTABLESIZE 253
59short yytable[] = {                                       6,
60   15,   19,    8,   10,    9,   11,   12,   13,   17,   14,
61   18,   21,   22,    0,    0,   16,   20,    0,    0,    0,
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,
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,
84    0,    0,    0,    0,    0,    0,    0,    2,    3,    4,
85    0,    0,    5,
86};
87short yycheck[] = {                                      10,
88   44,   44,  261,  257,  262,  262,   59,   59,   59,  262,
89  262,  262,   59,   -1,   -1,   59,   59,   -1,   -1,   -1,
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,
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,
112   -1,   -1,   -1,   -1,   -1,   -1,   -1,  258,  259,  260,
113   -1,   -1,  263,
114};
115#define YYFINAL 1
116#ifndef YYDEBUG
117#define YYDEBUG 1
118#endif
119#define YYMAXTOKEN 263
120#if YYDEBUG
121char *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,
1230,0,0,0,0,0,0,0,0,"'('","')'",0,0,"','",0,0,0,0,0,0,0,0,0,0,0,0,0,"':'","';'",0,
1240,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,
1250,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,
1260,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,
1270,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,
1280,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,
129"TOK_SEP","TOK_USE","TOK_MODULEMAIN","TOK_NOTGRIDDEP","TOK_USEITEM","TOK_NAME",
130"TOK_PROBTYPE",
131};
132char *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
147#define YYMAXDEPTH YYSTACKSIZE
148#else
149#ifdef YYMAXDEPTH
150#define YYSTACKSIZE YYMAXDEPTH
151#else
152#define YYSTACKSIZE 500
153#define YYMAXDEPTH 500
154#endif
155#endif
156int yydebug;
157int yynerrs;
158int yyerrflag;
159int yychar;
160short *yyssp;
161YYSTYPE *yyvsp;
162YYSTYPE yyval;
163YYSTYPE yylval;
164short yyss[YYSTACKSIZE];
165YYSTYPE yyvs[YYSTACKSIZE];
166#define yystacksize YYSTACKSIZE
167#line 83 "convert.y"
168
169int main(int argc,char *argv[])
170{
171   extern FILE * yyin ;
172   FILE *dependglobaloutput;
173   int i;
174   listnom *parcours;
175   listvar *newvar;
176   int stylegiven = 0;
177   int infreegiven ;
178   int infixedgiven ;
179   int lengthmainfile;
180
181   if (argc < 2)
182   {
183       printf("usage : conv <file> [-rm] [-incdir <directory>] \n");
184       printf(" [-comdirin   <directory>] [-comdirout <directory>]\n");
185       printf(" [-convfile  <FILENAME >] -SubloopScalar -SubloopScalar1 \n");
186       printf(" [-free|-fixed]\n");
187       exit(0);
188   }
189/******************************************************************************/
190/*  1-  Variables initialization                                              */
191/******************************************************************************/
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;
200   listofmoduletmp=(listusemodule *)NULL;
201   List_SubroutineDeclaration_Var=(listvar *)NULL;
202   List_UsedInSubroutine_Var=(listvar *)NULL;
203   List_NotGridDepend_Var=(listvar *)NULL;
204   Listofavailableindices=(listindice *)NULL;
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;
214   oldfortranout = (FILE *)NULL;
215
216   strcpy(mainfile,argv[1]);
217   strcpy(nomdir,"AGRIF_INC");
218   strcpy(commondirin,".");
219   strcpy(commondirout,".");
220   strcpy(filetoparse," ");
221   strcpy(subofagrifinitgrids,"");
222   strcpy(meetagrifinitgrids,"");
223   strcpy(mpiinitvar,"");
224
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 ;
278   inallocate = 0;
279   infixed = 1;
280   infree  = 0;
281
282   checkexistcommon=1;
283   todebug=0;
284   onlyfixedgrids=0;
285   fixedgrids=0;
286   InAgrifParentDef = 0;
287   IndicenbmaillesX=0;
288   IndicenbmaillesY=0;
289   IndicenbmaillesZ=0;
290   created_dimensionlist = 1;
291   indicemaxtabvars = 0;   /* current indice in the table tabvars             */
292   SubloopScalar = 0;
293   todebug = 0;
294   todebugfree = 0;
295   retour77 = 1 ;
296   mark = 0 ;
297   shouldincludempif = 0 ;
298   Read_val_max();
299/******************************************************************************/
300/*  2-  Program arguments                                                     */
301/******************************************************************************/
302
303   if ((yyin=fopen(argv[1],"r"))==NULL)
304   {
305      printf("the file %s doesn't exist \n",argv[1]);
306      exit(0);
307   }
308
309   i=2;
310   while (i<argc)
311   {
312      if (!strcasecmp(argv[i],"-incdir"))
313      {
314         strcpy(nomdir,argv[i+1]);
315         i++;
316      }
317      else if (!strcasecmp(argv[i],"-comdirin")) /* input directory           */
318      {
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++;
326      }
327      else if (!strcasecmp(argv[i],"-convfile")) /* file to parse             */
328      {
329         strcpy(filetoparse,argv[i+1]);
330         i++;
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         }
342      }
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      }         
355      else if (!strcasecmp(argv[i],"-SubloopScalar")) /* file to parse        */
356      {
357         SubloopScalar = 1 ;
358      }
359      else if (!strcasecmp(argv[i],"-SubloopScalar1")) /* file to parse       */
360      {
361         SubloopScalar = 2 ;
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      {
377         checkexistcommon=0;
378      }
379      else
380      {
381         printf("Unkwon option : %s\n",argv[i]);
382         exit(0);
383      }
384      i++;
385   }
386
387   if (stylegiven == 1) 
388   {
389   infree = infreegiven;
390   infixed = infixedgiven;   
391   }
392   Save_Length(nomdir,34);
393   Save_Length(commondirout,35);
394   Save_Length(commondirin,36);
395   Save_Length(filetoparse,37);
396
397/******************************************************************************/
398/*  3-  Parsing of the  conv file <name>.in                                   */
399/******************************************************************************/
400
401   if ((yyin=fopen(argv[1],"r"))==NULL)
402   {
403       printf("the file %s doesn't exist \n",argv[1]);
404       exit(0);
405   }
406   strcpy(mainfile,argv[1]);
407   Save_Length(mainfile,33);
408
409   if ( strstr(filetoparse,".f90") ||
410        strstr(filetoparse,".F90") ) retour77 = 0;
411
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);
420      exit(0);
421   }
422   /* mainfile : the name of the file to parse                                */
423   strcpy(mainfile,filetoparse);
424   /*                                                                         */
425   if ((dependglobaloutput=fopen(".dependglobal_agrif","r"))!=NULL)
426   {
427      fscanf(dependglobaloutput,"%d\n",&indicemaxtabvars);
428      fclose(dependglobaloutput);
429   }
430   Readthedependavailablefile();
431   /* Read the .dependnbxnby file which contains indices of nbmaillsX,        */
432   /*    nbmailleY and nbmailleZ                                              */
433   Readthedependnbxnbyfile();
434   Read_Subroutine_For_Alloc();
435/******************************************************************************/
436/*  5-  Parsing of the input file (2 times)                                   */
437/******************************************************************************/
438   /* Record all variable in list                                             */
439   firstpass = 1;
440   processfortran(filetoparse);
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();
451   /*                                                                         */
452   Clean_List_Global_Var();
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);
481
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   }
495/******************************************************************************/
496/*  6-  Write informations in output files                                    */
497/******************************************************************************/
498
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 )
513   {
514      Writethedependlistofmoduleused(parcours->o_nom);
515      WritedependParameterList(parcours->o_nom);
516      Writethedependfile(parcours->o_nom,List_Global_Var);
517      parcours=parcours->suiv;
518   }
519   parcours = List_NameOfCommon;
520   while( parcours )
521   {
522      Writethedependfile(parcours->o_nom,List_Common_Var);
523      parcours=parcours->suiv;
524   }
525   Write_Subroutine_For_Alloc();
526/******************************************************************************/
527/*  7-  Create files in AGRIF_INC directory                                   */
528/******************************************************************************/
529   creefichieramr(NameTamponfile);
530
531   Write_val_max();
532
533   if ( todebug == 1 ) printf("Out of CONV \n");
534   return 0;
535}
536#line 537 "y.tab.c"
537#define YYABORT goto yyabort
538#define YYREJECT goto yyabort
539#define YYACCEPT goto yyaccept
540#define YYERROR goto yyerrlab
541int
542yyparse()
543{
544    register int yym, yyn, yystate;
545#if YYDEBUG
546    register char *yys;
547    extern char *getenv();
548
549    if (yys = getenv("YYDEBUG"))
550    {
551        yyn = *yys;
552        if (yyn >= '0' && yyn <= '9')
553            yydebug = yyn - '0';
554    }
555#endif
556
557    yynerrs = 0;
558    yyerrflag = 0;
559    yychar = (-1);
560
561    yyssp = yyss;
562    yyvsp = yyvs;
563    *yyssp = yystate = 0;
564
565yyloop:
566    if (yyn = yydefred[yystate]) goto yyreduce;
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
589        if (yyssp >= yyss + yystacksize - 1)
590        {
591            goto yyoverflow;
592        }
593        *++yyssp = yystate = yytable[yyn];
594        *++yyvsp = yylval;
595        yychar = (-1);
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;
606#ifdef lint
607    goto yynewerror;
608#endif
609yynewerror:
610    yyerror("syntax error");
611#ifdef lint
612    goto yyerrlab;
613#endif
614yyerrlab:
615    ++yynerrs;
616yyinrecovery:
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
630                if (yyssp >= yyss + yystacksize - 1)
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
664        yychar = (-1);
665        goto yyloop;
666    }
667yyreduce:
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    {
677case 4:
678#line 67 "convert.y"
679{initdimprob(1,yyvsp[-1].na,"0","0");}
680break;
681case 5:
682#line 68 "convert.y"
683{initdimprob(2,yyvsp[-3].na, yyvsp[-1].na,"0");}
684break;
685case 6:
686#line 70 "convert.y"
687{initdimprob(3,yyvsp[-5].na, yyvsp[-3].na, yyvsp[-1].na);}
688break;
689case 7:
690#line 72 "convert.y"
691{listofmodules = Addtolistnom(yyvsp[-1].na,listofmodules,0);
692                                                        Addmoduletothelist(yyvsp[-1].na);}
693break;
694case 8:
695#line 74 "convert.y"
696{Add_NotGridDepend_Var_1(yyvsp[-1].na);}
697break;
698case 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                                 }
706break;
707#line 708 "y.tab.c"
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 \
748to state %d\n", YYPREFIX, *yyssp, yystate);
749#endif
750    if (yyssp >= yyss + yystacksize - 1)
751    {
752        goto yyoverflow;
753    }
754    *++yyssp = yystate;
755    *++yyvsp = yyval;
756    goto yyloop;
757yyoverflow:
758    yyerror("yacc stack overflow");
759yyabort:
760    return (1);
761yyaccept:
762    return (0);
763}
764#line 2 "convert.yy.c"
765/* A lexical scanner generated by flex */
766
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 */
770
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
778/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
779#ifdef c_plusplus
780#ifndef __cplusplus
781#define __cplusplus
782#endif
783#endif
784
785
786#ifdef __cplusplus
787
788#include <stdlib.h>
789#include <unistd.h>
790
791/* Use prototypes in function declarations. */
792#define YY_USE_PROTOS
793
794/* The "const" storage-class-modifier is valid. */
795#define YY_USE_CONST
796
797#else /* ! __cplusplus */
798
799#if __STDC__
800
801#define YY_USE_PROTOS
802#define YY_USE_CONST
803
804#endif   /* __STDC__ */
805#endif   /* ! __cplusplus */
806
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
816#ifdef YY_USE_CONST
817#define yyconst const
818#else
819#define yyconst
820#endif
821
822
823#ifdef YY_USE_PROTOS
824#define YY_PROTO(proto) proto
825#else
826#define YY_PROTO(proto) ()
827#endif
828
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 */
843#define BEGIN yy_start = 1 + 2 *
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 */
849#define YY_START ((yy_start - 1) / 2)
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". */
856#define YY_NEW_FILE yyrestart( yyin )
857
858#define YY_END_OF_BUFFER_CHAR 0
859
860/* Size of default input buffer. */
861#define YY_BUF_SIZE 16384
862
863typedef struct yy_buffer_state *YY_BUFFER_STATE;
864
865extern int yyleng;
866extern 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
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
888#define yyless(n) \
889   do \
890      { \
891      /* Undo effects of setting up yytext. */ \
892      *yy_cp = yy_hold_char; \
893      YY_RESTORE_YY_MORE_OFFSET \
894      yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
895      YY_DO_BEFORE_ACTION; /* set up yytext again */ \
896      } \
897   while ( 0 )
898
899#define unput(c) yyunput( c, yytext_ptr )
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 */
905typedef unsigned int yy_size_t;
906
907
908struct 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
965static YY_BUFFER_STATE yy_current_buffer = 0;
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 */
971#define YY_CURRENT_BUFFER yy_current_buffer
972
973
974/* yy_hold_char holds the character lost when yytext is formed. */
975static char yy_hold_char;
976
977static int yy_n_chars;     /* number of characters read into yy_ch_buf */
978
979
980int yyleng;
981
982/* Points to current character in buffer. */
983static char *yy_c_buf_p = (char *) 0;
984static int yy_init = 1;    /* whether we need to initialize */
985static 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 */
990static int yy_did_buffer_switch_on_eof;
991
992void yyrestart YY_PROTO(( FILE *input_file ));
993
994void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
995void yy_load_buffer_state YY_PROTO(( void ));
996YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
997void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
998void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
999void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
1000#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
1001
1002YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
1003YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
1004YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
1005
1006static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
1007static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
1008static void yy_flex_free YY_PROTO(( void * ));
1009
1010#define yy_new_buffer yy_create_buffer
1011
1012#define yy_set_interactive(is_interactive) \
1013   { \
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; \
1017   }
1018
1019#define yy_set_bol(at_bol) \
1020   { \
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; \
1024   }
1025
1026#define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
1027
1028typedef unsigned char YY_CHAR;
1029FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
1030typedef int yy_state_type;
1031extern char *yytext;
1032#define yytext_ptr yytext
1033
1034static yy_state_type yy_get_previous_state YY_PROTO(( void ));
1035static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
1036static int yy_get_next_buffer YY_PROTO(( void ));
1037static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
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 \
1043   yytext_ptr = yy_bp; \
1044   yyleng = (int) (yy_cp - yy_bp); \
1045   yy_hold_char = *yy_cp; \
1046   *yy_cp = '\0'; \
1047   yy_c_buf_p = yy_cp;
1048
1049#define YY_NUM_RULES 12
1050#define YY_END_OF_BUFFER 13
1051static yyconst short int yy_accept[74] =
1052    {   0,
1053        0,    0,    0,    0,   13,   12,   11,   10,   12,    9,
1054       12,   12,   12,    9,    8,    8,    8,    8,    8,    8,
1055       11,    0,    4,    7,    5,    8,    8,    8,    8,    8,
1056        8,    8,    6,    8,    8,    8,    8,    3,    8,    8,
1057        8,    8,    8,    8,    8,    8,    8,    8,    8,    8,
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
1061    } ;
1062
1063static yyconst int yy_ec[256] =
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,
1069        6,    1,    1,    7,    1,    1,    1,    8,    9,   10,
1070       11,    8,    8,    8,   12,    8,    8,   13,   14,    1,
1071        1,    1,    1,    1,   18,   19,   19,   20,   21,   22,
1072       23,   19,   24,   19,   19,   25,   26,   27,   28,   29,
1073       19,   30,   31,   32,   33,   19,   19,   34,   35,   19,
1074       15,    1,   16,    1,   17,    1,   18,   19,   19,   20,
1075
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,
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
1095static yyconst int yy_meta[36] =
1096    {   0,
1097        1,    1,    2,    1,    1,    1,    1,    3,    3,    3,
1098        3,    3,    1,    1,    1,    1,    3,    3,    3,    3,
1099        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
1100        3,    3,    3,    3,    3
1101    } ;
1102
1103static yyconst short int yy_base[76] =
1104    {   0,
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
1113    } ;
1114
1115static yyconst short int yy_def[76] =
1116    {   0,
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
1125    } ;
1126
1127static yyconst short int yy_nxt[133] =
1128    {   0,
1129        6,    7,    8,    9,   10,   10,   10,    6,   11,   12,
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,
1139
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
1144    } ;
1145
1146static yyconst short int yy_chk[133] =
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,
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,
1158
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
1163    } ;
1164
1165static yy_state_type yy_last_accepting_state;
1166static 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
1175char *yytext;
1176#line 1 "convert.lex"
1177#define INITIAL 0
1178/******************************************************************************/
1179/*                                                                            */
1180/*     CONV (converter) for Agrif (Adaptive Grid Refinement In Fortran)       */
1181/*                                                                            */
1182/* Copyright or   or Copr. Laurent Debreu (Laurent.Debreu@imag.fr)            */
1183/*                        Cyril Mazauric (Cyril_Mazauric@yahoo.fr)            */
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".                                                  */
1189/*                                                                            */
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.                                                                 */
1195/*                                                                            */
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.                                       */
1206/*                                                                            */
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.           */
1209/******************************************************************************/
1210/* version 1.7                                                                */
1211/******************************************************************************/
1212#define character 1
1213
1214#line 37 "convert.lex"
1215#include <math.h>
1216#include <stdlib.h>
1217#include <string.h>
1218int line_num=1;
1219extern FILE * yyin;
1220#define MAX_INCLUDE_DEPTH 30
1221YY_BUFFER_STATE include_stack[MAX_INCLUDE_DEPTH];
1222#line 460 "convert.yy.c"
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
1230extern "C" int yywrap YY_PROTO(( void ));
1231#else
1232extern int yywrap YY_PROTO(( void ));
1233#endif
1234#endif
1235
1236#ifndef YY_NO_UNPUT
1237static void yyunput YY_PROTO(( int c, char *buf_ptr ));
1238#endif
1239
1240#ifndef yytext_ptr
1241static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
1242#endif
1243
1244#ifdef YY_NEED_STRLEN
1245static int yy_flex_strlen YY_PROTO(( yyconst char * ));
1246#endif
1247
1248#ifndef YY_NO_INPUT
1249#ifdef __cplusplus
1250static int yyinput YY_PROTO(( void ));
1251#else
1252static int input YY_PROTO(( void ));
1253#endif
1254#endif
1255
1256#if YY_STACK_USED
1257static int yy_start_stack_ptr = 0;
1258static int yy_start_stack_depth = 0;
1259static int *yy_start_stack = 0;
1260#ifndef YY_NO_PUSH_STATE
1261static void yy_push_state YY_PROTO(( int new_state ));
1262#endif
1263#ifndef YY_NO_POP_STATE
1264static void yy_pop_state YY_PROTO(( void ));
1265#endif
1266#ifndef YY_NO_TOP_STATE
1267static int yy_top_state YY_PROTO(( void ));
1268#endif
1269
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
1277YY_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
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. */
1297
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) \
1310   if ( yy_current_buffer->yy_is_interactive ) \
1311      { \
1312      int c = '*', n; \
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      } \
1322   else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
1323        && ferror( yyin ) ) \
1324      YY_FATAL_ERROR( "input in flex scanner failed" );
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#define YY_DECL int yylex YY_PROTO(( void ))
1350#endif
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
1367YY_DECL
1368   {
1369   register yy_state_type yy_current_state;
1370   register char *yy_cp, *yy_bp;
1371   register int yy_act;
1372
1373#line 55 "convert.lex"
1374
1375#line 613 "convert.yy.c"
1376
1377   if ( yy_init )
1378      {
1379      yy_init = 0;
1380
1381#ifdef YY_USER_INIT
1382      YY_USER_INIT;
1383#endif
1384
1385      if ( ! yy_start )
1386         yy_start = 1;  /* first start state */
1387
1388      if ( ! yyin )
1389         yyin = stdin;
1390
1391      if ( ! yyout )
1392         yyout = stdout;
1393
1394      if ( ! yy_current_buffer )
1395         yy_current_buffer =
1396            yy_create_buffer( yyin, YY_BUF_SIZE );
1397
1398      yy_load_buffer_state();
1399      }
1400
1401   while ( 1 )    /* loops until end-of-file is reached */
1402      {
1403      yy_cp = yy_c_buf_p;
1404
1405      /* Support of yytext. */
1406      *yy_cp = yy_hold_char;
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
1413      yy_current_state = yy_start;
1414yy_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            {
1420            yy_last_accepting_state = yy_current_state;
1421            yy_last_accepting_cpos = yy_cp;
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];
1426            if ( yy_current_state >= 74 )
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         }
1432      while ( yy_base[yy_current_state] != 97 );
1433
1434yy_find_action:
1435      yy_act = yy_accept[yy_current_state];
1436      if ( yy_act == 0 )
1437         { /* have to back up */
1438         yy_cp = yy_last_accepting_cpos;
1439         yy_current_state = yy_last_accepting_state;
1440         yy_act = yy_accept[yy_current_state];
1441         }
1442
1443      YY_DO_BEFORE_ACTION;
1444
1445
1446do_action:  /* This label is used only to access EOF actions. */
1447
1448
1449      switch ( yy_act )
1450   { /* beginning of action switch */
1451         case 0: /* must back up */
1452         /* undo the effects of YY_DO_BEFORE_ACTION */
1453         *yy_cp = yy_hold_char;
1454         yy_cp = yy_last_accepting_cpos;
1455         yy_current_state = yy_last_accepting_state;
1456         goto yy_find_action;
1457
1458case 1:
1459YY_RULE_SETUP
1460#line 56 "convert.lex"
1461return TOK_MODULEMAIN; /* name of the module                      */
1462   YY_BREAK
1463case 2:
1464YY_RULE_SETUP
1465#line 57 "convert.lex"
1466return TOK_NOTGRIDDEP; /* variable which are not grid dependent   */
1467   YY_BREAK
1468case 3:
1469YY_RULE_SETUP
1470#line 58 "convert.lex"
1471return TOK_USE;
1472   YY_BREAK
1473case 4:
1474YY_RULE_SETUP
1475#line 59 "convert.lex"
1476{}
1477   YY_BREAK
1478case 5:
1479YY_RULE_SETUP
1480#line 60 "convert.lex"
1481return TOK_SEP;
1482   YY_BREAK
1483case 6:
1484YY_RULE_SETUP
1485#line 61 "convert.lex"
1486{strcpy(yylval.na,yytext); return TOK_USEITEM;}
1487   YY_BREAK
1488case 7:
1489YY_RULE_SETUP
1490#line 62 "convert.lex"
1491{strcpy(yylval.na,yytext); return TOK_PROBTYPE;}
1492   YY_BREAK
1493/* dimension of the problem                */
1494case 8:
1495YY_RULE_SETUP
1496#line 64 "convert.lex"
1497{strcpy(yylval.na,yytext); return TOK_NAME;}
1498   YY_BREAK
1499case 9:
1500YY_RULE_SETUP
1501#line 65 "convert.lex"
1502{return (int) *yytext;}
1503   YY_BREAK
1504case 10:
1505YY_RULE_SETUP
1506#line 66 "convert.lex"
1507{line_num++;return (int) *yytext;}
1508   YY_BREAK
1509case 11:
1510YY_RULE_SETUP
1511#line 67 "convert.lex"
1512;
1513   YY_BREAK
1514case 12:
1515YY_RULE_SETUP
1516#line 68 "convert.lex"
1517ECHO;
1518   YY_BREAK
1519#line 757 "convert.yy.c"
1520case YY_STATE_EOF(INITIAL):
1521case YY_STATE_EOF(character):
1522   yyterminate();
1523
1524   case YY_END_OF_BUFFER:
1525      {
1526      /* Amount of text matched not including the EOB char. */
1527      int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
1528
1529      /* Undo the effects of YY_DO_BEFORE_ACTION. */
1530      *yy_cp = yy_hold_char;
1531      YY_RESTORE_YY_MORE_OFFSET
1532
1533      if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
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
1539          * consistency between yy_current_buffer and our
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          */
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;
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       */
1556      if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1557         { /* This was really a NUL. */
1558         yy_state_type yy_next_state;
1559
1560         yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
1561
1562         yy_current_state = yy_get_previous_state();
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
1575         yy_bp = yytext_ptr + YY_MORE_ADJ;
1576
1577         if ( yy_next_state )
1578            {
1579            /* Consume the NUL. */
1580            yy_cp = ++yy_c_buf_p;
1581            yy_current_state = yy_next_state;
1582            goto yy_match;
1583            }
1584
1585         else
1586            {
1587            yy_cp = yy_c_buf_p;
1588            goto yy_find_action;
1589            }
1590         }
1591
1592      else switch ( yy_get_next_buffer() )
1593         {
1594         case EOB_ACT_END_OF_FILE:
1595            {
1596            yy_did_buffer_switch_on_eof = 0;
1597
1598            if ( yywrap() )
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                */
1609               yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
1610
1611               yy_act = YY_STATE_EOF(YY_START);
1612               goto do_action;
1613               }
1614
1615            else
1616               {
1617               if ( ! yy_did_buffer_switch_on_eof )
1618                  YY_NEW_FILE;
1619               }
1620            break;
1621            }
1622
1623         case EOB_ACT_CONTINUE_SCAN:
1624            yy_c_buf_p =
1625               yytext_ptr + yy_amount_of_matched_text;
1626
1627            yy_current_state = yy_get_previous_state();
1628
1629            yy_cp = yy_c_buf_p;
1630            yy_bp = yytext_ptr + YY_MORE_ADJ;
1631            goto yy_match;
1632
1633         case EOB_ACT_LAST_MATCH:
1634            yy_c_buf_p =
1635            &yy_current_buffer->yy_ch_buf[yy_n_chars];
1636
1637            yy_current_state = yy_get_previous_state();
1638
1639            yy_cp = yy_c_buf_p;
1640            yy_bp = yytext_ptr + YY_MORE_ADJ;
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 */
1651   } /* end of yylex */
1652
1653
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 */
1661
1662static int yy_get_next_buffer()
1663   {
1664   register char *dest = yy_current_buffer->yy_ch_buf;
1665   register char *source = yytext_ptr;
1666   register int number_to_move, i;
1667   int ret_val;
1668
1669   if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
1670      YY_FATAL_ERROR(
1671      "fatal flex scanner internal error--end of buffer missed" );
1672
1673   if ( yy_current_buffer->yy_fill_buffer == 0 )
1674      { /* Don't try to fill the buffer, so this is an EOF. */
1675      if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
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. */
1695   number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
1696
1697   for ( i = 0; i < number_to_move; ++i )
1698      *(dest++) = *(source++);
1699
1700   if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1701      /* don't do the read, it's not guaranteed to return an EOF,
1702       * just force an EOF
1703       */
1704      yy_current_buffer->yy_n_chars = yy_n_chars = 0;
1705
1706   else
1707      {
1708      int num_to_read =
1709         yy_current_buffer->yy_buf_size - number_to_move - 1;
1710
1711      while ( num_to_read <= 0 )
1712         { /* Not enough room in the buffer - grow it. */
1713#ifdef YY_USES_REJECT
1714         YY_FATAL_ERROR(
1715"input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
1716#else
1717
1718         /* just a shorter name for the current buffer */
1719         YY_BUFFER_STATE b = yy_current_buffer;
1720
1721         int yy_c_buf_p_offset =
1722            (int) (yy_c_buf_p - b->yy_ch_buf);
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. */
1735               yy_flex_realloc( (void *) b->yy_ch_buf,
1736                      b->yy_buf_size + 2 );
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
1746         yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1747
1748         num_to_read = yy_current_buffer->yy_buf_size -
1749                  number_to_move - 1;
1750#endif
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. */
1757      YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
1758         yy_n_chars, num_to_read );
1759
1760      yy_current_buffer->yy_n_chars = yy_n_chars;
1761      }
1762
1763   if ( yy_n_chars == 0 )
1764      {
1765      if ( number_to_move == YY_MORE_ADJ )
1766         {
1767         ret_val = EOB_ACT_END_OF_FILE;
1768         yyrestart( yyin );
1769         }
1770
1771      else
1772         {
1773         ret_val = EOB_ACT_LAST_MATCH;
1774         yy_current_buffer->yy_buffer_status =
1775            YY_BUFFER_EOF_PENDING;
1776         }
1777      }
1778
1779   else
1780      ret_val = EOB_ACT_CONTINUE_SCAN;
1781
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;
1785
1786   yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
1787
1788   return ret_val;
1789   }
1790
1791
1792/* yy_get_previous_state - get the state just before the EOB char was reached */
1793
1794static yy_state_type yy_get_previous_state()
1795   {
1796   register yy_state_type yy_current_state;
1797   register char *yy_cp;
1798
1799   yy_current_state = yy_start;
1800
1801   for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
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         {
1806         yy_last_accepting_state = yy_current_state;
1807         yy_last_accepting_cpos = yy_cp;
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];
1812         if ( yy_current_state >= 74 )
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;
1819   }
1820
1821
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 */
1827
1828#ifdef YY_USE_PROTOS
1829static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
1830#else
1831static yy_state_type yy_try_NUL_trans( yy_current_state )
1832yy_state_type yy_current_state;
1833#endif
1834   {
1835   register int yy_is_jam;
1836   register char *yy_cp = yy_c_buf_p;
1837
1838   register YY_CHAR yy_c = 1;
1839   if ( yy_accept[yy_current_state] )
1840      {
1841      yy_last_accepting_state = yy_current_state;
1842      yy_last_accepting_cpos = yy_cp;
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];
1847      if ( yy_current_state >= 74 )
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];
1851   yy_is_jam = (yy_current_state == 73);
1852
1853   return yy_is_jam ? 0 : yy_current_state;
1854   }
1855
1856
1857#ifndef YY_NO_UNPUT
1858#ifdef YY_USE_PROTOS
1859static void yyunput( int c, register char *yy_bp )
1860#else
1861static void yyunput( c, yy_bp )
1862int c;
1863register char *yy_bp;
1864#endif
1865   {
1866   register char *yy_cp = yy_c_buf_p;
1867
1868   /* undo effects of setting up yytext */
1869   *yy_cp = yy_hold_char;
1870
1871   if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1872      { /* need to shift things up to make room */
1873      /* +2 for EOB chars. */
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];
1877      register char *source =
1878            &yy_current_buffer->yy_ch_buf[number_to_move];
1879
1880      while ( source > yy_current_buffer->yy_ch_buf )
1881         *--dest = *--source;
1882
1883      yy_cp += (int) (dest - source);
1884      yy_bp += (int) (dest - source);
1885      yy_current_buffer->yy_n_chars =
1886         yy_n_chars = yy_current_buffer->yy_buf_size;
1887
1888      if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1889         YY_FATAL_ERROR( "flex scanner push-back overflow" );
1890      }
1891
1892   *--yy_cp = (char) c;
1893
1894
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
1902#ifdef __cplusplus
1903static int yyinput()
1904#else
1905static int input()
1906#endif
1907   {
1908   int c;
1909
1910   *yy_c_buf_p = yy_hold_char;
1911
1912   if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
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       */
1918      if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1919         /* This was really a NUL. */
1920         *yy_c_buf_p = '\0';
1921
1922      else
1923         { /* need more input */
1924         int offset = yy_c_buf_p - yytext_ptr;
1925         ++yy_c_buf_p;
1926
1927         switch ( yy_get_next_buffer() )
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. */
1941               yyrestart( yyin );
1942
1943               /* fall through */
1944
1945            case EOB_ACT_END_OF_FILE:
1946               {
1947               if ( yywrap() )
1948                  return EOF;
1949
1950               if ( ! yy_did_buffer_switch_on_eof )
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:
1960               yy_c_buf_p = yytext_ptr + offset;
1961               break;
1962            }
1963         }
1964      }
1965
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;
1969
1970
1971   return c;
1972   }
1973
1974
1975#ifdef YY_USE_PROTOS
1976void yyrestart( FILE *input_file )
1977#else
1978void yyrestart( input_file )
1979FILE *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();
1987   }
1988
1989
1990#ifdef YY_USE_PROTOS
1991void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
1992#else
1993void yy_switch_to_buffer( new_buffer )
1994YY_BUFFER_STATE new_buffer;
1995#endif
1996   {
1997   if ( yy_current_buffer == new_buffer )
1998      return;
1999
2000   if ( yy_current_buffer )
2001      {
2002      /* Flush out information for old buffer. */
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;
2006      }
2007
2008   yy_current_buffer = new_buffer;
2009   yy_load_buffer_state();
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    */
2016   yy_did_buffer_switch_on_eof = 1;
2017   }
2018
2019
2020#ifdef YY_USE_PROTOS
2021void yy_load_buffer_state( void )
2022#else
2023void 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
2034YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
2035#else
2036YY_BUFFER_STATE yy_create_buffer( file, size )
2037FILE *file;
2038int size;
2039#endif
2040   {
2041   YY_BUFFER_STATE b;
2042
2043   b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
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    */
2052   b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
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
2058   yy_init_buffer( b, file );
2059
2060   return b;
2061   }
2062
2063
2064#ifdef YY_USE_PROTOS
2065void yy_delete_buffer( YY_BUFFER_STATE b )
2066#else
2067void yy_delete_buffer( b )
2068YY_BUFFER_STATE b;
2069#endif
2070   {
2071   if ( ! b )
2072      return;
2073
2074   if ( b == yy_current_buffer )
2075      yy_current_buffer = (YY_BUFFER_STATE) 0;
2076
2077   if ( b->yy_is_our_buffer )
2078      yy_flex_free( (void *) b->yy_ch_buf );
2079
2080   yy_flex_free( (void *) b );
2081   }
2082
2083
2084#ifndef YY_ALWAYS_INTERACTIVE
2085#ifndef YY_NEVER_INTERACTIVE
2086extern int isatty YY_PROTO(( int ));
2087#endif
2088#endif
2089
2090#ifdef YY_USE_PROTOS
2091void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
2092#else
2093void yy_init_buffer( b, file )
2094YY_BUFFER_STATE b;
2095FILE *file;
2096#endif
2097
2098
2099   {
2100   yy_flush_buffer( b );
2101
2102   b->yy_input_file = file;
2103   b->yy_fill_buffer = 1;
2104
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   }
2115
2116
2117#ifdef YY_USE_PROTOS
2118void yy_flush_buffer( YY_BUFFER_STATE b )
2119#else
2120void yy_flush_buffer( b )
2121YY_BUFFER_STATE b;
2122#endif
2123
2124   {
2125   if ( ! b )
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
2142   if ( b == yy_current_buffer )
2143      yy_load_buffer_state();
2144   }
2145
2146
2147#ifndef YY_NO_SCAN_BUFFER
2148#ifdef YY_USE_PROTOS
2149YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
2150#else
2151YY_BUFFER_STATE yy_scan_buffer( base, size )
2152char *base;
2153yy_size_t size;
2154#endif
2155   {
2156   YY_BUFFER_STATE b;
2157
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
2164   b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
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
2178   yy_switch_to_buffer( b );
2179
2180   return b;
2181   }
2182#endif
2183
2184
2185#ifndef YY_NO_SCAN_STRING
2186#ifdef YY_USE_PROTOS
2187YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
2188#else
2189YY_BUFFER_STATE yy_scan_string( yy_str )
2190yyconst 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
2204YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
2205#else
2206YY_BUFFER_STATE yy_scan_bytes( bytes, len )
2207yyconst char *bytes;
2208int len;
2209#endif
2210   {
2211   YY_BUFFER_STATE b;
2212   char *buf;
2213   yy_size_t n;
2214   int i;
2215
2216   /* Get memory for full buffer, including space for trailing EOB's. */
2217   n = len + 2;
2218   buf = (char *) yy_flex_alloc( n );
2219   if ( ! buf )
2220      YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
2221
2222   for ( i = 0; i < len; ++i )
2223      buf[i] = bytes[i];
2224
2225   buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
2226
2227   b = yy_scan_buffer( buf, n );
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;
2237   }
2238#endif
2239
2240
2241#ifndef YY_NO_PUSH_STATE
2242#ifdef YY_USE_PROTOS
2243static void yy_push_state( int new_state )
2244#else
2245static void yy_push_state( new_state )
2246int new_state;
2247#endif
2248   {
2249   if ( yy_start_stack_ptr >= yy_start_stack_depth )
2250      {
2251      yy_size_t new_size;
2252
2253      yy_start_stack_depth += YY_START_STACK_INCR;
2254      new_size = yy_start_stack_depth * sizeof( int );
2255
2256      if ( ! yy_start_stack )
2257         yy_start_stack = (int *) yy_flex_alloc( new_size );
2258
2259      else
2260         yy_start_stack = (int *) yy_flex_realloc(
2261               (void *) yy_start_stack, new_size );
2262
2263      if ( ! yy_start_stack )
2264         YY_FATAL_ERROR(
2265         "out of memory expanding start-condition stack" );
2266      }
2267
2268   yy_start_stack[yy_start_stack_ptr++] = YY_START;
2269
2270   BEGIN(new_state);
2271   }
2272#endif
2273
2274
2275#ifndef YY_NO_POP_STATE
2276static void yy_pop_state()
2277   {
2278   if ( --yy_start_stack_ptr < 0 )
2279      YY_FATAL_ERROR( "start-condition stack underflow" );
2280
2281   BEGIN(yy_start_stack[yy_start_stack_ptr]);
2282   }
2283#endif
2284
2285
2286#ifndef YY_NO_TOP_STATE
2287static int yy_top_state()
2288   {
2289   return yy_start_stack[yy_start_stack_ptr - 1];
2290   }
2291#endif
2292
2293#ifndef YY_EXIT_FAILURE
2294#define YY_EXIT_FAILURE 2
2295#endif
2296
2297#ifdef YY_USE_PROTOS
2298static void yy_fatal_error( yyconst char msg[] )
2299#else
2300static void yy_fatal_error( msg )
2301char msg[];
2302#endif
2303   {
2304   (void) fprintf( stderr, "%s\n", msg );
2305   exit( YY_EXIT_FAILURE );
2306   }
2307
2308
2309
2310/* Redefine yyless() so it works in section 3 code. */
2311
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 )
2324
2325
2326/* Internal utility routines. */
2327
2328#ifndef yytext_ptr
2329#ifdef YY_USE_PROTOS
2330static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
2331#else
2332static void yy_flex_strncpy( s1, s2, n )
2333char *s1;
2334yyconst char *s2;
2335int n;
2336#endif
2337   {
2338   register int i;
2339   for ( i = 0; i < n; ++i )
2340      s1[i] = s2[i];
2341   }
2342#endif
2343
2344#ifdef YY_NEED_STRLEN
2345#ifdef YY_USE_PROTOS
2346static int yy_flex_strlen( yyconst char *s )
2347#else
2348static int yy_flex_strlen( s )
2349yyconst char *s;
2350#endif
2351   {
2352   register int n;
2353   for ( n = 0; s[n]; ++n )
2354      ;
2355
2356   return n;
2357   }
2358#endif
2359
2360
2361#ifdef YY_USE_PROTOS
2362static void *yy_flex_alloc( yy_size_t size )
2363#else
2364static void *yy_flex_alloc( size )
2365yy_size_t size;
2366#endif
2367   {
2368   return (void *) malloc( size );
2369   }
2370
2371#ifdef YY_USE_PROTOS
2372static void *yy_flex_realloc( void *ptr, yy_size_t size )
2373#else
2374static void *yy_flex_realloc( ptr, size )
2375void *ptr;
2376yy_size_t size;
2377#endif
2378   {
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 );
2387   }
2388
2389#ifdef YY_USE_PROTOS
2390static void yy_flex_free( void *ptr )
2391#else
2392static void yy_flex_free( ptr )
2393void *ptr;
2394#endif
2395   {
2396   free( ptr );
2397   }
2398
2399#if YY_MAIN
2400int main()
2401   {
2402   yylex();
2403   return 0;
2404   }
2405#endif
2406#line 68 "convert.lex"
2407
2408
2409
2410int yywrap()
2411{
2412}
2413
2414
2415yyerror(char *s)
2416{
2417if (!strcasecmp(curfile,mainfile))
2418{
2419   printf("Dans convert %s line %d, fichier %s\n",s,line_num,curfile);
2420}
2421else
2422{
2423   printf("Dans convert %s line %d, fichier %s\n",s,line_num,curfile);
2424}
2425exit(0);
2426}
Note: See TracBrowser for help on using the repository browser.