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

source: vendors/AGRIF/dev_r12970_AGRIF_CMEMS/LIB/main.c @ 13027

Last change on this file since 13027 was 13027, checked in by rblod, 4 years ago

New AGRIF library, see ticket #2129

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