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

source: vendors/AGRIF/dev/LIB/main.c @ 12420

Last change on this file since 12420 was 12420, checked in by smueller, 4 years ago

Reintegration of the AGRIF development branch associated with NEMO development branch 2019/dev_r11613_ENHANCE-04_namelists_as_internalfiles (/vendors/AGRIF/dev_r11615_ENHANCE-04_namelists_as_internalfiles_agrif) into /vendors/AGRIF/dev

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