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 trunk/AGRIF/LIB – NEMO

source: trunk/AGRIF/LIB/main.c @ 774

Last change on this file since 774 was 774, checked in by rblod, 16 years ago

Update Agrif, see ticket:#39

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