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

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

source: branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/EXTERNAL/AGRIF/LIB/main.c @ 3289

Last change on this file since 3289 was 3289, checked in by rblod, 12 years ago

Fix agrif for 3_4_beta see ticket #921

  • Property svn:keywords set to Id
File size: 105.5 KB
Line 
1/* A Bison parser, made by GNU Bison 2.3.  */
2
3/* Skeleton implementation for Bison's Yacc-like parsers in C
4
5   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
6   Free Software Foundation, Inc.
7
8   This program is free software; you can redistribute it and/or modify
9   it under the terms of the GNU General Public License as published by
10   the Free Software Foundation; either version 2, or (at your option)
11   any later version.
12
13   This program is distributed in the hope that it will be useful,
14   but WITHOUT ANY WARRANTY; without even the implied warranty of
15   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16   GNU General Public License for more details.
17
18   You should have received a copy of the GNU General Public License
19   along with this program; if not, write to the Free Software
20   Foundation, Inc., 51 Franklin Street, Fifth Floor,
21   Boston, MA 02110-1301, USA.  */
22
23/* As a special exception, you may create a larger work that contains
24   part or all of the Bison parser skeleton and distribute that work
25   under terms of your choice, so long as that work isn't itself a
26   parser generator using the skeleton or a modified version thereof
27   as a parser skeleton.  Alternatively, if you modify or redistribute
28   the parser skeleton itself, you may (at your option) remove this
29   special exception, which will cause the skeleton and the resulting
30   Bison output files to be licensed under the GNU General Public
31   License without this special exception.
32
33   This special exception was added by the Free Software Foundation in
34   version 2.2 of Bison.  */
35
36/* C LALR(1) parser skeleton written by Richard Stallman, by
37   simplifying the original so-called "semantic" parser.  */
38
39/* All symbols defined below should begin with yy or YY, to avoid
40   infringing on user name space.  This should be done even for local
41   variables, as they might otherwise be expanded by user macros.
42   There are some unavoidable exceptions within include files to
43   define necessary library symbols; they are noted "INFRINGES ON
44   USER NAME SPACE" below.  */
45
46/* Identify Bison output.  */
47#define YYBISON 1
48
49/* Bison version.  */
50#define YYBISON_VERSION "2.3"
51
52/* Skeleton name.  */
53#define YYSKELETON_NAME "yacc.c"
54
55/* Pure parsers.  */
56#define YYPURE 0
57
58/* Using locations.  */
59#define YYLSP_NEEDED 0
60
61
62
63/* Tokens.  */
64#ifndef YYTOKENTYPE
65# define YYTOKENTYPE
66   /* Put the tokens into the symbol table, so that GDB and other debuggers
67      know about them.  */
68   enum yytokentype {
69     TOK_SEP = 258,
70     TOK_USE = 259,
71     TOK_MODULEMAIN = 260,
72     TOK_NOTGRIDDEP = 261,
73     TOK_USEITEM = 262,
74     TOK_NAME = 263,
75     TOK_PROBTYPE = 264
76   };
77#endif
78/* Tokens.  */
79#define TOK_SEP 258
80#define TOK_USE 259
81#define TOK_MODULEMAIN 260
82#define TOK_NOTGRIDDEP 261
83#define TOK_USEITEM 262
84#define TOK_NAME 263
85#define TOK_PROBTYPE 264
86
87
88
89
90/* Copy the first part of user declarations.  */
91#line 35 "convert.y"
92
93#include <stdlib.h>
94#include <stdio.h>
95#include <string.h>
96#include "decl.h"
97
98
99/* Enabling traces.  */
100#ifndef YYDEBUG
101# define YYDEBUG 0
102#endif
103
104/* Enabling verbose error messages.  */
105#ifdef YYERROR_VERBOSE
106# undef YYERROR_VERBOSE
107# define YYERROR_VERBOSE 1
108#else
109# define YYERROR_VERBOSE 0
110#endif
111
112/* Enabling the token table.  */
113#ifndef YYTOKEN_TABLE
114# define YYTOKEN_TABLE 0
115#endif
116
117#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
118typedef union YYSTYPE
119#line 42 "convert.y"
120{
121       int ival;
122       char na[LONG_C];
123       listnom * ln;
124       }
125/* Line 193 of yacc.c.  */
126#line 127 "convert.tab.c"
127   YYSTYPE;
128# define yystype YYSTYPE /* obsolescent; will be withdrawn */
129# define YYSTYPE_IS_DECLARED 1
130# define YYSTYPE_IS_TRIVIAL 1
131#endif
132
133
134
135/* Copy the second part of user declarations.  */
136
137
138/* Line 216 of yacc.c.  */
139#line 140 "convert.tab.c"
140
141#ifdef short
142# undef short
143#endif
144
145#ifdef YYTYPE_UINT8
146typedef YYTYPE_UINT8 yytype_uint8;
147#else
148typedef unsigned char yytype_uint8;
149#endif
150
151#ifdef YYTYPE_INT8
152typedef YYTYPE_INT8 yytype_int8;
153#elif (defined __STDC__ || defined __C99__FUNC__ \
154     || defined __cplusplus || defined _MSC_VER)
155typedef signed char yytype_int8;
156#else
157typedef short int yytype_int8;
158#endif
159
160#ifdef YYTYPE_UINT16
161typedef YYTYPE_UINT16 yytype_uint16;
162#else
163typedef unsigned short int yytype_uint16;
164#endif
165
166#ifdef YYTYPE_INT16
167typedef YYTYPE_INT16 yytype_int16;
168#else
169typedef short int yytype_int16;
170#endif
171
172#ifndef YYSIZE_T
173# ifdef __SIZE_TYPE__
174#  define YYSIZE_T __SIZE_TYPE__
175# elif defined size_t
176#  define YYSIZE_T size_t
177# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
178     || defined __cplusplus || defined _MSC_VER)
179#  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
180#  define YYSIZE_T size_t
181# else
182#  define YYSIZE_T unsigned int
183# endif
184#endif
185
186#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
187
188#ifndef YY_
189# if defined YYENABLE_NLS && YYENABLE_NLS
190#  if ENABLE_NLS
191#   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
192#   define YY_(msgid) dgettext ("bison-runtime", msgid)
193#  endif
194# endif
195# ifndef YY_
196#  define YY_(msgid) msgid
197# endif
198#endif
199
200/* Suppress unused-variable warnings by "using" E.  */
201#if ! defined lint || defined __GNUC__
202# define YYUSE(e) ((void) (e))
203#else
204# define YYUSE(e) /* empty */
205#endif
206
207/* Identity function, used to suppress warnings about constant conditions.  */
208#ifndef lint
209# define YYID(n) (n)
210#else
211#if (defined __STDC__ || defined __C99__FUNC__ \
212     || defined __cplusplus || defined _MSC_VER)
213static int
214YYID (int i)
215#else
216static int
217YYID (i)
218    int i;
219#endif
220{
221  return i;
222}
223#endif
224
225#if ! defined yyoverflow || YYERROR_VERBOSE
226
227/* The parser invokes alloca or malloc; define the necessary symbols.  */
228
229# ifdef YYSTACK_USE_ALLOCA
230#  if YYSTACK_USE_ALLOCA
231#   ifdef __GNUC__
232#    define YYSTACK_ALLOC __builtin_alloca
233#   elif defined __BUILTIN_VA_ARG_INCR
234#    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
235#   elif defined _AIX
236#    define YYSTACK_ALLOC __alloca
237#   elif defined _MSC_VER
238#    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
239#    define alloca _alloca
240#   else
241#    define YYSTACK_ALLOC alloca
242#    if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
243     || defined __cplusplus || defined _MSC_VER)
244#     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
245#     ifndef _STDLIB_H
246#      define _STDLIB_H 1
247#     endif
248#    endif
249#   endif
250#  endif
251# endif
252
253# ifdef YYSTACK_ALLOC
254   /* Pacify GCC's `empty if-body' warning.  */
255#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
256#  ifndef YYSTACK_ALLOC_MAXIMUM
257    /* The OS might guarantee only one guard page at the bottom of the stack,
258       and a page size can be as small as 4096 bytes.  So we cannot safely
259       invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
260       to allow for a few compiler-allocated temporary stack slots.  */
261#   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
262#  endif
263# else
264#  define YYSTACK_ALLOC YYMALLOC
265#  define YYSTACK_FREE YYFREE
266#  ifndef YYSTACK_ALLOC_MAXIMUM
267#   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
268#  endif
269#  if (defined __cplusplus && ! defined _STDLIB_H \
270       && ! ((defined YYMALLOC || defined malloc) \
271        && (defined YYFREE || defined free)))
272#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
273#   ifndef _STDLIB_H
274#    define _STDLIB_H 1
275#   endif
276#  endif
277#  ifndef YYMALLOC
278#   define YYMALLOC malloc
279#   if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
280     || defined __cplusplus || defined _MSC_VER)
281void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
282#   endif
283#  endif
284#  ifndef YYFREE
285#   define YYFREE free
286#   if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
287     || defined __cplusplus || defined _MSC_VER)
288void free (void *); /* INFRINGES ON USER NAME SPACE */
289#   endif
290#  endif
291# endif
292#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
293
294
295#if (! defined yyoverflow \
296     && (! defined __cplusplus \
297    || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
298
299/* A type that is properly aligned for any stack member.  */
300union yyalloc
301{
302  yytype_int16 yyss;
303  YYSTYPE yyvs;
304  };
305
306/* The size of the maximum gap between one aligned stack and the next.  */
307# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
308
309/* The size of an array large to enough to hold all stacks, each with
310   N elements.  */
311# define YYSTACK_BYTES(N) \
312     ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
313      + YYSTACK_GAP_MAXIMUM)
314
315/* Copy COUNT objects from FROM to TO.  The source and destination do
316   not overlap.  */
317# ifndef YYCOPY
318#  if defined __GNUC__ && 1 < __GNUC__
319#   define YYCOPY(To, From, Count) \
320      __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
321#  else
322#   define YYCOPY(To, From, Count)     \
323      do             \
324   {              \
325     YYSIZE_T yyi;            \
326     for (yyi = 0; yyi < (Count); yyi++)  \
327       (To)[yyi] = (From)[yyi];     \
328   }              \
329      while (YYID (0))
330#  endif
331# endif
332
333/* Relocate STACK from its old location to the new one.  The
334   local variables YYSIZE and YYSTACKSIZE give the old and new number of
335   elements in the stack, and YYPTR gives the new location of the
336   stack.  Advance YYPTR to a properly aligned location for the next
337   stack.  */
338# define YYSTACK_RELOCATE(Stack)             \
339    do                           \
340      {                          \
341   YYSIZE_T yynewbytes;                \
342   YYCOPY (&yyptr->Stack, Stack, yysize);          \
343   Stack = &yyptr->Stack;                 \
344   yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
345   yyptr += yynewbytes / sizeof (*yyptr);          \
346      }                          \
347    while (YYID (0))
348
349#endif
350
351/* YYFINAL -- State number of the termination state.  */
352#define YYFINAL  2
353/* YYLAST -- Last index in YYTABLE.  */
354#define YYLAST   23
355
356/* YYNTOKENS -- Number of terminals.  */
357#define YYNTOKENS  18
358/* YYNNTS -- Number of nonterminals.  */
359#define YYNNTS  3
360/* YYNRULES -- Number of rules.  */
361#define YYNRULES  10
362/* YYNRULES -- Number of states.  */
363#define YYNSTATES  24
364
365/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
366#define YYUNDEFTOK  2
367#define YYMAXUTOK   264
368
369#define YYTRANSLATE(YYX)                  \
370  ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
371
372/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
373static const yytype_uint8 yytranslate[] =
374{
375       0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
376      17,     2,     2,     2,     2,     2,     2,     2,     2,     2,
377       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
378       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
379      13,    14,     2,     2,    10,     2,     2,     2,     2,     2,
380       2,     2,     2,     2,     2,     2,     2,     2,    12,    11,
381       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
382       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
383       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
384       2,    15,     2,    16,     2,     2,     2,     2,     2,     2,
385       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
386       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
387       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
388       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
389       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
390       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
391       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
392       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
393       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
394       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
395       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
396       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
397       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
398       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
399       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
400       2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
401       5,     6,     7,     8,     9
402};
403
404#if YYDEBUG
405/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
406   YYRHS.  */
407static const yytype_uint8 yyprhs[] =
408{
409       0,     0,     3,     4,     7,     9,    13,    19,    27,    31,
410      36
411};
412
413/* YYRHS -- A `-1'-separated list of the rules' RHS.  */
414static const yytype_int8 yyrhs[] =
415{
416      19,     0,    -1,    -1,    19,    20,    -1,    17,    -1,     9,
417       8,    11,    -1,     9,     8,    10,     8,    11,    -1,     9,
418       8,    10,     8,    10,     8,    11,    -1,     5,     8,    11,
419      -1,     6,     3,     8,    11,    -1,     4,     7,    11,    -1
420};
421
422/* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
423static const yytype_uint8 yyrline[] =
424{
425       0,    63,    63,    64,    66,    67,    68,    69,    71,    74,
426      75
427};
428#endif
429
430#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
431/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
432   First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
433static const char *const yytname[] =
434{
435  "$end", "error", "$undefined", "TOK_SEP", "TOK_USE", "TOK_MODULEMAIN",
436  "TOK_NOTGRIDDEP", "TOK_USEITEM", "TOK_NAME", "TOK_PROBTYPE", "','",
437  "';'", "':'", "'('", "')'", "'['", "']'", "'\\n'", "$accept", "input",
438  "line", 0
439};
440#endif
441
442# ifdef YYPRINT
443/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
444   token YYLEX-NUM.  */
445static const yytype_uint16 yytoknum[] =
446{
447       0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
448      44,    59,    58,    40,    41,    91,    93,    10
449};
450# endif
451
452/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
453static const yytype_uint8 yyr1[] =
454{
455       0,    18,    19,    19,    20,    20,    20,    20,    20,    20,
456      20
457};
458
459/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
460static const yytype_uint8 yyr2[] =
461{
462       0,     2,     0,     2,     1,     3,     5,     7,     3,     4,
463       3
464};
465
466/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
467   STATE-NUM when YYTABLE doesn't specify something else to do.  Zero
468   means the default is an error.  */
469static const yytype_uint8 yydefact[] =
470{
471       2,     0,     1,     0,     0,     0,     0,     4,     3,     0,
472       0,     0,     0,    10,     8,     0,     0,     5,     9,     0,
473       0,     6,     0,     7
474};
475
476/* YYDEFGOTO[NTERM-NUM].  */
477static const yytype_int8 yydefgoto[] =
478{
479      -1,     1,     8
480};
481
482/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
483   STATE-NUM.  */
484#define YYPACT_NINF -10
485static const yytype_int8 yypact[] =
486{
487     -10,     0,   -10,    -4,     2,     8,     4,   -10,   -10,     3,
488       5,     7,    -9,   -10,   -10,     9,    10,   -10,   -10,    -3,
489      11,   -10,    12,   -10
490};
491
492/* YYPGOTO[NTERM-NUM].  */
493static const yytype_int8 yypgoto[] =
494{
495     -10,   -10,   -10
496};
497
498/* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
499   positive, shift that token.  If negative, reduce the rule which
500   number is the opposite.  If zero, do what YYDEFACT says.
501   If YYTABLE_NINF, syntax error.  */
502#define YYTABLE_NINF -1
503static const yytype_uint8 yytable[] =
504{
505       2,    16,    17,     9,     3,     4,     5,    20,    21,     6,
506      10,    11,    12,     0,    13,    15,    14,     7,    19,    22,
507      18,     0,     0,    23
508};
509
510static const yytype_int8 yycheck[] =
511{
512       0,    10,    11,     7,     4,     5,     6,    10,    11,     9,
513       8,     3,     8,    -1,    11,     8,    11,    17,     8,     8,
514      11,    -1,    -1,    11
515};
516
517/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
518   symbol of state STATE-NUM.  */
519static const yytype_uint8 yystos[] =
520{
521       0,    19,     0,     4,     5,     6,     9,    17,    20,     7,
522       8,     3,     8,    11,    11,     8,    10,    11,    11,     8,
523      10,    11,     8,    11
524};
525
526#define yyerrok      (yyerrstatus = 0)
527#define yyclearin (yychar = YYEMPTY)
528#define YYEMPTY      (-2)
529#define YYEOF     0
530
531#define YYACCEPT  goto yyacceptlab
532#define YYABORT      goto yyabortlab
533#define YYERROR      goto yyerrorlab
534
535
536/* Like YYERROR except do call yyerror.  This remains here temporarily
537   to ease the transition to the new meaning of YYERROR, for GCC.
538   Once GCC version 2 has supplanted version 1, this can go.  */
539
540#define YYFAIL    goto yyerrlab
541
542#define YYRECOVERING()  (!!yyerrstatus)
543
544#define YYBACKUP(Token, Value)               \
545do                      \
546  if (yychar == YYEMPTY && yylen == 1)          \
547    {                      \
548      yychar = (Token);                \
549      yylval = (Value);                \
550      yytoken = YYTRANSLATE (yychar);           \
551      YYPOPSTACK (1);                  \
552      goto yybackup;                \
553    }                      \
554  else                        \
555    {                      \
556      yyerror (YY_("syntax error: cannot back up")); \
557      YYERROR;                   \
558    }                      \
559while (YYID (0))
560
561
562#define YYTERROR  1
563#define YYERRCODE 256
564
565
566/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
567   If N is 0, then set CURRENT to the empty location which ends
568   the previous symbol: RHS[0] (always defined).  */
569
570#define YYRHSLOC(Rhs, K) ((Rhs)[K])
571#ifndef YYLLOC_DEFAULT
572# define YYLLOC_DEFAULT(Current, Rhs, N)           \
573    do                           \
574      if (YYID (N))                                                    \
575   {                       \
576     (Current).first_line   = YYRHSLOC (Rhs, 1).first_line; \
577     (Current).first_column = YYRHSLOC (Rhs, 1).first_column;  \
578     (Current).last_line    = YYRHSLOC (Rhs, N).last_line;     \
579     (Current).last_column  = YYRHSLOC (Rhs, N).last_column;   \
580   }                       \
581      else                       \
582   {                       \
583     (Current).first_line   = (Current).last_line   =    \
584       YYRHSLOC (Rhs, 0).last_line;          \
585     (Current).first_column = (Current).last_column =    \
586       YYRHSLOC (Rhs, 0).last_column;           \
587   }                       \
588    while (YYID (0))
589#endif
590
591
592/* YY_LOCATION_PRINT -- Print the location on the stream.
593   This macro was not mandated originally: define only if we know
594   we won't break user code: when these are the locations we know.  */
595
596#ifndef YY_LOCATION_PRINT
597# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
598#  define YY_LOCATION_PRINT(File, Loc)       \
599     fprintf (File, "%d.%d-%d.%d",        \
600         (Loc).first_line, (Loc).first_column,  \
601         (Loc).last_line,  (Loc).last_column)
602# else
603#  define YY_LOCATION_PRINT(File, Loc) ((void) 0)
604# endif
605#endif
606
607
608/* YYLEX -- calling `yylex' with the right arguments.  */
609
610#ifdef YYLEX_PARAM
611# define YYLEX yylex (YYLEX_PARAM)
612#else
613# define YYLEX yylex ()
614#endif
615
616/* Enable debugging if requested.  */
617#if YYDEBUG
618
619# ifndef YYFPRINTF
620#  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
621#  define YYFPRINTF fprintf
622# endif
623
624# define YYDPRINTF(Args)         \
625do {                 \
626  if (yydebug)             \
627    YYFPRINTF Args;           \
628} while (YYID (0))
629
630# define YY_SYMBOL_PRINT(Title, Type, Value, Location)           \
631do {                            \
632  if (yydebug)                        \
633    {                           \
634      YYFPRINTF (stderr, "%s ", Title);                 \
635      yy_symbol_print (stderr,                    \
636        Type, Value); \
637      YYFPRINTF (stderr, "\n");                   \
638    }                           \
639} while (YYID (0))
640
641
642/*--------------------------------.
643| Print this symbol on YYOUTPUT.  |
644`--------------------------------*/
645
646/*ARGSUSED*/
647#if (defined __STDC__ || defined __C99__FUNC__ \
648     || defined __cplusplus || defined _MSC_VER)
649static void
650yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
651#else
652static void
653yy_symbol_value_print (yyoutput, yytype, yyvaluep)
654    FILE *yyoutput;
655    int yytype;
656    YYSTYPE const * const yyvaluep;
657#endif
658{
659  if (!yyvaluep)
660    return;
661# ifdef YYPRINT
662  if (yytype < YYNTOKENS)
663    YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
664# else
665  YYUSE (yyoutput);
666# endif
667  switch (yytype)
668    {
669      default:
670   break;
671    }
672}
673
674
675/*--------------------------------.
676| Print this symbol on YYOUTPUT.  |
677`--------------------------------*/
678
679#if (defined __STDC__ || defined __C99__FUNC__ \
680     || defined __cplusplus || defined _MSC_VER)
681static void
682yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
683#else
684static void
685yy_symbol_print (yyoutput, yytype, yyvaluep)
686    FILE *yyoutput;
687    int yytype;
688    YYSTYPE const * const yyvaluep;
689#endif
690{
691  if (yytype < YYNTOKENS)
692    YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
693  else
694    YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
695
696  yy_symbol_value_print (yyoutput, yytype, yyvaluep);
697  YYFPRINTF (yyoutput, ")");
698}
699
700/*------------------------------------------------------------------.
701| yy_stack_print -- Print the state stack from its BOTTOM up to its |
702| TOP (included).                                                   |
703`------------------------------------------------------------------*/
704
705#if (defined __STDC__ || defined __C99__FUNC__ \
706     || defined __cplusplus || defined _MSC_VER)
707static void
708yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
709#else
710static void
711yy_stack_print (bottom, top)
712    yytype_int16 *bottom;
713    yytype_int16 *top;
714#endif
715{
716  YYFPRINTF (stderr, "Stack now");
717  for (; bottom <= top; ++bottom)
718    YYFPRINTF (stderr, " %d", *bottom);
719  YYFPRINTF (stderr, "\n");
720}
721
722# define YY_STACK_PRINT(Bottom, Top)            \
723do {                       \
724  if (yydebug)                   \
725    yy_stack_print ((Bottom), (Top));           \
726} while (YYID (0))
727
728
729/*------------------------------------------------.
730| Report that the YYRULE is going to be reduced.  |
731`------------------------------------------------*/
732
733#if (defined __STDC__ || defined __C99__FUNC__ \
734     || defined __cplusplus || defined _MSC_VER)
735static void
736yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
737#else
738static void
739yy_reduce_print (yyvsp, yyrule)
740    YYSTYPE *yyvsp;
741    int yyrule;
742#endif
743{
744  int yynrhs = yyr2[yyrule];
745  int yyi;
746  unsigned long int yylno = yyrline[yyrule];
747  YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
748        yyrule - 1, yylno);
749  /* The symbols being reduced.  */
750  for (yyi = 0; yyi < yynrhs; yyi++)
751    {
752      fprintf (stderr, "   $%d = ", yyi + 1);
753      yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
754             &(yyvsp[(yyi + 1) - (yynrhs)])
755                         );
756      fprintf (stderr, "\n");
757    }
758}
759
760# define YY_REDUCE_PRINT(Rule)      \
761do {              \
762  if (yydebug)          \
763    yy_reduce_print (yyvsp, Rule); \
764} while (YYID (0))
765
766/* Nonzero means print parse trace.  It is left uninitialized so that
767   multiple parsers can coexist.  */
768int yydebug;
769#else /* !YYDEBUG */
770# define YYDPRINTF(Args)
771# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
772# define YY_STACK_PRINT(Bottom, Top)
773# define YY_REDUCE_PRINT(Rule)
774#endif /* !YYDEBUG */
775
776
777/* YYINITDEPTH -- initial size of the parser's stacks.  */
778#ifndef  YYINITDEPTH
779# define YYINITDEPTH 200
780#endif
781
782/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
783   if the built-in stack extension method is used).
784
785   Do not make this value too large; the results are undefined if
786   YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
787   evaluated with infinite-precision integer arithmetic.  */
788
789#ifndef YYMAXDEPTH
790# define YYMAXDEPTH 10000
791#endif
792
793
794
795#if YYERROR_VERBOSE
796
797# ifndef yystrlen
798#  if defined __GLIBC__ && defined _STRING_H
799#   define yystrlen strlen
800#  else
801/* Return the length of YYSTR.  */
802#if (defined __STDC__ || defined __C99__FUNC__ \
803     || defined __cplusplus || defined _MSC_VER)
804static YYSIZE_T
805yystrlen (const char *yystr)
806#else
807static YYSIZE_T
808yystrlen (yystr)
809    const char *yystr;
810#endif
811{
812  YYSIZE_T yylen;
813  for (yylen = 0; yystr[yylen]; yylen++)
814    continue;
815  return yylen;
816}
817#  endif
818# endif
819
820# ifndef yystpcpy
821#  if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
822#   define yystpcpy stpcpy
823#  else
824/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
825   YYDEST.  */
826#if (defined __STDC__ || defined __C99__FUNC__ \
827     || defined __cplusplus || defined _MSC_VER)
828static char *
829yystpcpy (char *yydest, const char *yysrc)
830#else
831static char *
832yystpcpy (yydest, yysrc)
833    char *yydest;
834    const char *yysrc;
835#endif
836{
837  char *yyd = yydest;
838  const char *yys = yysrc;
839
840  while ((*yyd++ = *yys++) != '\0')
841    continue;
842
843  return yyd - 1;
844}
845#  endif
846# endif
847
848# ifndef yytnamerr
849/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
850   quotes and backslashes, so that it's suitable for yyerror.  The
851   heuristic is that double-quoting is unnecessary unless the string
852   contains an apostrophe, a comma, or backslash (other than
853   backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
854   null, do not copy; instead, return the length of what the result
855   would have been.  */
856static YYSIZE_T
857yytnamerr (char *yyres, const char *yystr)
858{
859  if (*yystr == '"')
860    {
861      YYSIZE_T yyn = 0;
862      char const *yyp = yystr;
863
864      for (;;)
865   switch (*++yyp)
866     {
867     case '\'':
868     case ',':
869       goto do_not_strip_quotes;
870
871     case '\\':
872       if (*++yyp != '\\')
873         goto do_not_strip_quotes;
874       /* Fall through.  */
875     default:
876       if (yyres)
877         yyres[yyn] = *yyp;
878       yyn++;
879       break;
880
881     case '"':
882       if (yyres)
883         yyres[yyn] = '\0';
884       return yyn;
885     }
886    do_not_strip_quotes: ;
887    }
888
889  if (! yyres)
890    return yystrlen (yystr);
891
892  return yystpcpy (yyres, yystr) - yyres;
893}
894# endif
895
896/* Copy into YYRESULT an error message about the unexpected token
897   YYCHAR while in state YYSTATE.  Return the number of bytes copied,
898   including the terminating null byte.  If YYRESULT is null, do not
899   copy anything; just return the number of bytes that would be
900   copied.  As a special case, return 0 if an ordinary "syntax error"
901   message will do.  Return YYSIZE_MAXIMUM if overflow occurs during
902   size calculation.  */
903static YYSIZE_T
904yysyntax_error (char *yyresult, int yystate, int yychar)
905{
906  int yyn = yypact[yystate];
907
908  if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
909    return 0;
910  else
911    {
912      int yytype = YYTRANSLATE (yychar);
913      YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
914      YYSIZE_T yysize = yysize0;
915      YYSIZE_T yysize1;
916      int yysize_overflow = 0;
917      enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
918      char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
919      int yyx;
920
921# if 0
922      /* This is so xgettext sees the translatable formats that are
923    constructed on the fly.  */
924      YY_("syntax error, unexpected %s");
925      YY_("syntax error, unexpected %s, expecting %s");
926      YY_("syntax error, unexpected %s, expecting %s or %s");
927      YY_("syntax error, unexpected %s, expecting %s or %s or %s");
928      YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
929# endif
930      char *yyfmt;
931      char const *yyf;
932      static char const yyunexpected[] = "syntax error, unexpected %s";
933      static char const yyexpecting[] = ", expecting %s";
934      static char const yyor[] = " or %s";
935      char yyformat[sizeof yyunexpected
936          + sizeof yyexpecting - 1
937          + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
938             * (sizeof yyor - 1))];
939      char const *yyprefix = yyexpecting;
940
941      /* Start YYX at -YYN if negative to avoid negative indexes in
942    YYCHECK.  */
943      int yyxbegin = yyn < 0 ? -yyn : 0;
944
945      /* Stay within bounds of both yycheck and yytname.  */
946      int yychecklim = YYLAST - yyn + 1;
947      int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
948      int yycount = 1;
949
950      yyarg[0] = yytname[yytype];
951      yyfmt = yystpcpy (yyformat, yyunexpected);
952
953      for (yyx = yyxbegin; yyx < yyxend; ++yyx)
954   if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
955     {
956       if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
957         {
958      yycount = 1;
959      yysize = yysize0;
960      yyformat[sizeof yyunexpected - 1] = '\0';
961      break;
962         }
963       yyarg[yycount++] = yytname[yyx];
964       yysize1 = yysize + yytnamerr (0, yytname[yyx]);
965       yysize_overflow |= (yysize1 < yysize);
966       yysize = yysize1;
967       yyfmt = yystpcpy (yyfmt, yyprefix);
968       yyprefix = yyor;
969     }
970
971      yyf = YY_(yyformat);
972      yysize1 = yysize + yystrlen (yyf);
973      yysize_overflow |= (yysize1 < yysize);
974      yysize = yysize1;
975
976      if (yysize_overflow)
977   return YYSIZE_MAXIMUM;
978
979      if (yyresult)
980   {
981     /* Avoid sprintf, as that infringes on the user's name space.
982        Don't have undefined behavior even if the translation
983        produced a string with the wrong number of "%s"s.  */
984     char *yyp = yyresult;
985     int yyi = 0;
986     while ((*yyp = *yyf) != '\0')
987       {
988         if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
989      {
990        yyp += yytnamerr (yyp, yyarg[yyi++]);
991        yyf += 2;
992      }
993         else
994      {
995        yyp++;
996        yyf++;
997      }
998       }
999   }
1000      return yysize;
1001    }
1002}
1003#endif /* YYERROR_VERBOSE */
1004
1005
1006/*-----------------------------------------------.
1007| Release the memory associated to this symbol.  |
1008`-----------------------------------------------*/
1009
1010/*ARGSUSED*/
1011#if (defined __STDC__ || defined __C99__FUNC__ \
1012     || defined __cplusplus || defined _MSC_VER)
1013static void
1014yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1015#else
1016static void
1017yydestruct (yymsg, yytype, yyvaluep)
1018    const char *yymsg;
1019    int yytype;
1020    YYSTYPE *yyvaluep;
1021#endif
1022{
1023  YYUSE (yyvaluep);
1024
1025  if (!yymsg)
1026    yymsg = "Deleting";
1027  YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1028
1029  switch (yytype)
1030    {
1031
1032      default:
1033   break;
1034    }
1035}
1036
1037
1038/* Prevent warnings from -Wmissing-prototypes.  */
1039
1040#ifdef YYPARSE_PARAM
1041#if defined __STDC__ || defined __cplusplus
1042int yyparse (void *YYPARSE_PARAM);
1043#else
1044int yyparse ();
1045#endif
1046#else /* ! YYPARSE_PARAM */
1047#if defined __STDC__ || defined __cplusplus
1048int yyparse (void);
1049#else
1050int yyparse ();
1051#endif
1052#endif /* ! YYPARSE_PARAM */
1053
1054
1055
1056/* The look-ahead symbol.  */
1057int yychar;
1058
1059/* The semantic value of the look-ahead symbol.  */
1060YYSTYPE yylval;
1061
1062/* Number of syntax errors so far.  */
1063int yynerrs;
1064
1065
1066
1067/*----------.
1068| yyparse.  |
1069`----------*/
1070
1071#ifdef YYPARSE_PARAM
1072#if (defined __STDC__ || defined __C99__FUNC__ \
1073     || defined __cplusplus || defined _MSC_VER)
1074int
1075yyparse (void *YYPARSE_PARAM)
1076#else
1077int
1078yyparse (YYPARSE_PARAM)
1079    void *YYPARSE_PARAM;
1080#endif
1081#else /* ! YYPARSE_PARAM */
1082#if (defined __STDC__ || defined __C99__FUNC__ \
1083     || defined __cplusplus || defined _MSC_VER)
1084int
1085yyparse (void)
1086#else
1087int
1088yyparse ()
1089
1090#endif
1091#endif
1092{
1093 
1094  int yystate;
1095  int yyn;
1096  int yyresult;
1097  /* Number of tokens to shift before error messages enabled.  */
1098  int yyerrstatus;
1099  /* Look-ahead token as an internal (translated) token number.  */
1100  int yytoken = 0;
1101#if YYERROR_VERBOSE
1102  /* Buffer for error messages, and its allocated size.  */
1103  char yymsgbuf[128];
1104  char *yymsg = yymsgbuf;
1105  YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1106#endif
1107
1108  /* Three stacks and their tools:
1109     `yyss': related to states,
1110     `yyvs': related to semantic values,
1111     `yyls': related to locations.
1112
1113     Refer to the stacks thru separate pointers, to allow yyoverflow
1114     to reallocate them elsewhere.  */
1115
1116  /* The state stack.  */
1117  yytype_int16 yyssa[YYINITDEPTH];
1118  yytype_int16 *yyss = yyssa;
1119  yytype_int16 *yyssp;
1120
1121  /* The semantic value stack.  */
1122  YYSTYPE yyvsa[YYINITDEPTH];
1123  YYSTYPE *yyvs = yyvsa;
1124  YYSTYPE *yyvsp;
1125
1126
1127
1128#define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
1129
1130  YYSIZE_T yystacksize = YYINITDEPTH;
1131
1132  /* The variables used to return semantic value and location from the
1133     action routines.  */
1134  YYSTYPE yyval;
1135
1136
1137  /* The number of symbols on the RHS of the reduced rule.
1138     Keep to zero when no symbol should be popped.  */
1139  int yylen = 0;
1140
1141  YYDPRINTF ((stderr, "Starting parse\n"));
1142
1143  yystate = 0;
1144  yyerrstatus = 0;
1145  yynerrs = 0;
1146  yychar = YYEMPTY;     /* Cause a token to be read.  */
1147
1148  /* Initialize stack pointers.
1149     Waste one element of value and location stack
1150     so that they stay on the same level as the state stack.
1151     The wasted elements are never initialized.  */
1152
1153  yyssp = yyss;
1154  yyvsp = yyvs;
1155
1156  goto yysetstate;
1157
1158/*------------------------------------------------------------.
1159| yynewstate -- Push a new state, which is found in yystate.  |
1160`------------------------------------------------------------*/
1161 yynewstate:
1162  /* In all cases, when you get here, the value and location stacks
1163     have just been pushed.  So pushing a state here evens the stacks.  */
1164  yyssp++;
1165
1166 yysetstate:
1167  *yyssp = yystate;
1168
1169  if (yyss + yystacksize - 1 <= yyssp)
1170    {
1171      /* Get the current used size of the three stacks, in elements.  */
1172      YYSIZE_T yysize = yyssp - yyss + 1;
1173
1174#ifdef yyoverflow
1175      {
1176   /* Give user a chance to reallocate the stack.  Use copies of
1177      these so that the &'s don't force the real ones into
1178      memory.  */
1179   YYSTYPE *yyvs1 = yyvs;
1180   yytype_int16 *yyss1 = yyss;
1181
1182
1183   /* Each stack pointer address is followed by the size of the
1184      data in use in that stack, in bytes.  This used to be a
1185      conditional around just the two extra args, but that might
1186      be undefined if yyoverflow is a macro.  */
1187   yyoverflow (YY_("memory exhausted"),
1188          &yyss1, yysize * sizeof (*yyssp),
1189          &yyvs1, yysize * sizeof (*yyvsp),
1190
1191          &yystacksize);
1192
1193   yyss = yyss1;
1194   yyvs = yyvs1;
1195      }
1196#else /* no yyoverflow */
1197# ifndef YYSTACK_RELOCATE
1198      goto yyexhaustedlab;
1199# else
1200      /* Extend the stack our own way.  */
1201      if (YYMAXDEPTH <= yystacksize)
1202   goto yyexhaustedlab;
1203      yystacksize *= 2;
1204      if (YYMAXDEPTH < yystacksize)
1205   yystacksize = YYMAXDEPTH;
1206
1207      {
1208   yytype_int16 *yyss1 = yyss;
1209   union yyalloc *yyptr =
1210     (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1211   if (! yyptr)
1212     goto yyexhaustedlab;
1213   YYSTACK_RELOCATE (yyss);
1214   YYSTACK_RELOCATE (yyvs);
1215
1216#  undef YYSTACK_RELOCATE
1217   if (yyss1 != yyssa)
1218     YYSTACK_FREE (yyss1);
1219      }
1220# endif
1221#endif /* no yyoverflow */
1222
1223      yyssp = yyss + yysize - 1;
1224      yyvsp = yyvs + yysize - 1;
1225
1226
1227      YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1228        (unsigned long int) yystacksize));
1229
1230      if (yyss + yystacksize - 1 <= yyssp)
1231   YYABORT;
1232    }
1233
1234  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1235
1236  goto yybackup;
1237
1238/*-----------.
1239| yybackup.  |
1240`-----------*/
1241yybackup:
1242
1243  /* Do appropriate processing given the current state.  Read a
1244     look-ahead token if we need one and don't already have one.  */
1245
1246  /* First try to decide what to do without reference to look-ahead token.  */
1247  yyn = yypact[yystate];
1248  if (yyn == YYPACT_NINF)
1249    goto yydefault;
1250
1251  /* Not known => get a look-ahead token if don't already have one.  */
1252
1253  /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol.  */
1254  if (yychar == YYEMPTY)
1255    {
1256      YYDPRINTF ((stderr, "Reading a token: "));
1257      yychar = YYLEX;
1258    }
1259
1260  if (yychar <= YYEOF)
1261    {
1262      yychar = yytoken = YYEOF;
1263      YYDPRINTF ((stderr, "Now at end of input.\n"));
1264    }
1265  else
1266    {
1267      yytoken = YYTRANSLATE (yychar);
1268      YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1269    }
1270
1271  /* If the proper action on seeing token YYTOKEN is to reduce or to
1272     detect an error, take that action.  */
1273  yyn += yytoken;
1274  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1275    goto yydefault;
1276  yyn = yytable[yyn];
1277  if (yyn <= 0)
1278    {
1279      if (yyn == 0 || yyn == YYTABLE_NINF)
1280   goto yyerrlab;
1281      yyn = -yyn;
1282      goto yyreduce;
1283    }
1284
1285  if (yyn == YYFINAL)
1286    YYACCEPT;
1287
1288  /* Count tokens shifted since error; after three, turn off error
1289     status.  */
1290  if (yyerrstatus)
1291    yyerrstatus--;
1292
1293  /* Shift the look-ahead token.  */
1294  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1295
1296  /* Discard the shifted token unless it is eof.  */
1297  if (yychar != YYEOF)
1298    yychar = YYEMPTY;
1299
1300  yystate = yyn;
1301  *++yyvsp = yylval;
1302
1303  goto yynewstate;
1304
1305
1306/*-----------------------------------------------------------.
1307| yydefault -- do the default action for the current state.  |
1308`-----------------------------------------------------------*/
1309yydefault:
1310  yyn = yydefact[yystate];
1311  if (yyn == 0)
1312    goto yyerrlab;
1313  goto yyreduce;
1314
1315
1316/*-----------------------------.
1317| yyreduce -- Do a reduction.  |
1318`-----------------------------*/
1319yyreduce:
1320  /* yyn is the number of a rule to reduce with.  */
1321  yylen = yyr2[yyn];
1322
1323  /* If YYLEN is nonzero, implement the default value of the action:
1324     `$$ = $1'.
1325
1326     Otherwise, the following line sets YYVAL to garbage.
1327     This behavior is undocumented and Bison
1328     users should not rely upon it.  Assigning to YYVAL
1329     unconditionally makes the parser a bit smaller, and it avoids a
1330     GCC warning that YYVAL may be used uninitialized.  */
1331  yyval = yyvsp[1-yylen];
1332
1333
1334  YY_REDUCE_PRINT (yyn);
1335  switch (yyn)
1336    {
1337        case 5:
1338#line 67 "convert.y"
1339    {initdimprob(1,(yyvsp[(2) - (3)].na),"0","0");;}
1340    break;
1341
1342  case 6:
1343#line 68 "convert.y"
1344    {initdimprob(2,(yyvsp[(2) - (5)].na), (yyvsp[(4) - (5)].na),"0");;}
1345    break;
1346
1347  case 7:
1348#line 70 "convert.y"
1349    {initdimprob(3,(yyvsp[(2) - (7)].na), (yyvsp[(4) - (7)].na), (yyvsp[(6) - (7)].na));;}
1350    break;
1351
1352  case 8:
1353#line 72 "convert.y"
1354    {listofmodules = Addtolistnom((yyvsp[(2) - (3)].na),listofmodules,0);
1355                                                        Addmoduletothelist((yyvsp[(2) - (3)].na));;}
1356    break;
1357
1358  case 9:
1359#line 74 "convert.y"
1360    {Add_NotGridDepend_Var_1((yyvsp[(3) - (4)].na));;}
1361    break;
1362
1363  case 10:
1364#line 75 "convert.y"
1365    {
1366                                    if (!strcasecmp((yyvsp[(2) - (3)].na),"FIXED_GRIDS"))
1367                                                                 fixedgrids=1;
1368                                    if (!strcasecmp((yyvsp[(2) - (3)].na),"ONLY_FIXED_GRIDS"))
1369                                                             onlyfixedgrids=1;
1370                                 ;}
1371    break;
1372
1373
1374/* Line 1267 of yacc.c.  */
1375#line 1376 "convert.tab.c"
1376      default: break;
1377    }
1378  YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
1379
1380  YYPOPSTACK (yylen);
1381  yylen = 0;
1382  YY_STACK_PRINT (yyss, yyssp);
1383
1384  *++yyvsp = yyval;
1385
1386
1387  /* Now `shift' the result of the reduction.  Determine what state
1388     that goes to, based on the state we popped back to and the rule
1389     number reduced by.  */
1390
1391  yyn = yyr1[yyn];
1392
1393  yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1394  if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1395    yystate = yytable[yystate];
1396  else
1397    yystate = yydefgoto[yyn - YYNTOKENS];
1398
1399  goto yynewstate;
1400
1401
1402/*------------------------------------.
1403| yyerrlab -- here on detecting error |
1404`------------------------------------*/
1405yyerrlab:
1406  /* If not already recovering from an error, report this error.  */
1407  if (!yyerrstatus)
1408    {
1409      ++yynerrs;
1410#if ! YYERROR_VERBOSE
1411      yyerror (YY_("syntax error"));
1412#else
1413      {
1414   YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
1415   if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
1416     {
1417       YYSIZE_T yyalloc = 2 * yysize;
1418       if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
1419         yyalloc = YYSTACK_ALLOC_MAXIMUM;
1420       if (yymsg != yymsgbuf)
1421         YYSTACK_FREE (yymsg);
1422       yymsg = (char *) YYSTACK_ALLOC (yyalloc);
1423       if (yymsg)
1424         yymsg_alloc = yyalloc;
1425       else
1426         {
1427      yymsg = yymsgbuf;
1428      yymsg_alloc = sizeof yymsgbuf;
1429         }
1430     }
1431
1432   if (0 < yysize && yysize <= yymsg_alloc)
1433     {
1434       (void) yysyntax_error (yymsg, yystate, yychar);
1435       yyerror (yymsg);
1436     }
1437   else
1438     {
1439       yyerror (YY_("syntax error"));
1440       if (yysize != 0)
1441         goto yyexhaustedlab;
1442     }
1443      }
1444#endif
1445    }
1446
1447
1448
1449  if (yyerrstatus == 3)
1450    {
1451      /* If just tried and failed to reuse look-ahead token after an
1452    error, discard it.  */
1453
1454      if (yychar <= YYEOF)
1455   {
1456     /* Return failure if at end of input.  */
1457     if (yychar == YYEOF)
1458       YYABORT;
1459   }
1460      else
1461   {
1462     yydestruct ("Error: discarding",
1463            yytoken, &yylval);
1464     yychar = YYEMPTY;
1465   }
1466    }
1467
1468  /* Else will try to reuse look-ahead token after shifting the error
1469     token.  */
1470  goto yyerrlab1;
1471
1472
1473/*---------------------------------------------------.
1474| yyerrorlab -- error raised explicitly by YYERROR.  |
1475`---------------------------------------------------*/
1476yyerrorlab:
1477
1478  /* Pacify compilers like GCC when the user code never invokes
1479     YYERROR and the label yyerrorlab therefore never appears in user
1480     code.  */
1481  if (/*CONSTCOND*/ 0)
1482     goto yyerrorlab;
1483
1484  /* Do not reclaim the symbols of the rule which action triggered
1485     this YYERROR.  */
1486  YYPOPSTACK (yylen);
1487  yylen = 0;
1488  YY_STACK_PRINT (yyss, yyssp);
1489  yystate = *yyssp;
1490  goto yyerrlab1;
1491
1492
1493/*-------------------------------------------------------------.
1494| yyerrlab1 -- common code for both syntax error and YYERROR.  |
1495`-------------------------------------------------------------*/
1496yyerrlab1:
1497  yyerrstatus = 3;   /* Each real token shifted decrements this.  */
1498
1499  for (;;)
1500    {
1501      yyn = yypact[yystate];
1502      if (yyn != YYPACT_NINF)
1503   {
1504     yyn += YYTERROR;
1505     if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1506       {
1507         yyn = yytable[yyn];
1508         if (0 < yyn)
1509      break;
1510       }
1511   }
1512
1513      /* Pop the current state because it cannot handle the error token.  */
1514      if (yyssp == yyss)
1515   YYABORT;
1516
1517
1518      yydestruct ("Error: popping",
1519        yystos[yystate], yyvsp);
1520      YYPOPSTACK (1);
1521      yystate = *yyssp;
1522      YY_STACK_PRINT (yyss, yyssp);
1523    }
1524
1525  if (yyn == YYFINAL)
1526    YYACCEPT;
1527
1528  *++yyvsp = yylval;
1529
1530
1531  /* Shift the error token.  */
1532  YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
1533
1534  yystate = yyn;
1535  goto yynewstate;
1536
1537
1538/*-------------------------------------.
1539| yyacceptlab -- YYACCEPT comes here.  |
1540`-------------------------------------*/
1541yyacceptlab:
1542  yyresult = 0;
1543  goto yyreturn;
1544
1545/*-----------------------------------.
1546| yyabortlab -- YYABORT comes here.  |
1547`-----------------------------------*/
1548yyabortlab:
1549  yyresult = 1;
1550  goto yyreturn;
1551
1552#ifndef yyoverflow
1553/*-------------------------------------------------.
1554| yyexhaustedlab -- memory exhaustion comes here.  |
1555`-------------------------------------------------*/
1556yyexhaustedlab:
1557  yyerror (YY_("memory exhausted"));
1558  yyresult = 2;
1559  /* Fall through.  */
1560#endif
1561
1562yyreturn:
1563  if (yychar != YYEOF && yychar != YYEMPTY)
1564     yydestruct ("Cleanup: discarding lookahead",
1565       yytoken, &yylval);
1566  /* Do not reclaim the symbols of the rule which action triggered
1567     this YYABORT or YYACCEPT.  */
1568  YYPOPSTACK (yylen);
1569  YY_STACK_PRINT (yyss, yyssp);
1570  while (yyssp != yyss)
1571    {
1572      yydestruct ("Cleanup: popping",
1573        yystos[*yyssp], yyvsp);
1574      YYPOPSTACK (1);
1575    }
1576#ifndef yyoverflow
1577  if (yyss != yyssa)
1578    YYSTACK_FREE (yyss);
1579#endif
1580#if YYERROR_VERBOSE
1581  if (yymsg != yymsgbuf)
1582    YYSTACK_FREE (yymsg);
1583#endif
1584  /* Make sure YYID is used.  */
1585  return YYID (yyresult);
1586}
1587
1588
1589#line 82 "convert.y"
1590
1591
1592int main(int argc,char *argv[])
1593{
1594   extern FILE * yyin ;
1595   FILE *dependglobaloutput;
1596   int i;
1597   listnom *parcours;
1598   listvar *newvar;
1599   int stylegiven = 0;
1600   int infreegiven ;
1601   int infixedgiven ;
1602   int lengthmainfile;
1603
1604   if (argc < 2)
1605   {
1606       printf("usage : conv <file> [-rm] [-incdir <directory>] \n");
1607       printf(" [-comdirin   <directory>] [-comdirout <directory>]\n");
1608       printf(" [-convfile  <FILENAME >] -SubloopScalar -SubloopScalar1 \n");
1609       printf(" [-free|-fixed]\n");
1610       exit(0);
1611   }
1612/******************************************************************************/
1613/*  1-  Variables initialization                                              */
1614/******************************************************************************/
1615   List_Global_Var=(listvar *)NULL;
1616   List_GlobalParameter_Var=(listvar *)NULL;
1617   List_Allocate_Var=(listallocate *)NULL;
1618   List_Common_Var=(listvar *)NULL;
1619   List_SubroutineWhereAgrifUsed=(listnom *)NULL;
1620   List_Subroutine_For_Alloc=(listnom *)NULL;
1621   List_Include=(listusemodule *)NULL;
1622   List_NameOfModuleUsed=(listusemodule *)NULL;
1623   listofmoduletmp=(listusemodule *)NULL;
1624   List_SubroutineDeclaration_Var=(listvar *)NULL;
1625   List_UsedInSubroutine_Var=(listvar *)NULL;
1626   List_NotGridDepend_Var=(listvar *)NULL;
1627   Listofavailableindices=(listindice *)NULL;
1628   List_CouplePointed_Var=(listvarpointtovar *)NULL;
1629   List_ModuleUsed_Var = (listvar *)NULL;
1630   List_ModuleUsedInModuleUsed_Var = (listvar *)NULL;
1631   List_GlobParamModuleUsed_Var = (listparameter *)NULL;
1632   List_GlobParamModuleUsedInModuleUsed_Var = (listparameter *)NULL;
1633   List_SubroutineArgument_Var = (listvar *)NULL;
1634   List_FunctionType_Var = (listvar *)NULL;
1635   tmpuselocallist = (listusemodule *)NULL;
1636   List_ContainsSubroutine = (listnom *)NULL;
1637   oldfortranout = (FILE *)NULL;
1638
1639   strcpy(mainfile,argv[1]);
1640   strcpy(nomdir,"AGRIF_INC");
1641   strcpy(commondirin,".");
1642   strcpy(commondirout,".");
1643   strcpy(filetoparse," ");
1644   strcpy(subofagrifinitgrids,"");
1645   strcpy(meetagrifinitgrids,"");
1646   strcpy(mpiinitvar,"");
1647
1648   length_last = 0 ;
1649   length_first = 0 ;
1650   length_v_typevar = 0 ;
1651   length_v_nomvar = 0 ;
1652   length_v_dimchar = 0 ;
1653   length_v_modulename = 0 ;
1654   length_v_commonname = 0 ;
1655   length_v_vallengspec = 0 ;
1656   length_v_nameinttypename = 0 ;
1657   length_v_commoninfile = 0 ;
1658   length_v_subroutinename = 0 ;
1659   length_v_precision = 0 ;
1660   length_v_IntentSpec = 0 ;
1661   length_v_initialvalue = 0 ;
1662   length_v_readedlistdimension = 0 ;
1663   length_u_usemodule = 0 ;
1664   length_u_charusemodule = 0 ;
1665   length_u_cursubroutine = 0 ;
1666   length_u_modulename = 0 ;
1667   length_n_name = 0 ;
1668   length_c_namevar = 0 ;
1669   length_c_namepointedvar = 0 ;
1670   length_o_nom = 0 ;
1671   length_o_module = 0 ;
1672   length_a_nomvar = 0 ;
1673   length_a_subroutine = 0 ;
1674   length_a_module = 0 ;
1675   length_t_usemodule = 0 ;
1676   length_t_cursubroutine = 0 ;
1677   length_curfilename = 0 ;
1678   length_nomfileoutput = 0 ;
1679   length_motparse = 0 ;
1680   length_mainfile = 0 ;
1681   length_nomdir = 0 ;
1682   length_commondirout = 0 ;
1683   length_commondirin = 0 ;
1684   length_filetoparse = 0 ;
1685   length_curbuf = 0 ;
1686   length_toprintglob = 0 ;
1687   length_tmpvargridname = 0 ;
1688   length_ligne_Subloop = 0 ;
1689   length_lvargridname_toamr = 0 ;
1690   length_toprint_utilagrif = 0 ;
1691   length_toprinttmp_utilchar = 0 ;
1692   length_ligne_writedecl = 0 ;
1693   length_newname_toamr = 0 ;
1694   length_newname_writedecl = 0 ;
1695   length_ligne_toamr = 0 ;
1696   length_tmpligne_writedecl = 0 ;
1697   value_char_size = 0 ;
1698   value_char_size1 = 0 ;
1699   value_char_size2 = 0 ;
1700   value_char_size3 = 0 ;
1701   inallocate = 0;
1702   infixed = 1;
1703   infree  = 0;
1704
1705   checkexistcommon=1;
1706   todebug=0;
1707   onlyfixedgrids=0;
1708   fixedgrids=0;
1709   InAgrifParentDef = 0;
1710   IndicenbmaillesX=0;
1711   IndicenbmaillesY=0;
1712   IndicenbmaillesZ=0;
1713   created_dimensionlist = 1;
1714   indicemaxtabvars = 0;   /* current indice in the table tabvars             */
1715   SubloopScalar = 0;
1716   todebug = 0;
1717   todebugfree = 0;
1718   retour77 = 1 ;
1719   mark = 0 ;
1720   shouldincludempif = 0 ;
1721   Read_val_max();
1722/******************************************************************************/
1723/*  2-  Program arguments                                                     */
1724/******************************************************************************/
1725
1726   if ((yyin=fopen(argv[1],"r"))==NULL)
1727   {
1728      printf("the file %s doesn't exist \n",argv[1]);
1729      exit(0);
1730   }
1731
1732   i=2;
1733   while (i<argc)
1734   {
1735      if (!strcasecmp(argv[i],"-incdir"))
1736      {
1737         strcpy(nomdir,argv[i+1]);
1738         i++;
1739      }
1740      else if (!strcasecmp(argv[i],"-comdirin")) /* input directory           */
1741      {
1742         strcpy(commondirin,argv[i+1]);
1743         i++;
1744      }
1745      else if (!strcasecmp(argv[i],"-comdirout")) /* output directory         */
1746      {
1747         strcpy(commondirout,argv[i+1]);
1748         i++;
1749      }
1750      else if (!strcasecmp(argv[i],"-convfile")) /* file to parse             */
1751      {
1752         strcpy(filetoparse,argv[i+1]);
1753         i++;
1754         lengthmainfile = strlen(filetoparse);
1755         if (!strcasecmp(&filetoparse[lengthmainfile-4],".f90"))
1756         {
1757         infixed = 0;
1758         infree = 1;
1759         }
1760         else
1761         {
1762         infixed = 1;
1763         infree = 0;
1764         }
1765      }
1766      else if (!strcasecmp(argv[i],"-free")) /* file to parse        */
1767      {
1768         stylegiven = 1;
1769         infreegiven  = 1 ;
1770         infixedgiven = 0;
1771      }   
1772      else if (!strcasecmp(argv[i],"-fixed")) /* file to parse        */
1773      {
1774         stylegiven = 1;
1775         infreegiven  = 0;
1776         infixedgiven = 1;
1777      }         
1778      else if (!strcasecmp(argv[i],"-SubloopScalar")) /* file to parse        */
1779      {
1780         SubloopScalar = 1 ;
1781      }
1782      else if (!strcasecmp(argv[i],"-SubloopScalar1")) /* file to parse       */
1783      {
1784         SubloopScalar = 2 ;
1785      }
1786      else if (!strcasecmp(argv[i],"-todebug")) /* file to parse       */
1787      {
1788         todebug = 1 ;
1789      }
1790      else if (!strcasecmp(argv[i],"-mark")) /* file to parse       */
1791      {
1792         mark = 1 ;
1793      }
1794      else if (!strcasecmp(argv[i],"-todebugfree")) /* file to parse       */
1795      {
1796         todebugfree = 1 ;
1797      }
1798      else if (!strcasecmp(argv[i],"-rm"))
1799      {
1800         checkexistcommon=0;
1801      }
1802      else
1803      {
1804         printf("Unkwon option : %s\n",argv[i]);
1805         exit(0);
1806      }
1807      i++;
1808   }
1809
1810   if (stylegiven == 1) 
1811   {
1812   infree = infreegiven;
1813   infixed = infixedgiven;   
1814   }
1815   Save_Length(nomdir,34);
1816   Save_Length(commondirout,35);
1817   Save_Length(commondirin,36);
1818   Save_Length(filetoparse,37);
1819
1820/******************************************************************************/
1821/*  3-  Parsing of the  conv file <name>.in                                   */
1822/******************************************************************************/
1823
1824   if ((yyin=fopen(argv[1],"r"))==NULL)
1825   {
1826       printf("the file %s doesn't exist \n",argv[1]);
1827       exit(0);
1828   }
1829   strcpy(mainfile,argv[1]);
1830   Save_Length(mainfile,33);
1831
1832   if ( strstr(filetoparse,".f90") ||
1833        strstr(filetoparse,".F90") ) retour77 = 0;
1834
1835   yyparse();
1836
1837/******************************************************************************/
1838/*  4-  Preparation of the file parsing                                       */
1839/******************************************************************************/
1840   if ((yyin=fopen(filetoparse,"r"))==NULL) /* Is the file to parse exist ?   */
1841   {
1842      printf("the file %s doesn't exist \n",filetoparse);
1843      exit(0);
1844   }
1845   /* mainfile : the name of the file to parse                                */
1846   strcpy(mainfile,filetoparse);
1847   /*                                                                         */
1848   if ((dependglobaloutput=fopen(".dependglobal_agrif","r"))!=NULL)
1849   {
1850      fscanf(dependglobaloutput,"%d\n",&indicemaxtabvars);
1851      fclose(dependglobaloutput);
1852   }
1853   Readthedependavailablefile();
1854   /* Read the .dependnbxnby file which contains indices of nbmaillsX,        */
1855   /*    nbmailleY and nbmailleZ                                              */
1856   Readthedependnbxnbyfile();
1857   Read_Subroutine_For_Alloc();
1858/******************************************************************************/
1859/*  5-  Parsing of the input file (2 times)                                   */
1860/******************************************************************************/
1861   /* Record all variable in list                                             */
1862   firstpass = 1;
1863   processfortran(filetoparse);
1864   /*                                                                         */
1865   CompleteThelistvarindoloop();
1866   /* Read list of module used                                                */
1867   RecordUseModulesVariables();
1868   /* Read list of module used in module used                                 */
1869   RecordUseModulesUseModulesVariables();
1870   /* Save variables are considered as globals ones                           */
1871   Update_List_Global_Var_From_List_Save_Var();
1872   /* Update all lists                                                        */
1873   ListUpdate();
1874   /*                                                                         */
1875   Clean_List_Global_Var();
1876   /* Indice tabvars identification                                           */
1877   IndiceTabvarsIdentification();
1878   /* Update all lists                                                        */
1879   ListUpdate();
1880   /* The allocation subroutine is necessary ????                             */
1881   New_Allocate_Subroutine_Is_Necessary();
1882   /* The allocation subroutine is necessary for common list                  */
1883   New_Allocate_Subroutine_For_Common_Is_Necessary();
1884   /* Sort List_SubroutineArgument_Var                                        */
1885   Sort_List_SubroutineArgument_Var();
1886   /* Clean all lists                                                         */
1887   ListClean();
1888   /* Update Indice of List_UsedInSubroutine_Var from module used             */
1889   List_UsedInSubroutine_Var_Update_From_Module_Used();
1890   /* Update List_SubroutineWhereAgrifUsed                                    */
1891   UpdateList_SubroutineWhereAgrifUsed();
1892   /* Update List_UsedInSubroutine_Var with v_readedlistdimension             */
1893   UpdateList_UsedInSubroutine_With_dimension();;
1894   /*                                                                         */
1895   ModifyThelistvarindoloop();
1896   /*                                                                         */
1897   UpdateListDeclarationWithDimensionList();
1898   /*                                                                         */
1899   GiveTypeOfVariables();
1900   Affiche();
1901   /* Build new subroutines                                                   */
1902   firstpass = 0;
1903   processfortran(filetoparse);
1904
1905   newvar = (listvar *)NULL;
1906/*newvar = List_Global_Var; */
1907   while ( newvar )
1908   {
1909      printf("++++ %s %d %s %s %s\n",
1910      newvar->var->v_nomvar,
1911      newvar->var->v_nbdim,
1912      newvar->var->v_subroutinename,
1913      newvar->var->v_modulename,
1914      newvar->var->v_typevar
1915             );
1916      newvar = newvar->suiv;
1917   }
1918/******************************************************************************/
1919/*  6-  Write informations in output files                                    */
1920/******************************************************************************/
1921
1922   /* Write the .dependglobal_agrif file which contain the max indice         */
1923   /*    of the tabvars table                                                 */
1924   dependglobaloutput = fopen(".dependglobal_agrif","w");
1925   fprintf(dependglobaloutput,"%d\n",indicemaxtabvars);
1926   fclose(dependglobaloutput);
1927   /* Write the list of available indice                                      */
1928   Writethedependavailablefile();
1929   /* Write the .dependnbxnby file which contains indices of nbmaillsX,       */
1930   /*    nbmailleY and nbmailleZ                                              */
1931   Writethedependnbxnbyfile();
1932   /* Write the .depend<namefile> file which contain general informations     */
1933   /*    about variable of this file                                          */
1934   parcours = List_NameOfModule;
1935   while( parcours )
1936   {
1937      Writethedependlistofmoduleused(parcours->o_nom);
1938      WritedependParameterList(parcours->o_nom);
1939      Writethedependfile(parcours->o_nom,List_Global_Var);
1940      parcours=parcours->suiv;
1941   }
1942   parcours = List_NameOfCommon;
1943   while( parcours )
1944   {
1945      Writethedependfile(parcours->o_nom,List_Common_Var);
1946      parcours=parcours->suiv;
1947   }
1948   Write_Subroutine_For_Alloc();
1949/******************************************************************************/
1950/*  7-  Create files in AGRIF_INC directory                                   */
1951/******************************************************************************/
1952   creefichieramr(NameTamponfile);
1953
1954   Write_val_max();
1955
1956   if ( todebug == 1 ) printf("Out of CONV \n");
1957   return 0;
1958}
1959
1960#line 2 "convert.yy.c"
1961
1962#line 4 "convert.yy.c"
1963
1964#define  YY_INT_ALIGNED short int
1965
1966/* A lexical scanner generated by flex */
1967
1968#define FLEX_SCANNER
1969#define YY_FLEX_MAJOR_VERSION 2
1970#define YY_FLEX_MINOR_VERSION 5
1971#define YY_FLEX_SUBMINOR_VERSION 35
1972#if YY_FLEX_SUBMINOR_VERSION > 0
1973#define FLEX_BETA
1974#endif
1975
1976/* First, we deal with  platform-specific or compiler-specific issues. */
1977
1978/* begin standard C headers. */
1979#include <stdio.h>
1980#include <string.h>
1981#include <errno.h>
1982#include <stdlib.h>
1983
1984/* end standard C headers. */
1985
1986/* flex integer type definitions */
1987
1988#ifndef FLEXINT_H
1989#define FLEXINT_H
1990
1991/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
1992
1993#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
1994
1995/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
1996 * if you want the limit (max/min) macros for int types.
1997 */
1998#ifndef __STDC_LIMIT_MACROS
1999#define __STDC_LIMIT_MACROS 1
2000#endif
2001
2002#include <inttypes.h>
2003typedef int8_t flex_int8_t;
2004typedef uint8_t flex_uint8_t;
2005typedef int16_t flex_int16_t;
2006typedef uint16_t flex_uint16_t;
2007typedef int32_t flex_int32_t;
2008typedef uint32_t flex_uint32_t;
2009#else
2010typedef signed char flex_int8_t;
2011typedef short int flex_int16_t;
2012typedef int flex_int32_t;
2013typedef unsigned char flex_uint8_t; 
2014typedef unsigned short int flex_uint16_t;
2015typedef unsigned int flex_uint32_t;
2016#endif /* ! C99 */
2017
2018/* Limits of integral types. */
2019#ifndef INT8_MIN
2020#define INT8_MIN               (-128)
2021#endif
2022#ifndef INT16_MIN
2023#define INT16_MIN              (-32767-1)
2024#endif
2025#ifndef INT32_MIN
2026#define INT32_MIN              (-2147483647-1)
2027#endif
2028#ifndef INT8_MAX
2029#define INT8_MAX               (127)
2030#endif
2031#ifndef INT16_MAX
2032#define INT16_MAX              (32767)
2033#endif
2034#ifndef INT32_MAX
2035#define INT32_MAX              (2147483647)
2036#endif
2037#ifndef UINT8_MAX
2038#define UINT8_MAX              (255U)
2039#endif
2040#ifndef UINT16_MAX
2041#define UINT16_MAX             (65535U)
2042#endif
2043#ifndef UINT32_MAX
2044#define UINT32_MAX             (4294967295U)
2045#endif
2046
2047#endif /* ! FLEXINT_H */
2048
2049#ifdef __cplusplus
2050
2051/* The "const" storage-class-modifier is valid. */
2052#define YY_USE_CONST
2053
2054#else /* ! __cplusplus */
2055
2056/* C99 requires __STDC__ to be defined as 1. */
2057#if defined (__STDC__)
2058
2059#define YY_USE_CONST
2060
2061#endif   /* defined (__STDC__) */
2062#endif   /* ! __cplusplus */
2063
2064#ifdef YY_USE_CONST
2065#define yyconst const
2066#else
2067#define yyconst
2068#endif
2069
2070/* Returned upon end-of-file. */
2071#define YY_NULL 0
2072
2073/* Promotes a possibly negative, possibly signed char to an unsigned
2074 * integer for use as an array index.  If the signed char is negative,
2075 * we want to instead treat it as an 8-bit unsigned char, hence the
2076 * double cast.
2077 */
2078#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
2079
2080/* Enter a start condition.  This macro really ought to take a parameter,
2081 * but we do it the disgusting crufty way forced on us by the ()-less
2082 * definition of BEGIN.
2083 */
2084#define BEGIN (yy_start) = 1 + 2 *
2085
2086/* Translate the current start state into a value that can be later handed
2087 * to BEGIN to return to the state.  The YYSTATE alias is for lex
2088 * compatibility.
2089 */
2090#define YY_START (((yy_start) - 1) / 2)
2091#define YYSTATE YY_START
2092
2093/* Action number for EOF rule of a given start state. */
2094#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
2095
2096/* Special action meaning "start processing a new file". */
2097#define YY_NEW_FILE yyrestart(yyin  )
2098
2099#define YY_END_OF_BUFFER_CHAR 0
2100
2101/* Size of default input buffer. */
2102#ifndef YY_BUF_SIZE
2103#define YY_BUF_SIZE 16384
2104#endif
2105
2106/* The state buf must be large enough to hold one state per character in the main buffer.
2107 */
2108#define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
2109
2110#ifndef YY_TYPEDEF_YY_BUFFER_STATE
2111#define YY_TYPEDEF_YY_BUFFER_STATE
2112typedef struct yy_buffer_state *YY_BUFFER_STATE;
2113#endif
2114
2115#ifndef YY_TYPEDEF_YY_SIZE_T
2116#define YY_TYPEDEF_YY_SIZE_T
2117typedef size_t yy_size_t;
2118#endif
2119
2120extern yy_size_t yyleng;
2121
2122extern FILE *yyin, *yyout;
2123
2124#define EOB_ACT_CONTINUE_SCAN 0
2125#define EOB_ACT_END_OF_FILE 1
2126#define EOB_ACT_LAST_MATCH 2
2127
2128    #define YY_LESS_LINENO(n)
2129   
2130/* Return all but the first "n" matched characters back to the input stream. */
2131#define yyless(n) \
2132   do \
2133      { \
2134      /* Undo effects of setting up yytext. */ \
2135        int yyless_macro_arg = (n); \
2136        YY_LESS_LINENO(yyless_macro_arg);\
2137      *yy_cp = (yy_hold_char); \
2138      YY_RESTORE_YY_MORE_OFFSET \
2139      (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
2140      YY_DO_BEFORE_ACTION; /* set up yytext again */ \
2141      } \
2142   while ( 0 )
2143
2144#define unput(c) yyunput( c, (yytext_ptr)  )
2145
2146#ifndef YY_STRUCT_YY_BUFFER_STATE
2147#define YY_STRUCT_YY_BUFFER_STATE
2148struct yy_buffer_state
2149   {
2150   FILE *yy_input_file;
2151
2152   char *yy_ch_buf;     /* input buffer */
2153   char *yy_buf_pos;    /* current position in input buffer */
2154
2155   /* Size of input buffer in bytes, not including room for EOB
2156    * characters.
2157    */
2158   yy_size_t yy_buf_size;
2159
2160   /* Number of characters read into yy_ch_buf, not including EOB
2161    * characters.
2162    */
2163   yy_size_t yy_n_chars;
2164
2165   /* Whether we "own" the buffer - i.e., we know we created it,
2166    * and can realloc() it to grow it, and should free() it to
2167    * delete it.
2168    */
2169   int yy_is_our_buffer;
2170
2171   /* Whether this is an "interactive" input source; if so, and
2172    * if we're using stdio for input, then we want to use getc()
2173    * instead of fread(), to make sure we stop fetching input after
2174    * each newline.
2175    */
2176   int yy_is_interactive;
2177
2178   /* Whether we're considered to be at the beginning of a line.
2179    * If so, '^' rules will be active on the next match, otherwise
2180    * not.
2181    */
2182   int yy_at_bol;
2183
2184    int yy_bs_lineno; /**< The line count. */
2185    int yy_bs_column; /**< The column count. */
2186   
2187   /* Whether to try to fill the input buffer when we reach the
2188    * end of it.
2189    */
2190   int yy_fill_buffer;
2191
2192   int yy_buffer_status;
2193
2194#define YY_BUFFER_NEW 0
2195#define YY_BUFFER_NORMAL 1
2196   /* When an EOF's been seen but there's still some text to process
2197    * then we mark the buffer as YY_EOF_PENDING, to indicate that we
2198    * shouldn't try reading from the input source any more.  We might
2199    * still have a bunch of tokens to match, though, because of
2200    * possible backing-up.
2201    *
2202    * When we actually see the EOF, we change the status to "new"
2203    * (via yyrestart()), so that the user can continue scanning by
2204    * just pointing yyin at a new input file.
2205    */
2206#define YY_BUFFER_EOF_PENDING 2
2207
2208   };
2209#endif /* !YY_STRUCT_YY_BUFFER_STATE */
2210
2211/* Stack of input buffers. */
2212static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
2213static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
2214static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
2215
2216/* We provide macros for accessing buffer states in case in the
2217 * future we want to put the buffer states in a more general
2218 * "scanner state".
2219 *
2220 * Returns the top of the stack, or NULL.
2221 */
2222#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
2223                          ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
2224                          : NULL)
2225
2226/* Same as previous macro, but useful when we know that the buffer stack is not
2227 * NULL or when we need an lvalue. For internal use only.
2228 */
2229#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
2230
2231/* yy_hold_char holds the character lost when yytext is formed. */
2232static char yy_hold_char;
2233static yy_size_t yy_n_chars;     /* number of characters read into yy_ch_buf */
2234yy_size_t yyleng;
2235
2236/* Points to current character in buffer. */
2237static char *yy_c_buf_p = (char *) 0;
2238static int yy_init = 0;    /* whether we need to initialize */
2239static int yy_start = 0;   /* start state number */
2240
2241/* Flag which is used to allow yywrap()'s to do buffer switches
2242 * instead of setting up a fresh yyin.  A bit of a hack ...
2243 */
2244static int yy_did_buffer_switch_on_eof;
2245
2246void yyrestart (FILE *input_file  );
2247void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer  );
2248YY_BUFFER_STATE yy_create_buffer (FILE *file,int size  );
2249void yy_delete_buffer (YY_BUFFER_STATE b  );
2250void yy_flush_buffer (YY_BUFFER_STATE b  );
2251void yypush_buffer_state (YY_BUFFER_STATE new_buffer  );
2252void yypop_buffer_state (void );
2253
2254static void yyensure_buffer_stack (void );
2255static void yy_load_buffer_state (void );
2256static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file  );
2257
2258#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER )
2259
2260YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size  );
2261YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str  );
2262YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,yy_size_t len  );
2263
2264void *yyalloc (yy_size_t  );
2265void *yyrealloc (void *,yy_size_t  );
2266void yyfree (void *  );
2267
2268#define yy_new_buffer yy_create_buffer
2269
2270#define yy_set_interactive(is_interactive) \
2271   { \
2272   if ( ! YY_CURRENT_BUFFER ){ \
2273        yyensure_buffer_stack (); \
2274      YY_CURRENT_BUFFER_LVALUE =    \
2275            yy_create_buffer(yyin,YY_BUF_SIZE ); \
2276   } \
2277   YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
2278   }
2279
2280#define yy_set_bol(at_bol) \
2281   { \
2282   if ( ! YY_CURRENT_BUFFER ){\
2283        yyensure_buffer_stack (); \
2284      YY_CURRENT_BUFFER_LVALUE =    \
2285            yy_create_buffer(yyin,YY_BUF_SIZE ); \
2286   } \
2287   YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
2288   }
2289
2290#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
2291
2292/* Begin user sect3 */
2293
2294typedef unsigned char YY_CHAR;
2295
2296FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
2297
2298typedef int yy_state_type;
2299
2300extern int yylineno;
2301
2302int yylineno = 1;
2303
2304extern char *yytext;
2305#define yytext_ptr yytext
2306
2307static yy_state_type yy_get_previous_state (void );
2308static yy_state_type yy_try_NUL_trans (yy_state_type current_state  );
2309static int yy_get_next_buffer (void );
2310static void yy_fatal_error (yyconst char msg[]  );
2311
2312/* Done after the current pattern has been matched and before the
2313 * corresponding action - sets up yytext.
2314 */
2315#define YY_DO_BEFORE_ACTION \
2316   (yytext_ptr) = yy_bp; \
2317   yyleng = (size_t) (yy_cp - yy_bp); \
2318   (yy_hold_char) = *yy_cp; \
2319   *yy_cp = '\0'; \
2320   (yy_c_buf_p) = yy_cp;
2321
2322#define YY_NUM_RULES 12
2323#define YY_END_OF_BUFFER 13
2324/* This struct is not used in this scanner,
2325   but its presence is necessary. */
2326struct yy_trans_info
2327   {
2328   flex_int32_t yy_verify;
2329   flex_int32_t yy_nxt;
2330   };
2331static yyconst flex_int16_t yy_accept[77] =
2332    {   0,
2333        0,    0,    0,    0,   13,   12,   11,   10,   12,    9,
2334       12,   12,   12,    9,    8,    8,    8,    8,    8,    8,
2335       11,    0,    4,    7,    7,    7,    5,    8,    8,    8,
2336        8,    8,    8,    8,    6,    8,    8,    8,    8,    3,
2337        8,    8,    8,    8,    8,    8,    8,    8,    8,    8,
2338        8,    8,    8,    8,    8,    8,    8,    8,    8,    8,
2339        8,    8,    8,    8,    8,    2,    8,    8,    8,    1,
2340        8,    8,    8,    8,    6,    0
2341    } ;
2342
2343static yyconst flex_int32_t yy_ec[256] =
2344    {   0,
2345        1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
2346        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
2347        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
2348        1,    2,    1,    1,    1,    1,    4,    1,    1,    5,
2349        6,    1,    1,    7,    1,    1,    1,    8,    9,   10,
2350       11,    8,    8,    8,   12,    8,    8,   13,   14,    1,
2351        1,    1,    1,    1,   15,   16,   16,   17,   18,   19,
2352       20,   16,   21,   16,   16,   22,   23,   24,   25,   26,
2353       16,   27,   28,   29,   30,   16,   16,   31,   32,   16,
2354       33,    1,   34,    1,   35,    1,   36,   16,   16,   37,
2355
2356       38,   39,   40,   16,   41,   16,   16,   42,   43,   44,
2357       45,   46,   16,   47,   48,   49,   50,   16,   16,   51,
2358       52,   16,    1,    1,    1,    1,    1,    1,    1,    1,
2359        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
2360        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
2361        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
2362        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
2363        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
2364        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
2365        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
2366
2367        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
2368        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
2369        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
2370        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
2371        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
2372        1,    1,    1,    1,    1
2373    } ;
2374
2375static yyconst flex_int32_t yy_meta[53] =
2376    {   0,
2377        1,    1,    2,    1,    1,    1,    1,    3,    3,    3,
2378        3,    3,    1,    1,    3,    3,    3,    3,    3,    3,
2379        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
2380        3,    3,    1,    1,    3,    3,    3,    3,    3,    3,
2381        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
2382        3,    3
2383    } ;
2384
2385static yyconst flex_int16_t yy_base[79] =
2386    {   0,
2387        0,    0,    0,    0,  150,  164,  147,  164,  144,  164,
2388       36,   37,   38,  134,    0,   44,   32,   34,   44,   33,
2389      144,  141,  140,  164,  164,  164,  164,    0,  131,   31,
2390       34,   42,   39,   49,    0,   50,   49,   38,   56,    0,
2391       59,   52,  107,   68,  106,   72,   75,   72,   77,   81,
2392       79,   76,   75,   86,   73,   88,   85,   89,   90,   79,
2393       93,   86,   99,   97,  103,    0,   37,  115,  114,    0,
2394      108,  116,  121,  112,    0,  164,  160,   57
2395    } ;
2396
2397static yyconst flex_int16_t yy_def[79] =
2398    {   0,
2399       76,    1,    1,    1,   76,   76,   76,   76,   77,   76,
2400       76,   76,   76,   76,   78,   78,   78,   78,   78,   78,
2401       76,   77,   77,   76,   76,   76,   76,   78,   78,   78,
2402       78,   78,   78,   78,   78,   78,   78,   78,   78,   78,
2403       78,   78,   78,   78,   78,   78,   78,   78,   78,   78,
2404       78,   78,   78,   78,   78,   78,   78,   78,   78,   78,
2405       78,   78,   78,   78,   78,   78,   78,   78,   78,   78,
2406       78,   78,   78,   78,   78,    0,   76,   76
2407    } ;
2408
2409static yyconst flex_int16_t yy_nxt[217] =
2410    {   0,
2411        6,    7,    8,    9,   10,   10,   10,    6,   11,   12,
2412       13,    6,   14,   10,   15,   15,   15,   15,   16,   15,
2413       15,   15,   15,   17,   18,   19,   15,   15,   15,   20,
2414       15,   15,   10,   10,   15,   15,   15,   15,   16,   15,
2415       15,   15,   15,   17,   18,   19,   15,   15,   15,   20,
2416       15,   15,   24,   25,   26,   29,   31,   32,   33,   28,
2417       34,   36,   37,   38,   30,   39,   40,   41,   42,   43,
2418       44,   69,   24,   25,   26,   45,   31,   32,   46,   33,
2419       34,   36,   37,   38,   30,   39,   40,   41,   42,   43,
2420       48,   44,   50,   51,   52,   45,   53,   54,   46,   55,
2421
2422       56,   57,   58,   59,   60,   61,   62,   63,   64,   65,
2423       48,   66,   50,   51,   52,   67,   53,   54,   68,   55,
2424       56,   57,   58,   59,   60,   61,   62,   63,   64,   65,
2425       35,   66,   70,   71,   72,   67,   73,   74,   68,   75,
2426       49,   47,   35,   23,   23,   21,   27,   23,   21,   76,
2427       35,   76,   70,   71,   72,   76,   73,   74,   76,   75,
2428       22,   76,   22,    5,   76,   76,   76,   76,   76,   76,
2429       76,   76,   76,   76,   76,   76,   76,   76,   76,   76,
2430       76,   76,   76,   76,   76,   76,   76,   76,   76,   76,
2431       76,   76,   76,   76,   76,   76,   76,   76,   76,   76,
2432
2433       76,   76,   76,   76,   76,   76,   76,   76,   76,   76,
2434       76,   76,   76,   76,   76,   76
2435    } ;
2436
2437static yyconst flex_int16_t yy_chk[217] =
2438    {   0,
2439        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
2440        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
2441        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
2442        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
2443        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
2444        1,    1,   11,   12,   13,   16,   17,   18,   19,   78,
2445       20,   30,   31,   32,   16,   33,   34,   36,   37,   38,
2446       39,   67,   11,   12,   13,   41,   17,   18,   42,   19,
2447       20,   30,   31,   32,   16,   33,   34,   36,   37,   38,
2448       44,   39,   46,   47,   48,   41,   49,   50,   42,   51,
2449
2450       52,   53,   54,   55,   56,   57,   58,   59,   60,   61,
2451       44,   62,   46,   47,   48,   63,   49,   50,   64,   51,
2452       52,   53,   54,   55,   56,   57,   58,   59,   60,   61,
2453       65,   62,   68,   69,   71,   63,   72,   73,   64,   74,
2454       45,   43,   29,   23,   22,   21,   14,    9,    7,    5,
2455       65,    0,   68,   69,   71,    0,   72,   73,    0,   74,
2456       77,    0,   77,   76,   76,   76,   76,   76,   76,   76,
2457       76,   76,   76,   76,   76,   76,   76,   76,   76,   76,
2458       76,   76,   76,   76,   76,   76,   76,   76,   76,   76,
2459       76,   76,   76,   76,   76,   76,   76,   76,   76,   76,
2460
2461       76,   76,   76,   76,   76,   76,   76,   76,   76,   76,
2462       76,   76,   76,   76,   76,   76
2463    } ;
2464
2465static yy_state_type yy_last_accepting_state;
2466static char *yy_last_accepting_cpos;
2467
2468extern int yy_flex_debug;
2469int yy_flex_debug = 0;
2470
2471/* The intent behind this definition is that it'll catch
2472 * any uses of REJECT which flex missed.
2473 */
2474#define REJECT reject_used_but_not_detected
2475#define yymore() yymore_used_but_not_detected
2476#define YY_MORE_ADJ 0
2477#define YY_RESTORE_YY_MORE_OFFSET
2478char *yytext;
2479#line 1 "convert.lex"
2480/******************************************************************************/
2481/*                                                                            */
2482/*     CONV (converter) for Agrif (Adaptive Grid Refinement In Fortran)       */
2483/*                                                                            */
2484/* Copyright or   or Copr. Laurent Debreu (Laurent.Debreu@imag.fr)            */
2485/*                        Cyril Mazauric (Cyril_Mazauric@yahoo.fr)            */
2486/* This software is governed by the CeCILL-C license under French law and     */
2487/* abiding by the rules of distribution of free software.  You can  use,      */
2488/* modify and/ or redistribute the software under the terms of the CeCILL-C   */
2489/* license as circulated by CEA, CNRS and INRIA at the following URL          */
2490/* "http://www.cecill.info".                                                  */
2491/*                                                                            */
2492/* As a counterpart to the access to the source code and  rights to copy,     */
2493/* modify and redistribute granted by the license, users are provided only    */
2494/* with a limited warranty  and the software's author,  the holder of the     */
2495/* economic rights,  and the successive licensors  have only  limited         */
2496/* liability.                                                                 */
2497/*                                                                            */
2498/* In this respect, the user's attention is drawn to the risks associated     */
2499/* with loading,  using,  modifying and/or developing or reproducing the      */
2500/* software by the user in light of its specific status of free software,     */
2501/* that may mean  that it is complicated to manipulate,  and  that  also      */
2502/* therefore means  that it is reserved for developers  and  experienced      */
2503/* professionals having in-depth computer knowledge. Users are therefore      */
2504/* encouraged to load and test the software's suitability as regards their    */
2505/* requirements in conditions enabling the security of their systems and/or   */
2506/* data to be ensured and,  more generally, to use and operate it in the      */
2507/* same conditions as regards security.                                       */
2508/*                                                                            */
2509/* The fact that you are presently reading this means that you have had       */
2510/* knowledge of the CeCILL-C license and that you accept its terms.           */
2511/******************************************************************************/
2512/* version 1.7                                                                */
2513/******************************************************************************/
2514
2515#line 37 "convert.lex"
2516#include <math.h>
2517#include <stdlib.h>
2518#include <string.h>
2519int line_num=1;
2520extern FILE * yyin;
2521#define MAX_INCLUDE_DEPTH 30
2522YY_BUFFER_STATE include_stack[MAX_INCLUDE_DEPTH];
2523#line 565 "convert.yy.c"
2524
2525#define INITIAL 0
2526#define character 1
2527
2528#ifndef YY_NO_UNISTD_H
2529/* Special case for "unistd.h", since it is non-ANSI. We include it way
2530 * down here because we want the user's section 1 to have been scanned first.
2531 * The user has a chance to override it with an option.
2532 */
2533#include <unistd.h>
2534#endif
2535
2536#ifndef YY_EXTRA_TYPE
2537#define YY_EXTRA_TYPE void *
2538#endif
2539
2540static int yy_init_globals (void );
2541
2542/* Accessor methods to globals.
2543   These are made visible to non-reentrant scanners for convenience. */
2544
2545int yylex_destroy (void );
2546
2547int yyget_debug (void );
2548
2549void yyset_debug (int debug_flag  );
2550
2551YY_EXTRA_TYPE yyget_extra (void );
2552
2553void yyset_extra (YY_EXTRA_TYPE user_defined  );
2554
2555FILE *yyget_in (void );
2556
2557void yyset_in  (FILE * in_str  );
2558
2559FILE *yyget_out (void );
2560
2561void yyset_out  (FILE * out_str  );
2562
2563yy_size_t yyget_leng (void );
2564
2565char *yyget_text (void );
2566
2567int yyget_lineno (void );
2568
2569void yyset_lineno (int line_number  );
2570
2571/* Macros after this point can all be overridden by user definitions in
2572 * section 1.
2573 */
2574
2575#ifndef YY_SKIP_YYWRAP
2576#ifdef __cplusplus
2577extern "C" int yywrap (void );
2578#else
2579extern int yywrap (void );
2580#endif
2581#endif
2582
2583    static void yyunput (int c,char *buf_ptr  );
2584   
2585#ifndef yytext_ptr
2586static void yy_flex_strncpy (char *,yyconst char *,int );
2587#endif
2588
2589#ifdef YY_NEED_STRLEN
2590static int yy_flex_strlen (yyconst char * );
2591#endif
2592
2593#ifndef YY_NO_INPUT
2594
2595#ifdef __cplusplus
2596static int yyinput (void );
2597#else
2598static int input (void );
2599#endif
2600
2601#endif
2602
2603/* Amount of stuff to slurp up with each read. */
2604#ifndef YY_READ_BUF_SIZE
2605#define YY_READ_BUF_SIZE 8192
2606#endif
2607
2608/* Copy whatever the last rule matched to the standard output. */
2609#ifndef ECHO
2610/* This used to be an fputs(), but since the string might contain NUL's,
2611 * we now use fwrite().
2612 */
2613#define ECHO fwrite( yytext, yyleng, 1, yyout )
2614#endif
2615
2616/* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
2617 * is returned in "result".
2618 */
2619#ifndef YY_INPUT
2620#define YY_INPUT(buf,result,max_size) \
2621   if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
2622      { \
2623      int c = '*'; \
2624      yy_size_t n; \
2625      for ( n = 0; n < max_size && \
2626              (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
2627         buf[n] = (char) c; \
2628      if ( c == '\n' ) \
2629         buf[n++] = (char) c; \
2630      if ( c == EOF && ferror( yyin ) ) \
2631         YY_FATAL_ERROR( "input in flex scanner failed" ); \
2632      result = n; \
2633      } \
2634   else \
2635      { \
2636      errno=0; \
2637      while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
2638         { \
2639         if( errno != EINTR) \
2640            { \
2641            YY_FATAL_ERROR( "input in flex scanner failed" ); \
2642            break; \
2643            } \
2644         errno=0; \
2645         clearerr(yyin); \
2646         } \
2647      }\
2648\
2649
2650#endif
2651
2652/* No semi-colon after return; correct usage is to write "yyterminate();" -
2653 * we don't want an extra ';' after the "return" because that will cause
2654 * some compilers to complain about unreachable statements.
2655 */
2656#ifndef yyterminate
2657#define yyterminate() return YY_NULL
2658#endif
2659
2660/* Number of entries by which start-condition stack grows. */
2661#ifndef YY_START_STACK_INCR
2662#define YY_START_STACK_INCR 25
2663#endif
2664
2665/* Report a fatal error. */
2666#ifndef YY_FATAL_ERROR
2667#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
2668#endif
2669
2670/* end tables serialization structures and prototypes */
2671
2672/* Default declaration of generated scanner - a define so the user can
2673 * easily add parameters.
2674 */
2675#ifndef YY_DECL
2676#define YY_DECL_IS_OURS 1
2677
2678extern int yylex (void);
2679
2680#define YY_DECL int yylex (void)
2681#endif /* !YY_DECL */
2682
2683/* Code executed at the beginning of each rule, after yytext and yyleng
2684 * have been set up.
2685 */
2686#ifndef YY_USER_ACTION
2687#define YY_USER_ACTION
2688#endif
2689
2690/* Code executed at the end of each rule. */
2691#ifndef YY_BREAK
2692#define YY_BREAK break;
2693#endif
2694
2695#define YY_RULE_SETUP \
2696   YY_USER_ACTION
2697
2698/** The main scanner function which does all the work.
2699 */
2700YY_DECL
2701{
2702   register yy_state_type yy_current_state;
2703   register char *yy_cp, *yy_bp;
2704   register int yy_act;
2705   
2706#line 55 "convert.lex"
2707
2708#line 750 "convert.yy.c"
2709
2710   if ( !(yy_init) )
2711      {
2712      (yy_init) = 1;
2713
2714#ifdef YY_USER_INIT
2715      YY_USER_INIT;
2716#endif
2717
2718      if ( ! (yy_start) )
2719         (yy_start) = 1;   /* first start state */
2720
2721      if ( ! yyin )
2722         yyin = stdin;
2723
2724      if ( ! yyout )
2725         yyout = stdout;
2726
2727      if ( ! YY_CURRENT_BUFFER ) {
2728         yyensure_buffer_stack ();
2729         YY_CURRENT_BUFFER_LVALUE =
2730            yy_create_buffer(yyin,YY_BUF_SIZE );
2731      }
2732
2733      yy_load_buffer_state( );
2734      }
2735
2736   while ( 1 )    /* loops until end-of-file is reached */
2737      {
2738      yy_cp = (yy_c_buf_p);
2739
2740      /* Support of yytext. */
2741      *yy_cp = (yy_hold_char);
2742
2743      /* yy_bp points to the position in yy_ch_buf of the start of
2744       * the current run.
2745       */
2746      yy_bp = yy_cp;
2747
2748      yy_current_state = (yy_start);
2749yy_match:
2750      do
2751         {
2752         register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
2753         if ( yy_accept[yy_current_state] )
2754            {
2755            (yy_last_accepting_state) = yy_current_state;
2756            (yy_last_accepting_cpos) = yy_cp;
2757            }
2758         while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2759            {
2760            yy_current_state = (int) yy_def[yy_current_state];
2761            if ( yy_current_state >= 77 )
2762               yy_c = yy_meta[(unsigned int) yy_c];
2763            }
2764         yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
2765         ++yy_cp;
2766         }
2767      while ( yy_base[yy_current_state] != 164 );
2768
2769yy_find_action:
2770      yy_act = yy_accept[yy_current_state];
2771      if ( yy_act == 0 )
2772         { /* have to back up */
2773         yy_cp = (yy_last_accepting_cpos);
2774         yy_current_state = (yy_last_accepting_state);
2775         yy_act = yy_accept[yy_current_state];
2776         }
2777
2778      YY_DO_BEFORE_ACTION;
2779
2780do_action:  /* This label is used only to access EOF actions. */
2781
2782      switch ( yy_act )
2783   { /* beginning of action switch */
2784         case 0: /* must back up */
2785         /* undo the effects of YY_DO_BEFORE_ACTION */
2786         *yy_cp = (yy_hold_char);
2787         yy_cp = (yy_last_accepting_cpos);
2788         yy_current_state = (yy_last_accepting_state);
2789         goto yy_find_action;
2790
2791case 1:
2792YY_RULE_SETUP
2793#line 56 "convert.lex"
2794return TOK_MODULEMAIN; /* name of the module                      */
2795   YY_BREAK
2796case 2:
2797YY_RULE_SETUP
2798#line 57 "convert.lex"
2799return TOK_NOTGRIDDEP; /* variable which are not grid dependent   */
2800   YY_BREAK
2801case 3:
2802YY_RULE_SETUP
2803#line 58 "convert.lex"
2804return TOK_USE;
2805   YY_BREAK
2806case 4:
2807YY_RULE_SETUP
2808#line 59 "convert.lex"
2809{}
2810   YY_BREAK
2811case 5:
2812YY_RULE_SETUP
2813#line 60 "convert.lex"
2814return TOK_SEP;
2815   YY_BREAK
2816case 6:
2817YY_RULE_SETUP
2818#line 61 "convert.lex"
2819{strcpy(yylval.na,yytext); return TOK_USEITEM;}
2820   YY_BREAK
2821case 7:
2822YY_RULE_SETUP
2823#line 62 "convert.lex"
2824{strcpy(yylval.na,yytext); return TOK_PROBTYPE;}
2825   YY_BREAK
2826/* dimension of the problem                */
2827case 8:
2828YY_RULE_SETUP
2829#line 64 "convert.lex"
2830{strcpy(yylval.na,yytext); return TOK_NAME;}
2831   YY_BREAK
2832case 9:
2833YY_RULE_SETUP
2834#line 65 "convert.lex"
2835{return (int) *yytext;}
2836   YY_BREAK
2837case 10:
2838/* rule 10 can match eol */
2839YY_RULE_SETUP
2840#line 66 "convert.lex"
2841{line_num++;return (int) *yytext;}
2842   YY_BREAK
2843case 11:
2844YY_RULE_SETUP
2845#line 67 "convert.lex"
2846;
2847   YY_BREAK
2848case 12:
2849YY_RULE_SETUP
2850#line 68 "convert.lex"
2851ECHO;
2852   YY_BREAK
2853#line 895 "convert.yy.c"
2854case YY_STATE_EOF(INITIAL):
2855case YY_STATE_EOF(character):
2856   yyterminate();
2857
2858   case YY_END_OF_BUFFER:
2859      {
2860      /* Amount of text matched not including the EOB char. */
2861      int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
2862
2863      /* Undo the effects of YY_DO_BEFORE_ACTION. */
2864      *yy_cp = (yy_hold_char);
2865      YY_RESTORE_YY_MORE_OFFSET
2866
2867      if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
2868         {
2869         /* We're scanning a new file or input source.  It's
2870          * possible that this happened because the user
2871          * just pointed yyin at a new source and called
2872          * yylex().  If so, then we have to assure
2873          * consistency between YY_CURRENT_BUFFER and our
2874          * globals.  Here is the right place to do so, because
2875          * this is the first action (other than possibly a
2876          * back-up) that will match for the new input source.
2877          */
2878         (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
2879         YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
2880         YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
2881         }
2882
2883      /* Note that here we test for yy_c_buf_p "<=" to the position
2884       * of the first EOB in the buffer, since yy_c_buf_p will
2885       * already have been incremented past the NUL character
2886       * (since all states make transitions on EOB to the
2887       * end-of-buffer state).  Contrast this with the test
2888       * in input().
2889       */
2890      if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
2891         { /* This was really a NUL. */
2892         yy_state_type yy_next_state;
2893
2894         (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
2895
2896         yy_current_state = yy_get_previous_state(  );
2897
2898         /* Okay, we're now positioned to make the NUL
2899          * transition.  We couldn't have
2900          * yy_get_previous_state() go ahead and do it
2901          * for us because it doesn't know how to deal
2902          * with the possibility of jamming (and we don't
2903          * want to build jamming into it because then it
2904          * will run more slowly).
2905          */
2906
2907         yy_next_state = yy_try_NUL_trans( yy_current_state );
2908
2909         yy_bp = (yytext_ptr) + YY_MORE_ADJ;
2910
2911         if ( yy_next_state )
2912            {
2913            /* Consume the NUL. */
2914            yy_cp = ++(yy_c_buf_p);
2915            yy_current_state = yy_next_state;
2916            goto yy_match;
2917            }
2918
2919         else
2920            {
2921            yy_cp = (yy_c_buf_p);
2922            goto yy_find_action;
2923            }
2924         }
2925
2926      else switch ( yy_get_next_buffer(  ) )
2927         {
2928         case EOB_ACT_END_OF_FILE:
2929            {
2930            (yy_did_buffer_switch_on_eof) = 0;
2931
2932            if ( yywrap( ) )
2933               {
2934               /* Note: because we've taken care in
2935                * yy_get_next_buffer() to have set up
2936                * yytext, we can now set up
2937                * yy_c_buf_p so that if some total
2938                * hoser (like flex itself) wants to
2939                * call the scanner after we return the
2940                * YY_NULL, it'll still work - another
2941                * YY_NULL will get returned.
2942                */
2943               (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
2944
2945               yy_act = YY_STATE_EOF(YY_START);
2946               goto do_action;
2947               }
2948
2949            else
2950               {
2951               if ( ! (yy_did_buffer_switch_on_eof) )
2952                  YY_NEW_FILE;
2953               }
2954            break;
2955            }
2956
2957         case EOB_ACT_CONTINUE_SCAN:
2958            (yy_c_buf_p) =
2959               (yytext_ptr) + yy_amount_of_matched_text;
2960
2961            yy_current_state = yy_get_previous_state(  );
2962
2963            yy_cp = (yy_c_buf_p);
2964            yy_bp = (yytext_ptr) + YY_MORE_ADJ;
2965            goto yy_match;
2966
2967         case EOB_ACT_LAST_MATCH:
2968            (yy_c_buf_p) =
2969            &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
2970
2971            yy_current_state = yy_get_previous_state(  );
2972
2973            yy_cp = (yy_c_buf_p);
2974            yy_bp = (yytext_ptr) + YY_MORE_ADJ;
2975            goto yy_find_action;
2976         }
2977      break;
2978      }
2979
2980   default:
2981      YY_FATAL_ERROR(
2982         "fatal flex scanner internal error--no action found" );
2983   } /* end of action switch */
2984      } /* end of scanning one token */
2985} /* end of yylex */
2986
2987/* yy_get_next_buffer - try to read in a new buffer
2988 *
2989 * Returns a code representing an action:
2990 * EOB_ACT_LAST_MATCH -
2991 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
2992 * EOB_ACT_END_OF_FILE - end of file
2993 */
2994static int yy_get_next_buffer (void)
2995{
2996      register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
2997   register char *source = (yytext_ptr);
2998   register int number_to_move, i;
2999   int ret_val;
3000
3001   if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
3002      YY_FATAL_ERROR(
3003      "fatal flex scanner internal error--end of buffer missed" );
3004
3005   if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
3006      { /* Don't try to fill the buffer, so this is an EOF. */
3007      if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
3008         {
3009         /* We matched a single character, the EOB, so
3010          * treat this as a final EOF.
3011          */
3012         return EOB_ACT_END_OF_FILE;
3013         }
3014
3015      else
3016         {
3017         /* We matched some text prior to the EOB, first
3018          * process it.
3019          */
3020         return EOB_ACT_LAST_MATCH;
3021         }
3022      }
3023
3024   /* Try to read more data. */
3025
3026   /* First move last chars to start of buffer. */
3027   number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
3028
3029   for ( i = 0; i < number_to_move; ++i )
3030      *(dest++) = *(source++);
3031
3032   if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
3033      /* don't do the read, it's not guaranteed to return an EOF,
3034       * just force an EOF
3035       */
3036      YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
3037
3038   else
3039      {
3040         yy_size_t num_to_read =
3041         YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
3042
3043      while ( num_to_read <= 0 )
3044         { /* Not enough room in the buffer - grow it. */
3045
3046         /* just a shorter name for the current buffer */
3047         YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
3048
3049         int yy_c_buf_p_offset =
3050            (int) ((yy_c_buf_p) - b->yy_ch_buf);
3051
3052         if ( b->yy_is_our_buffer )
3053            {
3054            yy_size_t new_size = b->yy_buf_size * 2;
3055
3056            if ( new_size <= 0 )
3057               b->yy_buf_size += b->yy_buf_size / 8;
3058            else
3059               b->yy_buf_size *= 2;
3060
3061            b->yy_ch_buf = (char *)
3062               /* Include room in for 2 EOB chars. */
3063               yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2  );
3064            }
3065         else
3066            /* Can't grow it, we don't own it. */
3067            b->yy_ch_buf = 0;
3068
3069         if ( ! b->yy_ch_buf )
3070            YY_FATAL_ERROR(
3071            "fatal error - scanner input buffer overflow" );
3072
3073         (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
3074
3075         num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
3076                  number_to_move - 1;
3077
3078         }
3079
3080      if ( num_to_read > YY_READ_BUF_SIZE )
3081         num_to_read = YY_READ_BUF_SIZE;
3082
3083      /* Read in more data. */
3084      YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
3085         (yy_n_chars), num_to_read );
3086
3087      YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
3088      }
3089
3090   if ( (yy_n_chars) == 0 )
3091      {
3092      if ( number_to_move == YY_MORE_ADJ )
3093         {
3094         ret_val = EOB_ACT_END_OF_FILE;
3095         yyrestart(yyin  );
3096         }
3097
3098      else
3099         {
3100         ret_val = EOB_ACT_LAST_MATCH;
3101         YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
3102            YY_BUFFER_EOF_PENDING;
3103         }
3104      }
3105
3106   else
3107      ret_val = EOB_ACT_CONTINUE_SCAN;
3108
3109   if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
3110      /* Extend the array by 50%, plus the number we really need. */
3111      yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
3112      YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size  );
3113      if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
3114         YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
3115   }
3116
3117   (yy_n_chars) += number_to_move;
3118   YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
3119   YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
3120
3121   (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
3122
3123   return ret_val;
3124}
3125
3126/* yy_get_previous_state - get the state just before the EOB char was reached */
3127
3128    static yy_state_type yy_get_previous_state (void)
3129{
3130   register yy_state_type yy_current_state;
3131   register char *yy_cp;
3132   
3133   yy_current_state = (yy_start);
3134
3135   for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
3136      {
3137      register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
3138      if ( yy_accept[yy_current_state] )
3139         {
3140         (yy_last_accepting_state) = yy_current_state;
3141         (yy_last_accepting_cpos) = yy_cp;
3142         }
3143      while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
3144         {
3145         yy_current_state = (int) yy_def[yy_current_state];
3146         if ( yy_current_state >= 77 )
3147            yy_c = yy_meta[(unsigned int) yy_c];
3148         }
3149      yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
3150      }
3151
3152   return yy_current_state;
3153}
3154
3155/* yy_try_NUL_trans - try to make a transition on the NUL character
3156 *
3157 * synopsis
3158 * next_state = yy_try_NUL_trans( current_state );
3159 */
3160    static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state )
3161{
3162   register int yy_is_jam;
3163      register char *yy_cp = (yy_c_buf_p);
3164
3165   register YY_CHAR yy_c = 1;
3166   if ( yy_accept[yy_current_state] )
3167      {
3168      (yy_last_accepting_state) = yy_current_state;
3169      (yy_last_accepting_cpos) = yy_cp;
3170      }
3171   while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
3172      {
3173      yy_current_state = (int) yy_def[yy_current_state];
3174      if ( yy_current_state >= 77 )
3175         yy_c = yy_meta[(unsigned int) yy_c];
3176      }
3177   yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
3178   yy_is_jam = (yy_current_state == 76);
3179
3180   return yy_is_jam ? 0 : yy_current_state;
3181}
3182
3183    static void yyunput (int c, register char * yy_bp )
3184{
3185   register char *yy_cp;
3186   
3187    yy_cp = (yy_c_buf_p);
3188
3189   /* undo effects of setting up yytext */
3190   *yy_cp = (yy_hold_char);
3191
3192   if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
3193      { /* need to shift things up to make room */
3194      /* +2 for EOB chars. */
3195      register yy_size_t number_to_move = (yy_n_chars) + 2;
3196      register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
3197               YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
3198      register char *source =
3199            &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
3200
3201      while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
3202         *--dest = *--source;
3203
3204      yy_cp += (int) (dest - source);
3205      yy_bp += (int) (dest - source);
3206      YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
3207         (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
3208
3209      if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
3210         YY_FATAL_ERROR( "flex scanner push-back overflow" );
3211      }
3212
3213   *--yy_cp = (char) c;
3214
3215   (yytext_ptr) = yy_bp;
3216   (yy_hold_char) = *yy_cp;
3217   (yy_c_buf_p) = yy_cp;
3218}
3219
3220#ifndef YY_NO_INPUT
3221#ifdef __cplusplus
3222    static int yyinput (void)
3223#else
3224    static int input  (void)
3225#endif
3226
3227{
3228   int c;
3229   
3230   *(yy_c_buf_p) = (yy_hold_char);
3231
3232   if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
3233      {
3234      /* yy_c_buf_p now points to the character we want to return.
3235       * If this occurs *before* the EOB characters, then it's a
3236       * valid NUL; if not, then we've hit the end of the buffer.
3237       */
3238      if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
3239         /* This was really a NUL. */
3240         *(yy_c_buf_p) = '\0';
3241
3242      else
3243         { /* need more input */
3244         yy_size_t offset = (yy_c_buf_p) - (yytext_ptr);
3245         ++(yy_c_buf_p);
3246
3247         switch ( yy_get_next_buffer(  ) )
3248            {
3249            case EOB_ACT_LAST_MATCH:
3250               /* This happens because yy_g_n_b()
3251                * sees that we've accumulated a
3252                * token and flags that we need to
3253                * try matching the token before
3254                * proceeding.  But for input(),
3255                * there's no matching to consider.
3256                * So convert the EOB_ACT_LAST_MATCH
3257                * to EOB_ACT_END_OF_FILE.
3258                */
3259
3260               /* Reset buffer status. */
3261               yyrestart(yyin );
3262
3263               /*FALLTHROUGH*/
3264
3265            case EOB_ACT_END_OF_FILE:
3266               {
3267               if ( yywrap( ) )
3268                  return 0;
3269
3270               if ( ! (yy_did_buffer_switch_on_eof) )
3271                  YY_NEW_FILE;
3272#ifdef __cplusplus
3273               return yyinput();
3274#else
3275               return input();
3276#endif
3277               }
3278
3279            case EOB_ACT_CONTINUE_SCAN:
3280               (yy_c_buf_p) = (yytext_ptr) + offset;
3281               break;
3282            }
3283         }
3284      }
3285
3286   c = *(unsigned char *) (yy_c_buf_p);   /* cast for 8-bit char's */
3287   *(yy_c_buf_p) = '\0';   /* preserve yytext */
3288   (yy_hold_char) = *++(yy_c_buf_p);
3289
3290   return c;
3291}
3292#endif   /* ifndef YY_NO_INPUT */
3293
3294/** Immediately switch to a different input stream.
3295 * @param input_file A readable stream.
3296 *
3297 * @note This function does not reset the start condition to @c INITIAL .
3298 */
3299    void yyrestart  (FILE * input_file )
3300{
3301   
3302   if ( ! YY_CURRENT_BUFFER ){
3303        yyensure_buffer_stack ();
3304      YY_CURRENT_BUFFER_LVALUE =
3305            yy_create_buffer(yyin,YY_BUF_SIZE );
3306   }
3307
3308   yy_init_buffer(YY_CURRENT_BUFFER,input_file );
3309   yy_load_buffer_state( );
3310}
3311
3312/** Switch to a different input buffer.
3313 * @param new_buffer The new input buffer.
3314 *
3315 */
3316    void yy_switch_to_buffer  (YY_BUFFER_STATE  new_buffer )
3317{
3318   
3319   /* TODO. We should be able to replace this entire function body
3320    * with
3321    *    yypop_buffer_state();
3322    *    yypush_buffer_state(new_buffer);
3323     */
3324   yyensure_buffer_stack ();
3325   if ( YY_CURRENT_BUFFER == new_buffer )
3326      return;
3327
3328   if ( YY_CURRENT_BUFFER )
3329      {
3330      /* Flush out information for old buffer. */
3331      *(yy_c_buf_p) = (yy_hold_char);
3332      YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
3333      YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
3334      }
3335
3336   YY_CURRENT_BUFFER_LVALUE = new_buffer;
3337   yy_load_buffer_state( );
3338
3339   /* We don't actually know whether we did this switch during
3340    * EOF (yywrap()) processing, but the only time this flag
3341    * is looked at is after yywrap() is called, so it's safe
3342    * to go ahead and always set it.
3343    */
3344   (yy_did_buffer_switch_on_eof) = 1;
3345}
3346
3347static void yy_load_buffer_state  (void)
3348{
3349      (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
3350   (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
3351   yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
3352   (yy_hold_char) = *(yy_c_buf_p);
3353}
3354
3355/** Allocate and initialize an input buffer state.
3356 * @param file A readable stream.
3357 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
3358 *
3359 * @return the allocated buffer state.
3360 */
3361    YY_BUFFER_STATE yy_create_buffer  (FILE * file, int  size )
3362{
3363   YY_BUFFER_STATE b;
3364   
3365   b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state )  );
3366   if ( ! b )
3367      YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
3368
3369   b->yy_buf_size = size;
3370
3371   /* yy_ch_buf has to be 2 characters longer than the size given because
3372    * we need to put in 2 end-of-buffer characters.
3373    */
3374   b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2  );
3375   if ( ! b->yy_ch_buf )
3376      YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
3377
3378   b->yy_is_our_buffer = 1;
3379
3380   yy_init_buffer(b,file );
3381
3382   return b;
3383}
3384
3385/** Destroy the buffer.
3386 * @param b a buffer created with yy_create_buffer()
3387 *
3388 */
3389    void yy_delete_buffer (YY_BUFFER_STATE  b )
3390{
3391   
3392   if ( ! b )
3393      return;
3394
3395   if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
3396      YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
3397
3398   if ( b->yy_is_our_buffer )
3399      yyfree((void *) b->yy_ch_buf  );
3400
3401   yyfree((void *) b  );
3402}
3403
3404#ifndef __cplusplus
3405extern int isatty (int );
3406#endif /* __cplusplus */
3407   
3408/* Initializes or reinitializes a buffer.
3409 * This function is sometimes called more than once on the same buffer,
3410 * such as during a yyrestart() or at EOF.
3411 */
3412    static void yy_init_buffer  (YY_BUFFER_STATE  b, FILE * file )
3413
3414{
3415   int oerrno = errno;
3416   
3417   yy_flush_buffer(b );
3418
3419   b->yy_input_file = file;
3420   b->yy_fill_buffer = 1;
3421
3422    /* If b is the current buffer, then yy_init_buffer was _probably_
3423     * called from yyrestart() or through yy_get_next_buffer.
3424     * In that case, we don't want to reset the lineno or column.
3425     */
3426    if (b != YY_CURRENT_BUFFER){
3427        b->yy_bs_lineno = 1;
3428        b->yy_bs_column = 0;
3429    }
3430
3431        b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
3432   
3433   errno = oerrno;
3434}
3435
3436/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
3437 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
3438 *
3439 */
3440    void yy_flush_buffer (YY_BUFFER_STATE  b )
3441{
3442      if ( ! b )
3443      return;
3444
3445   b->yy_n_chars = 0;
3446
3447   /* We always need two end-of-buffer characters.  The first causes
3448    * a transition to the end-of-buffer state.  The second causes
3449    * a jam in that state.
3450    */
3451   b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
3452   b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
3453
3454   b->yy_buf_pos = &b->yy_ch_buf[0];
3455
3456   b->yy_at_bol = 1;
3457   b->yy_buffer_status = YY_BUFFER_NEW;
3458
3459   if ( b == YY_CURRENT_BUFFER )
3460      yy_load_buffer_state( );
3461}
3462
3463/** Pushes the new state onto the stack. The new state becomes
3464 *  the current state. This function will allocate the stack
3465 *  if necessary.
3466 *  @param new_buffer The new state.
3467 * 
3468 */
3469void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
3470{
3471      if (new_buffer == NULL)
3472      return;
3473
3474   yyensure_buffer_stack();
3475
3476   /* This block is copied from yy_switch_to_buffer. */
3477   if ( YY_CURRENT_BUFFER )
3478      {
3479      /* Flush out information for old buffer. */
3480      *(yy_c_buf_p) = (yy_hold_char);
3481      YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
3482      YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
3483      }
3484
3485   /* Only push if top exists. Otherwise, replace top. */
3486   if (YY_CURRENT_BUFFER)
3487      (yy_buffer_stack_top)++;
3488   YY_CURRENT_BUFFER_LVALUE = new_buffer;
3489
3490   /* copied from yy_switch_to_buffer. */
3491   yy_load_buffer_state( );
3492   (yy_did_buffer_switch_on_eof) = 1;
3493}
3494
3495/** Removes and deletes the top of the stack, if present.
3496 *  The next element becomes the new top.
3497 * 
3498 */
3499void yypop_buffer_state (void)
3500{
3501      if (!YY_CURRENT_BUFFER)
3502      return;
3503
3504   yy_delete_buffer(YY_CURRENT_BUFFER );
3505   YY_CURRENT_BUFFER_LVALUE = NULL;
3506   if ((yy_buffer_stack_top) > 0)
3507      --(yy_buffer_stack_top);
3508
3509   if (YY_CURRENT_BUFFER) {
3510      yy_load_buffer_state( );
3511      (yy_did_buffer_switch_on_eof) = 1;
3512   }
3513}
3514
3515/* Allocates the stack if it does not exist.
3516 *  Guarantees space for at least one push.
3517 */
3518static void yyensure_buffer_stack (void)
3519{
3520   yy_size_t num_to_alloc;
3521   
3522   if (!(yy_buffer_stack)) {
3523
3524      /* First allocation is just for 2 elements, since we don't know if this
3525       * scanner will even need a stack. We use 2 instead of 1 to avoid an
3526       * immediate realloc on the next call.
3527         */
3528      num_to_alloc = 1;
3529      (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
3530                        (num_to_alloc * sizeof(struct yy_buffer_state*)
3531                        );
3532      if ( ! (yy_buffer_stack) )
3533         YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
3534                         
3535      memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
3536           
3537      (yy_buffer_stack_max) = num_to_alloc;
3538      (yy_buffer_stack_top) = 0;
3539      return;
3540   }
3541
3542   if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
3543
3544      /* Increase the buffer to prepare for a possible push. */
3545      int grow_size = 8 /* arbitrary grow size */;
3546
3547      num_to_alloc = (yy_buffer_stack_max) + grow_size;
3548      (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
3549                        ((yy_buffer_stack),
3550                        num_to_alloc * sizeof(struct yy_buffer_state*)
3551                        );
3552      if ( ! (yy_buffer_stack) )
3553         YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
3554
3555      /* zero only the new slots.*/
3556      memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
3557      (yy_buffer_stack_max) = num_to_alloc;
3558   }
3559}
3560
3561/** Setup the input buffer state to scan directly from a user-specified character buffer.
3562 * @param base the character buffer
3563 * @param size the size in bytes of the character buffer
3564 *
3565 * @return the newly allocated buffer state object.
3566 */
3567YY_BUFFER_STATE yy_scan_buffer  (char * base, yy_size_t  size )
3568{
3569   YY_BUFFER_STATE b;
3570   
3571   if ( size < 2 ||
3572        base[size-2] != YY_END_OF_BUFFER_CHAR ||
3573        base[size-1] != YY_END_OF_BUFFER_CHAR )
3574      /* They forgot to leave room for the EOB's. */
3575      return 0;
3576
3577   b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state )  );
3578   if ( ! b )
3579      YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
3580
3581   b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
3582   b->yy_buf_pos = b->yy_ch_buf = base;
3583   b->yy_is_our_buffer = 0;
3584   b->yy_input_file = 0;
3585   b->yy_n_chars = b->yy_buf_size;
3586   b->yy_is_interactive = 0;
3587   b->yy_at_bol = 1;
3588   b->yy_fill_buffer = 0;
3589   b->yy_buffer_status = YY_BUFFER_NEW;
3590
3591   yy_switch_to_buffer();
3592
3593   return b;
3594}
3595
3596/** Setup the input buffer state to scan a string. The next call to yylex() will
3597 * scan from a @e copy of @a str.
3598 * @param yystr a NUL-terminated string to scan
3599 *
3600 * @return the newly allocated buffer state object.
3601 * @note If you want to scan bytes that may contain NUL values, then use
3602 *       yy_scan_bytes() instead.
3603 */
3604YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
3605{
3606   
3607   return yy_scan_bytes(yystr,strlen(yystr) );
3608}
3609
3610/** Setup the input buffer state to scan the given bytes. The next call to yylex() will
3611 * scan from a @e copy of @a bytes.
3612 * @param bytes the byte buffer to scan
3613 * @param len the number of bytes in the buffer pointed to by @a bytes.
3614 *
3615 * @return the newly allocated buffer state object.
3616 */
3617YY_BUFFER_STATE yy_scan_bytes  (yyconst char * yybytes, yy_size_t  _yybytes_len )
3618{
3619   YY_BUFFER_STATE b;
3620   char *buf;
3621   yy_size_t n, i;
3622   
3623   /* Get memory for full buffer, including space for trailing EOB's. */
3624   n = _yybytes_len + 2;
3625   buf = (char *) yyalloc();
3626   if ( ! buf )
3627      YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
3628
3629   for ( i = 0; i < _yybytes_len; ++i )
3630      buf[i] = yybytes[i];
3631
3632   buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
3633
3634   b = yy_scan_buffer(buf,n );
3635   if ( ! b )
3636      YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
3637
3638   /* It's okay to grow etc. this buffer, and we should throw it
3639    * away when we're done.
3640    */
3641   b->yy_is_our_buffer = 1;
3642
3643   return b;
3644}
3645
3646#ifndef YY_EXIT_FAILURE
3647#define YY_EXIT_FAILURE 2
3648#endif
3649
3650static void yy_fatal_error (yyconst char* msg )
3651{
3652      (void) fprintf( stderr, "%s\n", msg );
3653   exit( YY_EXIT_FAILURE );
3654}
3655
3656/* Redefine yyless() so it works in section 3 code. */
3657
3658#undef yyless
3659#define yyless(n) \
3660   do \
3661      { \
3662      /* Undo effects of setting up yytext. */ \
3663        int yyless_macro_arg = (n); \
3664        YY_LESS_LINENO(yyless_macro_arg);\
3665      yytext[yyleng] = (yy_hold_char); \
3666      (yy_c_buf_p) = yytext + yyless_macro_arg; \
3667      (yy_hold_char) = *(yy_c_buf_p); \
3668      *(yy_c_buf_p) = '\0'; \
3669      yyleng = yyless_macro_arg; \
3670      } \
3671   while ( 0 )
3672
3673/* Accessor  methods (get/set functions) to struct members. */
3674
3675/** Get the current line number.
3676 *
3677 */
3678int yyget_lineno  (void)
3679{
3680       
3681    return yylineno;
3682}
3683
3684/** Get the input stream.
3685 *
3686 */
3687FILE *yyget_in  (void)
3688{
3689        return yyin;
3690}
3691
3692/** Get the output stream.
3693 *
3694 */
3695FILE *yyget_out  (void)
3696{
3697        return yyout;
3698}
3699
3700/** Get the length of the current token.
3701 *
3702 */
3703yy_size_t yyget_leng  (void)
3704{
3705        return yyleng;
3706}
3707
3708/** Get the current token.
3709 *
3710 */
3711
3712char *yyget_text  (void)
3713{
3714        return yytext;
3715}
3716
3717/** Set the current line number.
3718 * @param line_number
3719 *
3720 */
3721void yyset_lineno (int  line_number )
3722{
3723   
3724    yylineno = line_number;
3725}
3726
3727/** Set the input stream. This does not discard the current
3728 * input buffer.
3729 * @param in_str A readable stream.
3730 *
3731 * @see yy_switch_to_buffer
3732 */
3733void yyset_in (FILE *  in_str )
3734{
3735        yyin = in_str ;
3736}
3737
3738void yyset_out (FILE *  out_str )
3739{
3740        yyout = out_str ;
3741}
3742
3743int yyget_debug  (void)
3744{
3745        return yy_flex_debug;
3746}
3747
3748void yyset_debug (int  bdebug )
3749{
3750        yy_flex_debug = bdebug ;
3751}
3752
3753static int yy_init_globals (void)
3754{
3755        /* Initialization is the same as for the non-reentrant scanner.
3756     * This function is called from yylex_destroy(), so don't allocate here.
3757     */
3758
3759    (yy_buffer_stack) = 0;
3760    (yy_buffer_stack_top) = 0;
3761    (yy_buffer_stack_max) = 0;
3762    (yy_c_buf_p) = (char *) 0;
3763    (yy_init) = 0;
3764    (yy_start) = 0;
3765
3766/* Defined in main.c */
3767#ifdef YY_STDINIT
3768    yyin = stdin;
3769    yyout = stdout;
3770#else
3771    yyin = (FILE *) 0;
3772    yyout = (FILE *) 0;
3773#endif
3774
3775    /* For future reference: Set errno on error, since we are called by
3776     * yylex_init()
3777     */
3778    return 0;
3779}
3780
3781/* yylex_destroy is for both reentrant and non-reentrant scanners. */
3782int yylex_destroy  (void)
3783{
3784   
3785    /* Pop the buffer stack, destroying each element. */
3786   while(YY_CURRENT_BUFFER){
3787      yy_delete_buffer(YY_CURRENT_BUFFER  );
3788      YY_CURRENT_BUFFER_LVALUE = NULL;
3789      yypop_buffer_state();
3790   }
3791
3792   /* Destroy the stack itself. */
3793   yyfree((yy_buffer_stack) );
3794   (yy_buffer_stack) = NULL;
3795
3796    /* Reset the globals. This is important in a non-reentrant scanner so the next time
3797     * yylex() is called, initialization will occur. */
3798    yy_init_globals( );
3799
3800    return 0;
3801}
3802
3803/*
3804 * Internal utility routines.
3805 */
3806
3807#ifndef yytext_ptr
3808static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
3809{
3810   register int i;
3811   for ( i = 0; i < n; ++i )
3812      s1[i] = s2[i];
3813}
3814#endif
3815
3816#ifdef YY_NEED_STRLEN
3817static int yy_flex_strlen (yyconst char * s )
3818{
3819   register int n;
3820   for ( n = 0; s[n]; ++n )
3821      ;
3822
3823   return n;
3824}
3825#endif
3826
3827void *yyalloc (yy_size_t  size )
3828{
3829   return (void *) malloc( size );
3830}
3831
3832void *yyrealloc  (void * ptr, yy_size_t  size )
3833{
3834   /* The cast to (char *) in the following accommodates both
3835    * implementations that use char* generic pointers, and those
3836    * that use void* generic pointers.  It works with the latter
3837    * because both ANSI C and C++ allow castless assignment from
3838    * any pointer type to void*, and deal with argument conversions
3839    * as though doing an assignment.
3840    */
3841   return (void *) realloc( (char *) ptr, size );
3842}
3843
3844void yyfree (void * ptr )
3845{
3846   free( (char *) ptr );   /* see yyrealloc() for (char *) cast */
3847}
3848
3849#define YYTABLES_NAME "yytables"
3850
3851#line 68 "convert.lex"
3852
3853
3854
3855
3856int yywrap()
3857{
3858}
3859
3860
3861yyerror(char *s)
3862{
3863if (!strcasecmp(curfile,mainfile))
3864{
3865   printf("Dans convert %s line %d, fichier %s\n",s,line_num,curfile);
3866}
3867else
3868{
3869   printf("Dans convert %s line %d, fichier %s\n",s,line_num,curfile);
3870}
3871exit(0);
3872}
3873
Note: See TracBrowser for help on using the repository browser.