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

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

source: branches/UKMO/dev_merge_2017_GC_couple_pkg/NEMOGCM/EXTERNAL/AGRIF/LIB/main.c @ 9677

Last change on this file since 9677 was 9677, checked in by dancopsey, 6 years ago

Strip out SVN keywords.

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