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.
Changeset 774 for trunk/AGRIF/LIB/main.c – NEMO

Changeset 774 for trunk/AGRIF/LIB/main.c


Ignore:
Timestamp:
2007-12-18T17:45:53+01:00 (16 years ago)
Author:
rblod
Message:

Update Agrif, see ticket:#39

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/AGRIF/LIB/main.c

    r663 r774  
    22static const char yysccsid[] = "@(#)yaccpar  1.9 (Berkeley) 02/21/93"; 
    33#endif 
     4 
     5#include <stdlib.h> 
     6 
    47#define YYBYACC 1 
    58#define YYMAJOR 1 
    69#define YYMINOR 9 
    7 #define yyclearin (yychar=(-1)) 
    8 #define yyerrok (yyerrflag=0) 
    9 #define YYRECOVERING (yyerrflag!=0) 
     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 
    1017extern int yyparse(void); 
     18 
     19static int yygrowstack(void); 
    1120#define YYPREFIX "yy" 
    1221#line 36 "convert.y" 
     
    1827typedef union { 
    1928       int ival; 
    20        char na[LONGNOM]; 
     29       char na[LONG_C]; 
    2130       listnom * ln; 
    2231       } YYSTYPE; 
    23 #line 24 "y.tab.c" 
     32#line 33 "y.tab.c" 
    2433#define TOK_SEP 257 
    2534#define TOK_USE 258 
     
    144153}; 
    145154#endif 
     155#if YYDEBUG 
     156#include <stdio.h> 
     157#endif 
     158 
     159/* define the initial stack-sizes */ 
    146160#ifdef YYSTACKSIZE 
    147161#undef YYMAXDEPTH 
    148 #define YYMAXDEPTH YYSTACKSIZE 
     162#define YYMAXDEPTH  YYSTACKSIZE 
    149163#else 
    150164#ifdef YYMAXDEPTH 
     
    152166#else 
    153167#define YYSTACKSIZE 500 
    154 #define YYMAXDEPTH 500 
    155 #endif 
    156 #endif 
    157 int yydebug; 
    158 int yynerrs; 
    159 int yyerrflag; 
    160 int yychar; 
    161 short *yyssp; 
     168#define YYMAXDEPTH  500 
     169#endif 
     170#endif 
     171 
     172#define YYINITSTACKSIZE 500 
     173 
     174int      yydebug; 
     175int      yynerrs; 
     176int      yyerrflag; 
     177int      yychar; 
     178short   *yyssp; 
    162179YYSTYPE *yyvsp; 
    163 YYSTYPE yyval; 
    164 YYSTYPE yylval; 
    165 short yyss[YYSTACKSIZE]; 
    166 YYSTYPE yyvs[YYSTACKSIZE]; 
    167 #define yystacksize YYSTACKSIZE 
     180YYSTYPE  yyval; 
     181YYSTYPE  yylval; 
     182 
     183/* variables for the parser stack */ 
     184static short   *yyss; 
     185static short   *yysslim; 
     186static YYSTYPE *yyvs; 
     187static int      yystacksize; 
    168188#line 83 "convert.y" 
    169189 
     
    172192   extern FILE * yyin ; 
    173193   FILE *dependglobaloutput; 
    174    char *tmp; 
    175194   int i; 
    176195   listnom *parcours; 
     
    219238   strcpy(mpiinitvar,""); 
    220239 
     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 
    221294   checkexistcommon=1; 
    222295   todebug=0; 
     
    235308   mark = 0 ; 
    236309   shouldincludempif = 0 ; 
     310   Read_val_max(); 
    237311/******************************************************************************/ 
    238312/*  2-  Program arguments                                                     */ 
     
    300374   } 
    301375 
     376   Save_Length(nomdir,34); 
     377   Save_Length(commondirout,35); 
     378   Save_Length(commondirin,36); 
     379   Save_Length(filetoparse,37); 
     380 
    302381/******************************************************************************/ 
    303382/*  3-  Parsing of the  conv file <name>.in                                   */ 
     
    310389   } 
    311390   strcpy(mainfile,argv[1]); 
     391   Save_Length(mainfile,33); 
    312392 
    313393   if ( strstr(filetoparse,".f90") || 
     
    353433   /* Update all lists                                                        */ 
    354434   ListUpdate(); 
     435   /*                                                                         */ 
     436   Clean_List_Global_Var(); 
    355437   /* Indice tabvars identification                                           */ 
    356438   IndiceTabvarsIdentification(); 
     
    382464   processfortran(filetoparse); 
    383465 
     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   } 
    384479/******************************************************************************/ 
    385480/*  6-  Write informations in output files                                    */ 
     
    418513   creefichieramr(NameTamponfile); 
    419514 
     515   Write_val_max(); 
    420516 
    421517   if ( todebug == 1 ) printf("Out of CONV \n"); 
    422518   return 0; 
    423519} 
    424 #line 425 "y.tab.c" 
     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 
    425557#define YYABORT goto yyabort 
    426558#define YYREJECT goto yyabort 
     
    432564    register int yym, yyn, yystate; 
    433565#if YYDEBUG 
    434     register char *yys; 
    435     extern char *getenv(); 
    436  
    437     if (yys = getenv("YYDEBUG")) 
     566    register const char *yys; 
     567 
     568    if ((yys = getenv("YYDEBUG")) != 0) 
    438569    { 
    439570        yyn = *yys; 
     
    445576    yynerrs = 0; 
    446577    yyerrflag = 0; 
    447     yychar = (-1); 
    448  
     578    yychar = YYEMPTY; 
     579 
     580    if (yyss == NULL && yygrowstack()) goto yyoverflow; 
    449581    yyssp = yyss; 
    450582    yyvsp = yyvs; 
     
    475607                    YYPREFIX, yystate, yytable[yyn]); 
    476608#endif 
    477         if (yyssp >= yyss + yystacksize - 1) 
     609        if (yyssp >= yysslim && yygrowstack()) 
    478610        { 
    479611            goto yyoverflow; 
     
    481613        *++yyssp = yystate = yytable[yyn]; 
    482614        *++yyvsp = yylval; 
    483         yychar = (-1); 
     615        yychar = YYEMPTY; 
    484616        if (yyerrflag > 0)  --yyerrflag; 
    485617        goto yyloop; 
     
    492624    } 
    493625    if (yyerrflag) goto yyinrecovery; 
    494 #ifdef lint 
    495     goto yynewerror; 
    496 #endif 
    497 yynewerror: 
     626 
    498627    yyerror("syntax error"); 
     628 
    499629#ifdef lint 
    500630    goto yyerrlab; 
    501631#endif 
     632 
    502633yyerrlab: 
    503634    ++yynerrs; 
     635 
    504636yyinrecovery: 
    505637    if (yyerrflag < 3) 
     
    516648 to state %d\n", YYPREFIX, *yyssp, yytable[yyn]); 
    517649#endif 
    518                 if (yyssp >= yyss + yystacksize - 1) 
     650                if (yyssp >= yysslim && yygrowstack()) 
    519651                { 
    520652                    goto yyoverflow; 
     
    550682        } 
    551683#endif 
    552         yychar = (-1); 
     684        yychar = YYEMPTY; 
    553685        goto yyloop; 
    554686    } 
     687 
    555688yyreduce: 
    556689#if YYDEBUG 
     
    593726                                 } 
    594727break; 
    595 #line 596 "y.tab.c" 
     728#line 729 "y.tab.c" 
    596729    } 
    597730    yyssp -= yym; 
     
    636769to state %d\n", YYPREFIX, *yyssp, yystate); 
    637770#endif 
    638     if (yyssp >= yyss + yystacksize - 1) 
     771    if (yyssp >= yysslim && yygrowstack()) 
    639772    { 
    640773        goto yyoverflow; 
     
    643776    *++yyvsp = yyval; 
    644777    goto yyloop; 
     778 
    645779yyoverflow: 
    646780    yyerror("yacc stack overflow"); 
     781 
    647782yyabort: 
    648783    return (1); 
     784 
    649785yyaccept: 
    650786    return (0); 
     
    654790 
    655791/* Scanner skeleton version: 
    656  * $Header$ 
     792 * $Header: /cvs/root/flex/flex/skel.c,v 1.2 2004/05/07 00:28:17 jkh Exp $ 
    657793 */ 
    658794 
     
    662798 
    663799#include <stdio.h> 
    664 #include <unistd.h> 
    665800 
    666801 
     
    676811 
    677812#include <stdlib.h> 
     813#include <unistd.h> 
    678814 
    679815/* Use prototypes in function declarations. */ 
     
    10961232/* knowledge of the CeCILL-C license and that you accept its terms.           */ 
    10971233/******************************************************************************/ 
    1098 /* version 1.6                                                                */ 
     1234/* version 1.7                                                                */ 
    10991235/******************************************************************************/ 
    11001236#define character 1 
     
    19702106 
    19712107 
     2108#ifndef YY_ALWAYS_INTERACTIVE 
     2109#ifndef YY_NEVER_INTERACTIVE 
     2110extern int isatty YY_PROTO(( int )); 
     2111#endif 
     2112#endif 
    19722113 
    19732114#ifdef YY_USE_PROTOS 
Note: See TracChangeset for help on using the changeset viewer.