b177296ac85c8767fd85be1f1004cb19190fcee1
[platform/upstream/cmake.git] / Source / LexerParser / cmFortranParser.cxx
1 /* A Bison parser, made by GNU Bison 3.8.2.  */
2
3 /* Bison implementation for Yacc-like parsers in C
4
5    Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation,
6    Inc.
7
8    This program is free software: you can redistribute it and/or modify
9    it under the terms of the GNU General Public License as published by
10    the Free Software Foundation, either version 3 of the License, or
11    (at your option) any later version.
12
13    This program is distributed in the hope that it will be useful,
14    but WITHOUT ANY WARRANTY; without even the implied warranty of
15    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16    GNU General Public License for more details.
17
18    You should have received a copy of the GNU General Public License
19    along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
20
21 /* As a special exception, you may create a larger work that contains
22    part or all of the Bison parser skeleton and distribute that work
23    under terms of your choice, so long as that work isn't itself a
24    parser generator using the skeleton or a modified version thereof
25    as a parser skeleton.  Alternatively, if you modify or redistribute
26    the parser skeleton itself, you may (at your option) remove this
27    special exception, which will cause the skeleton and the resulting
28    Bison output files to be licensed under the GNU General Public
29    License without this special exception.
30
31    This special exception was added by the Free Software Foundation in
32    version 2.2 of Bison.  */
33
34 /* C LALR(1) parser skeleton written by Richard Stallman, by
35    simplifying the original so-called "semantic" parser.  */
36
37 /* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual,
38    especially those whose name start with YY_ or yy_.  They are
39    private implementation details that can be changed or removed.  */
40
41 /* All symbols defined below should begin with yy or YY, to avoid
42    infringing on user name space.  This should be done even for local
43    variables, as they might otherwise be expanded by user macros.
44    There are some unavoidable exceptions within include files to
45    define necessary library symbols; they are noted "INFRINGES ON
46    USER NAME SPACE" below.  */
47
48 /* Identify Bison output, and Bison version.  */
49 #define YYBISON 30802
50
51 /* Bison version string.  */
52 #define YYBISON_VERSION "3.8.2"
53
54 /* Skeleton name.  */
55 #define YYSKELETON_NAME "yacc.c"
56
57 /* Pure parsers.  */
58 #define YYPURE 1
59
60 /* Push parsers.  */
61 #define YYPUSH 0
62
63 /* Pull parsers.  */
64 #define YYPULL 1
65
66
67 /* Substitute the variable and function names.  */
68 #define yyparse         cmFortran_yyparse
69 #define yylex           cmFortran_yylex
70 #define yyerror         cmFortran_yyerror
71 #define yydebug         cmFortran_yydebug
72 #define yynerrs         cmFortran_yynerrs
73
74 /* First part of user prologue.  */
75 #line 1 "cmFortranParser.y"
76
77 /* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
78    file Copyright.txt or https://cmake.org/licensing for details.  */
79 /*-------------------------------------------------------------------------
80   Portions of this source have been derived from makedepf90 version 2.8.8,
81
82    Copyright (C) 2000--2006 Erik Edelmann <erik.edelmann@iki.fi>
83
84   The code was originally distributed under the GPL but permission
85   from the copyright holder has been obtained to distribute this
86   derived work under the CMake license.
87 -------------------------------------------------------------------------*/
88
89 /*
90
91 This file must be translated to C and modified to build everywhere.
92
93 Run bison like this:
94
95   bison --name-prefix=cmFortran_yy
96         --defines=cmFortranParserTokens.h
97          -ocmFortranParser.cxx
98           cmFortranParser.y
99
100 */
101
102 #include "cmConfigure.h" // IWYU pragma: keep
103
104 #include "cmsys/String.h"
105 #include <stdlib.h>
106 #include <string.h>
107
108 /*-------------------------------------------------------------------------*/
109 #define cmFortranParser_cxx
110 #include "cmFortranParser.h" /* Interface to parser object.  */
111
112 /* Forward declare the lexer entry point.  */
113 YY_DECL;
114
115 /* Helper function to forward error callback from parser.  */
116 static void cmFortran_yyerror(yyscan_t yyscanner, const char* message)
117 {
118   cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
119   cmFortranParser_Error(parser, message);
120 }
121
122 /* Disable some warnings in the generated code.  */
123 #ifdef _MSC_VER
124 # pragma warning (disable: 4102) /* Unused goto label.  */
125 # pragma warning (disable: 4065) /* Switch contains default but no case. */
126 # pragma warning (disable: 4701) /* Local variable may not be initialized.  */
127 # pragma warning (disable: 4702) /* Unreachable code.  */
128 # pragma warning (disable: 4127) /* Conditional expression is constant.  */
129 # pragma warning (disable: 4244) /* Conversion to smaller type, data loss. */
130 #endif
131 #if defined(__GNUC__) && __GNUC__ >= 8
132 # pragma GCC diagnostic ignored "-Wconversion"
133 # pragma GCC diagnostic ignored "-Wfree-nonheap-object"
134 #endif
135 #if defined(__clang__) && defined(__has_warning)
136 # if __has_warning("-Wunused-but-set-variable")
137 #  pragma clang diagnostic ignored "-Wunused-but-set-variable"
138 # endif
139 #endif
140
141 #line 142 "cmFortranParser.cxx"
142
143 # ifndef YY_CAST
144 #  ifdef __cplusplus
145 #   define YY_CAST(Type, Val) static_cast<Type> (Val)
146 #   define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
147 #  else
148 #   define YY_CAST(Type, Val) ((Type) (Val))
149 #   define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
150 #  endif
151 # endif
152 # ifndef YY_NULLPTR
153 #  if defined __cplusplus
154 #   if 201103L <= __cplusplus
155 #    define YY_NULLPTR nullptr
156 #   else
157 #    define YY_NULLPTR 0
158 #   endif
159 #  else
160 #   define YY_NULLPTR ((void*)0)
161 #  endif
162 # endif
163
164 #include "cmFortranParserTokens.h"
165 /* Symbol kind.  */
166 enum yysymbol_kind_t
167 {
168   YYSYMBOL_YYEMPTY = -2,
169   YYSYMBOL_YYEOF = 0,                      /* "end of file"  */
170   YYSYMBOL_YYerror = 1,                    /* error  */
171   YYSYMBOL_YYUNDEF = 2,                    /* "invalid token"  */
172   YYSYMBOL_EOSTMT = 3,                     /* EOSTMT  */
173   YYSYMBOL_ASSIGNMENT_OP = 4,              /* ASSIGNMENT_OP  */
174   YYSYMBOL_GARBAGE = 5,                    /* GARBAGE  */
175   YYSYMBOL_CPP_LINE_DIRECTIVE = 6,         /* CPP_LINE_DIRECTIVE  */
176   YYSYMBOL_CPP_INCLUDE = 7,                /* CPP_INCLUDE  */
177   YYSYMBOL_F90PPR_INCLUDE = 8,             /* F90PPR_INCLUDE  */
178   YYSYMBOL_COCO_INCLUDE = 9,               /* COCO_INCLUDE  */
179   YYSYMBOL_F90PPR_DEFINE = 10,             /* F90PPR_DEFINE  */
180   YYSYMBOL_CPP_DEFINE = 11,                /* CPP_DEFINE  */
181   YYSYMBOL_F90PPR_UNDEF = 12,              /* F90PPR_UNDEF  */
182   YYSYMBOL_CPP_UNDEF = 13,                 /* CPP_UNDEF  */
183   YYSYMBOL_CPP_IFDEF = 14,                 /* CPP_IFDEF  */
184   YYSYMBOL_CPP_IFNDEF = 15,                /* CPP_IFNDEF  */
185   YYSYMBOL_CPP_IF = 16,                    /* CPP_IF  */
186   YYSYMBOL_CPP_ELSE = 17,                  /* CPP_ELSE  */
187   YYSYMBOL_CPP_ELIF = 18,                  /* CPP_ELIF  */
188   YYSYMBOL_CPP_ENDIF = 19,                 /* CPP_ENDIF  */
189   YYSYMBOL_F90PPR_IFDEF = 20,              /* F90PPR_IFDEF  */
190   YYSYMBOL_F90PPR_IFNDEF = 21,             /* F90PPR_IFNDEF  */
191   YYSYMBOL_F90PPR_IF = 22,                 /* F90PPR_IF  */
192   YYSYMBOL_F90PPR_ELSE = 23,               /* F90PPR_ELSE  */
193   YYSYMBOL_F90PPR_ELIF = 24,               /* F90PPR_ELIF  */
194   YYSYMBOL_F90PPR_ENDIF = 25,              /* F90PPR_ENDIF  */
195   YYSYMBOL_COMMA = 26,                     /* COMMA  */
196   YYSYMBOL_COLON = 27,                     /* COLON  */
197   YYSYMBOL_DCOLON = 28,                    /* DCOLON  */
198   YYSYMBOL_LPAREN = 29,                    /* LPAREN  */
199   YYSYMBOL_RPAREN = 30,                    /* RPAREN  */
200   YYSYMBOL_UNTERMINATED_STRING = 31,       /* UNTERMINATED_STRING  */
201   YYSYMBOL_STRING = 32,                    /* STRING  */
202   YYSYMBOL_WORD = 33,                      /* WORD  */
203   YYSYMBOL_CPP_INCLUDE_ANGLE = 34,         /* CPP_INCLUDE_ANGLE  */
204   YYSYMBOL_END = 35,                       /* END  */
205   YYSYMBOL_INCLUDE = 36,                   /* INCLUDE  */
206   YYSYMBOL_INTERFACE = 37,                 /* INTERFACE  */
207   YYSYMBOL_MODULE = 38,                    /* MODULE  */
208   YYSYMBOL_SUBMODULE = 39,                 /* SUBMODULE  */
209   YYSYMBOL_USE = 40,                       /* USE  */
210   YYSYMBOL_YYACCEPT = 41,                  /* $accept  */
211   YYSYMBOL_code = 42,                      /* code  */
212   YYSYMBOL_stmt = 43,                      /* stmt  */
213   YYSYMBOL_include = 44,                   /* include  */
214   YYSYMBOL_define = 45,                    /* define  */
215   YYSYMBOL_undef = 46,                     /* undef  */
216   YYSYMBOL_ifdef = 47,                     /* ifdef  */
217   YYSYMBOL_ifndef = 48,                    /* ifndef  */
218   YYSYMBOL_if = 49,                        /* if  */
219   YYSYMBOL_elif = 50,                      /* elif  */
220   YYSYMBOL_else = 51,                      /* else  */
221   YYSYMBOL_endif = 52,                     /* endif  */
222   YYSYMBOL_other = 53,                     /* other  */
223   YYSYMBOL_misc_code = 54                  /* misc_code  */
224 };
225 typedef enum yysymbol_kind_t yysymbol_kind_t;
226
227
228
229
230 #ifdef short
231 # undef short
232 #endif
233
234 /* On compilers that do not define __PTRDIFF_MAX__ etc., make sure
235    <limits.h> and (if available) <stdint.h> are included
236    so that the code can choose integer types of a good width.  */
237
238 #ifndef __PTRDIFF_MAX__
239 # include <limits.h> /* INFRINGES ON USER NAME SPACE */
240 # if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
241 #  include <stdint.h> /* INFRINGES ON USER NAME SPACE */
242 #  define YY_STDINT_H
243 # endif
244 #endif
245
246 /* Narrow types that promote to a signed type and that can represent a
247    signed or unsigned integer of at least N bits.  In tables they can
248    save space and decrease cache pressure.  Promoting to a signed type
249    helps avoid bugs in integer arithmetic.  */
250
251 #ifdef __INT_LEAST8_MAX__
252 typedef __INT_LEAST8_TYPE__ yytype_int8;
253 #elif defined YY_STDINT_H
254 typedef int_least8_t yytype_int8;
255 #else
256 typedef signed char yytype_int8;
257 #endif
258
259 #ifdef __INT_LEAST16_MAX__
260 typedef __INT_LEAST16_TYPE__ yytype_int16;
261 #elif defined YY_STDINT_H
262 typedef int_least16_t yytype_int16;
263 #else
264 typedef short yytype_int16;
265 #endif
266
267 /* Work around bug in HP-UX 11.23, which defines these macros
268    incorrectly for preprocessor constants.  This workaround can likely
269    be removed in 2023, as HPE has promised support for HP-UX 11.23
270    (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of
271    <https://h20195.www2.hpe.com/V2/getpdf.aspx/4AA4-7673ENW.pdf>.  */
272 #ifdef __hpux
273 # undef UINT_LEAST8_MAX
274 # undef UINT_LEAST16_MAX
275 # define UINT_LEAST8_MAX 255
276 # define UINT_LEAST16_MAX 65535
277 #endif
278
279 #if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
280 typedef __UINT_LEAST8_TYPE__ yytype_uint8;
281 #elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
282        && UINT_LEAST8_MAX <= INT_MAX)
283 typedef uint_least8_t yytype_uint8;
284 #elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
285 typedef unsigned char yytype_uint8;
286 #else
287 typedef short yytype_uint8;
288 #endif
289
290 #if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
291 typedef __UINT_LEAST16_TYPE__ yytype_uint16;
292 #elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \
293        && UINT_LEAST16_MAX <= INT_MAX)
294 typedef uint_least16_t yytype_uint16;
295 #elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
296 typedef unsigned short yytype_uint16;
297 #else
298 typedef int yytype_uint16;
299 #endif
300
301 #ifndef YYPTRDIFF_T
302 # if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__
303 #  define YYPTRDIFF_T __PTRDIFF_TYPE__
304 #  define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__
305 # elif defined PTRDIFF_MAX
306 #  ifndef ptrdiff_t
307 #   include <stddef.h> /* INFRINGES ON USER NAME SPACE */
308 #  endif
309 #  define YYPTRDIFF_T ptrdiff_t
310 #  define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
311 # else
312 #  define YYPTRDIFF_T long
313 #  define YYPTRDIFF_MAXIMUM LONG_MAX
314 # endif
315 #endif
316
317 #ifndef YYSIZE_T
318 # ifdef __SIZE_TYPE__
319 #  define YYSIZE_T __SIZE_TYPE__
320 # elif defined size_t
321 #  define YYSIZE_T size_t
322 # elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
323 #  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
324 #  define YYSIZE_T size_t
325 # else
326 #  define YYSIZE_T unsigned
327 # endif
328 #endif
329
330 #define YYSIZE_MAXIMUM                                  \
331   YY_CAST (YYPTRDIFF_T,                                 \
332            (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1)  \
333             ? YYPTRDIFF_MAXIMUM                         \
334             : YY_CAST (YYSIZE_T, -1)))
335
336 #define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X))
337
338
339 /* Stored state numbers (used for stacks). */
340 typedef yytype_int8 yy_state_t;
341
342 /* State numbers in computations.  */
343 typedef int yy_state_fast_t;
344
345 #ifndef YY_
346 # if defined YYENABLE_NLS && YYENABLE_NLS
347 #  if ENABLE_NLS
348 #   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
349 #   define YY_(Msgid) dgettext ("bison-runtime", Msgid)
350 #  endif
351 # endif
352 # ifndef YY_
353 #  define YY_(Msgid) Msgid
354 # endif
355 #endif
356
357
358 #ifndef YY_ATTRIBUTE_PURE
359 # if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
360 #  define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
361 # else
362 #  define YY_ATTRIBUTE_PURE
363 # endif
364 #endif
365
366 #ifndef YY_ATTRIBUTE_UNUSED
367 # if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
368 #  define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
369 # else
370 #  define YY_ATTRIBUTE_UNUSED
371 # endif
372 #endif
373
374 /* Suppress unused-variable warnings by "using" E.  */
375 #if ! defined lint || defined __GNUC__
376 # define YY_USE(E) ((void) (E))
377 #else
378 # define YY_USE(E) /* empty */
379 #endif
380
381 /* Suppress an incorrect diagnostic about yylval being uninitialized.  */
382 #if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__
383 # if __GNUC__ * 100 + __GNUC_MINOR__ < 407
384 #  define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN                           \
385     _Pragma ("GCC diagnostic push")                                     \
386     _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")
387 # else
388 #  define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN                           \
389     _Pragma ("GCC diagnostic push")                                     \
390     _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")              \
391     _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
392 # endif
393 # define YY_IGNORE_MAYBE_UNINITIALIZED_END      \
394     _Pragma ("GCC diagnostic pop")
395 #else
396 # define YY_INITIAL_VALUE(Value) Value
397 #endif
398 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
399 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
400 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
401 #endif
402 #ifndef YY_INITIAL_VALUE
403 # define YY_INITIAL_VALUE(Value) /* Nothing. */
404 #endif
405
406 #if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
407 # define YY_IGNORE_USELESS_CAST_BEGIN                          \
408     _Pragma ("GCC diagnostic push")                            \
409     _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
410 # define YY_IGNORE_USELESS_CAST_END            \
411     _Pragma ("GCC diagnostic pop")
412 #endif
413 #ifndef YY_IGNORE_USELESS_CAST_BEGIN
414 # define YY_IGNORE_USELESS_CAST_BEGIN
415 # define YY_IGNORE_USELESS_CAST_END
416 #endif
417
418
419 #define YY_ASSERT(E) ((void) (0 && (E)))
420
421 #if 1
422
423 /* The parser invokes alloca or malloc; define the necessary symbols.  */
424
425 # ifdef YYSTACK_USE_ALLOCA
426 #  if YYSTACK_USE_ALLOCA
427 #   ifdef __GNUC__
428 #    define YYSTACK_ALLOC __builtin_alloca
429 #   elif defined __BUILTIN_VA_ARG_INCR
430 #    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
431 #   elif defined _AIX
432 #    define YYSTACK_ALLOC __alloca
433 #   elif defined _MSC_VER
434 #    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
435 #    define alloca _alloca
436 #   else
437 #    define YYSTACK_ALLOC alloca
438 #    if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
439 #     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
440       /* Use EXIT_SUCCESS as a witness for stdlib.h.  */
441 #     ifndef EXIT_SUCCESS
442 #      define EXIT_SUCCESS 0
443 #     endif
444 #    endif
445 #   endif
446 #  endif
447 # endif
448
449 # ifdef YYSTACK_ALLOC
450    /* Pacify GCC's 'empty if-body' warning.  */
451 #  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
452 #  ifndef YYSTACK_ALLOC_MAXIMUM
453     /* The OS might guarantee only one guard page at the bottom of the stack,
454        and a page size can be as small as 4096 bytes.  So we cannot safely
455        invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
456        to allow for a few compiler-allocated temporary stack slots.  */
457 #   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
458 #  endif
459 # else
460 #  define YYSTACK_ALLOC YYMALLOC
461 #  define YYSTACK_FREE YYFREE
462 #  ifndef YYSTACK_ALLOC_MAXIMUM
463 #   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
464 #  endif
465 #  if (defined __cplusplus && ! defined EXIT_SUCCESS \
466        && ! ((defined YYMALLOC || defined malloc) \
467              && (defined YYFREE || defined free)))
468 #   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
469 #   ifndef EXIT_SUCCESS
470 #    define EXIT_SUCCESS 0
471 #   endif
472 #  endif
473 #  ifndef YYMALLOC
474 #   define YYMALLOC malloc
475 #   if ! defined malloc && ! defined EXIT_SUCCESS
476 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
477 #   endif
478 #  endif
479 #  ifndef YYFREE
480 #   define YYFREE free
481 #   if ! defined free && ! defined EXIT_SUCCESS
482 void free (void *); /* INFRINGES ON USER NAME SPACE */
483 #   endif
484 #  endif
485 # endif
486 #endif /* 1 */
487
488 #if (! defined yyoverflow \
489      && (! defined __cplusplus \
490          || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
491
492 /* A type that is properly aligned for any stack member.  */
493 union yyalloc
494 {
495   yy_state_t yyss_alloc;
496   YYSTYPE yyvs_alloc;
497 };
498
499 /* The size of the maximum gap between one aligned stack and the next.  */
500 # define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1)
501
502 /* The size of an array large to enough to hold all stacks, each with
503    N elements.  */
504 # define YYSTACK_BYTES(N) \
505      ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE)) \
506       + YYSTACK_GAP_MAXIMUM)
507
508 # define YYCOPY_NEEDED 1
509
510 /* Relocate STACK from its old location to the new one.  The
511    local variables YYSIZE and YYSTACKSIZE give the old and new number of
512    elements in the stack, and YYPTR gives the new location of the
513    stack.  Advance YYPTR to a properly aligned location for the next
514    stack.  */
515 # define YYSTACK_RELOCATE(Stack_alloc, Stack)                           \
516     do                                                                  \
517       {                                                                 \
518         YYPTRDIFF_T yynewbytes;                                         \
519         YYCOPY (&yyptr->Stack_alloc, Stack, yysize);                    \
520         Stack = &yyptr->Stack_alloc;                                    \
521         yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
522         yyptr += yynewbytes / YYSIZEOF (*yyptr);                        \
523       }                                                                 \
524     while (0)
525
526 #endif
527
528 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
529 /* Copy COUNT objects from SRC to DST.  The source and destination do
530    not overlap.  */
531 # ifndef YYCOPY
532 #  if defined __GNUC__ && 1 < __GNUC__
533 #   define YYCOPY(Dst, Src, Count) \
534       __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
535 #  else
536 #   define YYCOPY(Dst, Src, Count)              \
537       do                                        \
538         {                                       \
539           YYPTRDIFF_T yyi;                      \
540           for (yyi = 0; yyi < (Count); yyi++)   \
541             (Dst)[yyi] = (Src)[yyi];            \
542         }                                       \
543       while (0)
544 #  endif
545 # endif
546 #endif /* !YYCOPY_NEEDED */
547
548 /* YYFINAL -- State number of the termination state.  */
549 #define YYFINAL  2
550 /* YYLAST -- Last index in YYTABLE.  */
551 #define YYLAST   594
552
553 /* YYNTOKENS -- Number of terminals.  */
554 #define YYNTOKENS  41
555 /* YYNNTS -- Number of nonterminals.  */
556 #define YYNNTS  14
557 /* YYNRULES -- Number of rules.  */
558 #define YYNRULES  64
559 /* YYNSTATES -- Number of states.  */
560 #define YYNSTATES  127
561
562 /* YYMAXUTOK -- Last valid token kind.  */
563 #define YYMAXUTOK   295
564
565
566 /* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
567    as returned by yylex, with out-of-bounds checking.  */
568 #define YYTRANSLATE(YYX)                                \
569   (0 <= (YYX) && (YYX) <= YYMAXUTOK                     \
570    ? YY_CAST (yysymbol_kind_t, yytranslate[YYX])        \
571    : YYSYMBOL_YYUNDEF)
572
573 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
574    as returned by yylex.  */
575 static const yytype_int8 yytranslate[] =
576 {
577        0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
578        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
579        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
580        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
581        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
582        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
583        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
584        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
585        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
586        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
587        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
588        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
589        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
590        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
591        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
592        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
593        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
594        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
595        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
596        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
597        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
598        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
599        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
600        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
601        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
602        2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
603        5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
604       15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
605       25,    26,    27,    28,    29,    30,    31,    32,    33,    34,
606       35,    36,    37,    38,    39,    40
607 };
608
609 #if YYDEBUG
610 /* YYRLINE[YYN] -- Source line where rule number YYN was defined.  */
611 static const yytype_int16 yyrline[] =
612 {
613        0,   106,   106,   106,   109,   113,   118,   127,   133,   140,
614      145,   149,   154,   166,   171,   176,   181,   186,   191,   196,
615      201,   206,   210,   214,   218,   222,   223,   228,   228,   228,
616      229,   229,   230,   230,   231,   231,   232,   232,   233,   233,
617      234,   234,   235,   235,   236,   236,   237,   237,   240,   241,
618      242,   243,   244,   245,   246,   247,   248,   249,   250,   251,
619      252,   253,   254,   255,   256
620 };
621 #endif
622
623 /** Accessing symbol of state STATE.  */
624 #define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State])
625
626 #if 1
627 /* The user-facing name of the symbol whose (internal) number is
628    YYSYMBOL.  No bounds checking.  */
629 static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED;
630
631 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
632    First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
633 static const char *const yytname[] =
634 {
635   "\"end of file\"", "error", "\"invalid token\"", "EOSTMT",
636   "ASSIGNMENT_OP", "GARBAGE", "CPP_LINE_DIRECTIVE", "CPP_INCLUDE",
637   "F90PPR_INCLUDE", "COCO_INCLUDE", "F90PPR_DEFINE", "CPP_DEFINE",
638   "F90PPR_UNDEF", "CPP_UNDEF", "CPP_IFDEF", "CPP_IFNDEF", "CPP_IF",
639   "CPP_ELSE", "CPP_ELIF", "CPP_ENDIF", "F90PPR_IFDEF", "F90PPR_IFNDEF",
640   "F90PPR_IF", "F90PPR_ELSE", "F90PPR_ELIF", "F90PPR_ENDIF", "COMMA",
641   "COLON", "DCOLON", "LPAREN", "RPAREN", "UNTERMINATED_STRING", "STRING",
642   "WORD", "CPP_INCLUDE_ANGLE", "END", "INCLUDE", "INTERFACE", "MODULE",
643   "SUBMODULE", "USE", "$accept", "code", "stmt", "include", "define",
644   "undef", "ifdef", "ifndef", "if", "elif", "else", "endif", "other",
645   "misc_code", YY_NULLPTR
646 };
647
648 static const char *
649 yysymbol_name (yysymbol_kind_t yysymbol)
650 {
651   return yytname[yysymbol];
652 }
653 #endif
654
655 #define YYPACT_NINF (-39)
656
657 #define yypact_value_is_default(Yyn) \
658   ((Yyn) == YYPACT_NINF)
659
660 #define YYTABLE_NINF (-1)
661
662 #define yytable_value_is_error(Yyn) \
663   0
664
665 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
666    STATE-NUM.  */
667 static const yytype_int16 yypact[] =
668 {
669      -39,    21,   -39,     1,   -39,   -20,   -39,   -39,   -39,   -39,
670      -39,   -39,   -39,   -39,   -39,   -39,   -39,   -39,   -39,   -39,
671      -39,   -39,   -39,   -39,   -39,   -39,   -24,   -18,    20,    -8,
672       -3,    40,   -39,    15,    16,    17,    19,    34,   -39,   -39,
673      -39,   -39,   -39,   -39,    59,   -39,   -39,   -39,   -39,   -39,
674       36,    37,    38,   -39,   -39,   -39,   -39,   -39,   -39,    77,
675      115,   130,   168,   183,   -39,   -39,   -39,   -39,   -39,   -39,
676      -39,   -39,   -39,   -39,   -39,   -39,   -39,   -39,   -39,   -39,
677      -39,   -39,   -39,   221,   236,   274,   289,   -21,    26,   -39,
678      327,   342,   380,   395,   433,   448,   -39,   -39,   -39,   -39,
679      -39,   -39,   -39,   -39,   -39,    39,    41,    42,   486,   -39,
680      -39,   -39,   -39,   -39,   -39,    18,   -39,   -39,   -39,    43,
681      501,   539,   -39,   -39,   -39,   554,   -39
682 };
683
684 /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
685    Performed when YYTABLE does not specify something else to do.  Zero
686    means the default is an error.  */
687 static const yytype_int8 yydefact[] =
688 {
689        2,     0,     1,     0,    25,     0,    27,    28,    29,    31,
690       30,    33,    32,    34,    36,    38,    42,    40,    44,    35,
691       37,    39,    43,    41,    45,    46,     0,     0,     0,     0,
692        0,     0,     3,     0,     0,     0,     0,     0,    46,    46,
693       46,    46,    26,    46,     0,    46,    46,     4,    46,    46,
694        0,     0,     0,    46,    46,    46,    46,    46,    46,     0,
695        0,     0,     0,     0,    15,    57,    56,    64,    62,    58,
696       59,    60,    61,    63,    55,    48,    49,    50,    51,    52,
697       53,    54,    47,     0,     0,     0,     0,     0,     0,    46,
698        0,     0,     0,     0,     0,     0,    21,    22,    23,    24,
699       14,    10,    13,     9,     6,     0,     0,     0,     0,     5,
700       16,    17,    18,    19,    20,     0,    46,    46,    11,     0,
701        0,     0,    46,     7,    12,     0,     8
702 };
703
704 /* YYPGOTO[NTERM-NUM].  */
705 static const yytype_int8 yypgoto[] =
706 {
707      -39,   -39,   -39,   -39,   -39,   -39,   -39,   -39,   -39,   -39,
708      -39,   -39,   -38,   -39
709 };
710
711 /* YYDEFGOTO[NTERM-NUM].  */
712 static const yytype_int8 yydefgoto[] =
713 {
714        0,     1,    32,    33,    34,    35,    36,    37,    38,    39,
715       40,    41,    44,    82
716 };
717
718 /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM.  If
719    positive, shift that token.  If negative, reduce the rule whose
720    number is the opposite.  If YYTABLE_NINF, syntax error.  */
721 static const yytype_int8 yytable[] =
722 {
723       59,    60,    61,    62,    42,    63,   105,    83,    84,   106,
724       85,    86,    43,    45,    46,    90,    91,    92,    93,    94,
725       95,     2,     3,    47,     4,    49,    50,     5,     6,     7,
726        8,     9,    10,    11,    12,    13,    14,    15,    16,    17,
727       18,    19,    20,    21,    22,    23,    24,    54,   119,    55,
728       56,   108,    57,    48,   107,    25,    26,    27,    28,    29,
729       30,    31,    64,    65,    66,    67,    51,    58,    52,    87,
730       88,    89,   115,    53,   116,   117,   122,     0,   120,   121,
731       96,    65,    66,    67,   125,    68,    69,    70,    71,    72,
732       73,    74,    75,     0,    76,    77,    78,    79,    80,    81,
733        0,     0,     0,    68,    69,    70,    71,    72,    73,    74,
734       75,     0,    76,    77,    78,    79,    80,    81,    97,    65,
735       66,    67,     0,     0,     0,     0,     0,     0,     0,     0,
736        0,     0,     0,    98,    65,    66,    67,     0,     0,     0,
737        0,    68,    69,    70,    71,    72,    73,    74,    75,     0,
738       76,    77,    78,    79,    80,    81,    68,    69,    70,    71,
739       72,    73,    74,    75,     0,    76,    77,    78,    79,    80,
740       81,    99,    65,    66,    67,     0,     0,     0,     0,     0,
741        0,     0,     0,     0,     0,     0,   100,    65,    66,    67,
742        0,     0,     0,     0,    68,    69,    70,    71,    72,    73,
743       74,    75,     0,    76,    77,    78,    79,    80,    81,    68,
744       69,    70,    71,    72,    73,    74,    75,     0,    76,    77,
745       78,    79,    80,    81,   101,    65,    66,    67,     0,     0,
746        0,     0,     0,     0,     0,     0,     0,     0,     0,   102,
747       65,    66,    67,     0,     0,     0,     0,    68,    69,    70,
748       71,    72,    73,    74,    75,     0,    76,    77,    78,    79,
749       80,    81,    68,    69,    70,    71,    72,    73,    74,    75,
750        0,    76,    77,    78,    79,    80,    81,   103,    65,    66,
751       67,     0,     0,     0,     0,     0,     0,     0,     0,     0,
752        0,     0,   104,    65,    66,    67,     0,     0,     0,     0,
753       68,    69,    70,    71,    72,    73,    74,    75,     0,    76,
754       77,    78,    79,    80,    81,    68,    69,    70,    71,    72,
755       73,    74,    75,     0,    76,    77,    78,    79,    80,    81,
756      109,    65,    66,    67,     0,     0,     0,     0,     0,     0,
757        0,     0,     0,     0,     0,   110,    65,    66,    67,     0,
758        0,     0,     0,    68,    69,    70,    71,    72,    73,    74,
759       75,     0,    76,    77,    78,    79,    80,    81,    68,    69,
760       70,    71,    72,    73,    74,    75,     0,    76,    77,    78,
761       79,    80,    81,   111,    65,    66,    67,     0,     0,     0,
762        0,     0,     0,     0,     0,     0,     0,     0,   112,    65,
763       66,    67,     0,     0,     0,     0,    68,    69,    70,    71,
764       72,    73,    74,    75,     0,    76,    77,    78,    79,    80,
765       81,    68,    69,    70,    71,    72,    73,    74,    75,     0,
766       76,    77,    78,    79,    80,    81,   113,    65,    66,    67,
767        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
768        0,   114,    65,    66,    67,     0,     0,     0,     0,    68,
769       69,    70,    71,    72,    73,    74,    75,     0,    76,    77,
770       78,    79,    80,    81,    68,    69,    70,    71,    72,    73,
771       74,    75,     0,    76,    77,    78,    79,    80,    81,   118,
772       65,    66,    67,     0,     0,     0,     0,     0,     0,     0,
773        0,     0,     0,     0,   123,    65,    66,    67,     0,     0,
774        0,     0,    68,    69,    70,    71,    72,    73,    74,    75,
775        0,    76,    77,    78,    79,    80,    81,    68,    69,    70,
776       71,    72,    73,    74,    75,     0,    76,    77,    78,    79,
777       80,    81,   124,    65,    66,    67,     0,     0,     0,     0,
778        0,     0,     0,     0,     0,     0,     0,   126,    65,    66,
779       67,     0,     0,     0,     0,    68,    69,    70,    71,    72,
780       73,    74,    75,     0,    76,    77,    78,    79,    80,    81,
781       68,    69,    70,    71,    72,    73,    74,    75,     0,    76,
782       77,    78,    79,    80,    81
783 };
784
785 static const yytype_int8 yycheck[] =
786 {
787       38,    39,    40,    41,     3,    43,    27,    45,    46,    30,
788       48,    49,    32,    37,    32,    53,    54,    55,    56,    57,
789       58,     0,     1,     3,     3,    33,    29,     6,     7,     8,
790        9,    10,    11,    12,    13,    14,    15,    16,    17,    18,
791       19,    20,    21,    22,    23,    24,    25,    32,    30,    33,
792       33,    89,    33,    33,    28,    34,    35,    36,    37,    38,
793       39,    40,     3,     4,     5,     6,    26,    33,    28,    33,
794       33,    33,    33,    33,    33,    33,    33,    -1,   116,   117,
795        3,     4,     5,     6,   122,    26,    27,    28,    29,    30,
796       31,    32,    33,    -1,    35,    36,    37,    38,    39,    40,
797       -1,    -1,    -1,    26,    27,    28,    29,    30,    31,    32,
798       33,    -1,    35,    36,    37,    38,    39,    40,     3,     4,
799        5,     6,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
800       -1,    -1,    -1,     3,     4,     5,     6,    -1,    -1,    -1,
801       -1,    26,    27,    28,    29,    30,    31,    32,    33,    -1,
802       35,    36,    37,    38,    39,    40,    26,    27,    28,    29,
803       30,    31,    32,    33,    -1,    35,    36,    37,    38,    39,
804       40,     3,     4,     5,     6,    -1,    -1,    -1,    -1,    -1,
805       -1,    -1,    -1,    -1,    -1,    -1,     3,     4,     5,     6,
806       -1,    -1,    -1,    -1,    26,    27,    28,    29,    30,    31,
807       32,    33,    -1,    35,    36,    37,    38,    39,    40,    26,
808       27,    28,    29,    30,    31,    32,    33,    -1,    35,    36,
809       37,    38,    39,    40,     3,     4,     5,     6,    -1,    -1,
810       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,     3,
811        4,     5,     6,    -1,    -1,    -1,    -1,    26,    27,    28,
812       29,    30,    31,    32,    33,    -1,    35,    36,    37,    38,
813       39,    40,    26,    27,    28,    29,    30,    31,    32,    33,
814       -1,    35,    36,    37,    38,    39,    40,     3,     4,     5,
815        6,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
816       -1,    -1,     3,     4,     5,     6,    -1,    -1,    -1,    -1,
817       26,    27,    28,    29,    30,    31,    32,    33,    -1,    35,
818       36,    37,    38,    39,    40,    26,    27,    28,    29,    30,
819       31,    32,    33,    -1,    35,    36,    37,    38,    39,    40,
820        3,     4,     5,     6,    -1,    -1,    -1,    -1,    -1,    -1,
821       -1,    -1,    -1,    -1,    -1,     3,     4,     5,     6,    -1,
822       -1,    -1,    -1,    26,    27,    28,    29,    30,    31,    32,
823       33,    -1,    35,    36,    37,    38,    39,    40,    26,    27,
824       28,    29,    30,    31,    32,    33,    -1,    35,    36,    37,
825       38,    39,    40,     3,     4,     5,     6,    -1,    -1,    -1,
826       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,     3,     4,
827        5,     6,    -1,    -1,    -1,    -1,    26,    27,    28,    29,
828       30,    31,    32,    33,    -1,    35,    36,    37,    38,    39,
829       40,    26,    27,    28,    29,    30,    31,    32,    33,    -1,
830       35,    36,    37,    38,    39,    40,     3,     4,     5,     6,
831       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
832       -1,     3,     4,     5,     6,    -1,    -1,    -1,    -1,    26,
833       27,    28,    29,    30,    31,    32,    33,    -1,    35,    36,
834       37,    38,    39,    40,    26,    27,    28,    29,    30,    31,
835       32,    33,    -1,    35,    36,    37,    38,    39,    40,     3,
836        4,     5,     6,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
837       -1,    -1,    -1,    -1,     3,     4,     5,     6,    -1,    -1,
838       -1,    -1,    26,    27,    28,    29,    30,    31,    32,    33,
839       -1,    35,    36,    37,    38,    39,    40,    26,    27,    28,
840       29,    30,    31,    32,    33,    -1,    35,    36,    37,    38,
841       39,    40,     3,     4,     5,     6,    -1,    -1,    -1,    -1,
842       -1,    -1,    -1,    -1,    -1,    -1,    -1,     3,     4,     5,
843        6,    -1,    -1,    -1,    -1,    26,    27,    28,    29,    30,
844       31,    32,    33,    -1,    35,    36,    37,    38,    39,    40,
845       26,    27,    28,    29,    30,    31,    32,    33,    -1,    35,
846       36,    37,    38,    39,    40
847 };
848
849 /* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of
850    state STATE-NUM.  */
851 static const yytype_int8 yystos[] =
852 {
853        0,    42,     0,     1,     3,     6,     7,     8,     9,    10,
854       11,    12,    13,    14,    15,    16,    17,    18,    19,    20,
855       21,    22,    23,    24,    25,    34,    35,    36,    37,    38,
856       39,    40,    43,    44,    45,    46,    47,    48,    49,    50,
857       51,    52,     3,    32,    53,    37,    32,     3,    33,    33,
858       29,    26,    28,    33,    32,    33,    33,    33,    33,    53,
859       53,    53,    53,    53,     3,     4,     5,     6,    26,    27,
860       28,    29,    30,    31,    32,    33,    35,    36,    37,    38,
861       39,    40,    54,    53,    53,    53,    53,    33,    33,    33,
862       53,    53,    53,    53,    53,    53,     3,     3,     3,     3,
863        3,     3,     3,     3,     3,    27,    30,    28,    53,     3,
864        3,     3,     3,     3,     3,    33,    33,    33,     3,    30,
865       53,    53,    33,     3,     3,    53,     3
866 };
867
868 /* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM.  */
869 static const yytype_int8 yyr1[] =
870 {
871        0,    41,    42,    42,    43,    43,    43,    43,    43,    43,
872       43,    43,    43,    43,    43,    43,    43,    43,    43,    43,
873       43,    43,    43,    43,    43,    43,    43,    44,    44,    44,
874       45,    45,    46,    46,    47,    47,    48,    48,    49,    49,
875       50,    50,    51,    51,    52,    52,    53,    53,    54,    54,
876       54,    54,    54,    54,    54,    54,    54,    54,    54,    54,
877       54,    54,    54,    54,    54
878 };
879
880 /* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM.  */
881 static const yytype_int8 yyr2[] =
882 {
883        0,     2,     0,     2,     2,     4,     4,     7,     9,     4,
884        4,     5,     7,     4,     4,     3,     4,     4,     4,     4,
885        4,     3,     3,     3,     3,     1,     2,     1,     1,     1,
886        1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
887        1,     1,     1,     1,     1,     1,     0,     2,     1,     1,
888        1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
889        1,     1,     1,     1,     1
890 };
891
892
893 enum { YYENOMEM = -2 };
894
895 #define yyerrok         (yyerrstatus = 0)
896 #define yyclearin       (yychar = YYEMPTY)
897
898 #define YYACCEPT        goto yyacceptlab
899 #define YYABORT         goto yyabortlab
900 #define YYERROR         goto yyerrorlab
901 #define YYNOMEM         goto yyexhaustedlab
902
903
904 #define YYRECOVERING()  (!!yyerrstatus)
905
906 #define YYBACKUP(Token, Value)                                    \
907   do                                                              \
908     if (yychar == YYEMPTY)                                        \
909       {                                                           \
910         yychar = (Token);                                         \
911         yylval = (Value);                                         \
912         YYPOPSTACK (yylen);                                       \
913         yystate = *yyssp;                                         \
914         goto yybackup;                                            \
915       }                                                           \
916     else                                                          \
917       {                                                           \
918         yyerror (yyscanner, YY_("syntax error: cannot back up")); \
919         YYERROR;                                                  \
920       }                                                           \
921   while (0)
922
923 /* Backward compatibility with an undocumented macro.
924    Use YYerror or YYUNDEF. */
925 #define YYERRCODE YYUNDEF
926
927
928 /* Enable debugging if requested.  */
929 #if YYDEBUG
930
931 # ifndef YYFPRINTF
932 #  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
933 #  define YYFPRINTF fprintf
934 # endif
935
936 # define YYDPRINTF(Args)                        \
937 do {                                            \
938   if (yydebug)                                  \
939     YYFPRINTF Args;                             \
940 } while (0)
941
942
943
944
945 # define YY_SYMBOL_PRINT(Title, Kind, Value, Location)                    \
946 do {                                                                      \
947   if (yydebug)                                                            \
948     {                                                                     \
949       YYFPRINTF (stderr, "%s ", Title);                                   \
950       yy_symbol_print (stderr,                                            \
951                   Kind, Value, yyscanner); \
952       YYFPRINTF (stderr, "\n");                                           \
953     }                                                                     \
954 } while (0)
955
956
957 /*-----------------------------------.
958 | Print this symbol's value on YYO.  |
959 `-----------------------------------*/
960
961 static void
962 yy_symbol_value_print (FILE *yyo,
963                        yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, yyscan_t yyscanner)
964 {
965   FILE *yyoutput = yyo;
966   YY_USE (yyoutput);
967   YY_USE (yyscanner);
968   if (!yyvaluep)
969     return;
970   YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
971   YY_USE (yykind);
972   YY_IGNORE_MAYBE_UNINITIALIZED_END
973 }
974
975
976 /*---------------------------.
977 | Print this symbol on YYO.  |
978 `---------------------------*/
979
980 static void
981 yy_symbol_print (FILE *yyo,
982                  yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, yyscan_t yyscanner)
983 {
984   YYFPRINTF (yyo, "%s %s (",
985              yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind));
986
987   yy_symbol_value_print (yyo, yykind, yyvaluep, yyscanner);
988   YYFPRINTF (yyo, ")");
989 }
990
991 /*------------------------------------------------------------------.
992 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
993 | TOP (included).                                                   |
994 `------------------------------------------------------------------*/
995
996 static void
997 yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop)
998 {
999   YYFPRINTF (stderr, "Stack now");
1000   for (; yybottom <= yytop; yybottom++)
1001     {
1002       int yybot = *yybottom;
1003       YYFPRINTF (stderr, " %d", yybot);
1004     }
1005   YYFPRINTF (stderr, "\n");
1006 }
1007
1008 # define YY_STACK_PRINT(Bottom, Top)                            \
1009 do {                                                            \
1010   if (yydebug)                                                  \
1011     yy_stack_print ((Bottom), (Top));                           \
1012 } while (0)
1013
1014
1015 /*------------------------------------------------.
1016 | Report that the YYRULE is going to be reduced.  |
1017 `------------------------------------------------*/
1018
1019 static void
1020 yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp,
1021                  int yyrule, yyscan_t yyscanner)
1022 {
1023   int yylno = yyrline[yyrule];
1024   int yynrhs = yyr2[yyrule];
1025   int yyi;
1026   YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n",
1027              yyrule - 1, yylno);
1028   /* The symbols being reduced.  */
1029   for (yyi = 0; yyi < yynrhs; yyi++)
1030     {
1031       YYFPRINTF (stderr, "   $%d = ", yyi + 1);
1032       yy_symbol_print (stderr,
1033                        YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]),
1034                        &yyvsp[(yyi + 1) - (yynrhs)], yyscanner);
1035       YYFPRINTF (stderr, "\n");
1036     }
1037 }
1038
1039 # define YY_REDUCE_PRINT(Rule)          \
1040 do {                                    \
1041   if (yydebug)                          \
1042     yy_reduce_print (yyssp, yyvsp, Rule, yyscanner); \
1043 } while (0)
1044
1045 /* Nonzero means print parse trace.  It is left uninitialized so that
1046    multiple parsers can coexist.  */
1047 int yydebug;
1048 #else /* !YYDEBUG */
1049 # define YYDPRINTF(Args) ((void) 0)
1050 # define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
1051 # define YY_STACK_PRINT(Bottom, Top)
1052 # define YY_REDUCE_PRINT(Rule)
1053 #endif /* !YYDEBUG */
1054
1055
1056 /* YYINITDEPTH -- initial size of the parser's stacks.  */
1057 #ifndef YYINITDEPTH
1058 # define YYINITDEPTH 200
1059 #endif
1060
1061 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1062    if the built-in stack extension method is used).
1063
1064    Do not make this value too large; the results are undefined if
1065    YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1066    evaluated with infinite-precision integer arithmetic.  */
1067
1068 #ifndef YYMAXDEPTH
1069 # define YYMAXDEPTH 10000
1070 #endif
1071
1072
1073 /* Context of a parse error.  */
1074 typedef struct
1075 {
1076   yy_state_t *yyssp;
1077   yysymbol_kind_t yytoken;
1078 } yypcontext_t;
1079
1080 /* Put in YYARG at most YYARGN of the expected tokens given the
1081    current YYCTX, and return the number of tokens stored in YYARG.  If
1082    YYARG is null, return the number of expected tokens (guaranteed to
1083    be less than YYNTOKENS).  Return YYENOMEM on memory exhaustion.
1084    Return 0 if there are more than YYARGN expected tokens, yet fill
1085    YYARG up to YYARGN. */
1086 static int
1087 yypcontext_expected_tokens (const yypcontext_t *yyctx,
1088                             yysymbol_kind_t yyarg[], int yyargn)
1089 {
1090   /* Actual size of YYARG. */
1091   int yycount = 0;
1092   int yyn = yypact[+*yyctx->yyssp];
1093   if (!yypact_value_is_default (yyn))
1094     {
1095       /* Start YYX at -YYN if negative to avoid negative indexes in
1096          YYCHECK.  In other words, skip the first -YYN actions for
1097          this state because they are default actions.  */
1098       int yyxbegin = yyn < 0 ? -yyn : 0;
1099       /* Stay within bounds of both yycheck and yytname.  */
1100       int yychecklim = YYLAST - yyn + 1;
1101       int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1102       int yyx;
1103       for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1104         if (yycheck[yyx + yyn] == yyx && yyx != YYSYMBOL_YYerror
1105             && !yytable_value_is_error (yytable[yyx + yyn]))
1106           {
1107             if (!yyarg)
1108               ++yycount;
1109             else if (yycount == yyargn)
1110               return 0;
1111             else
1112               yyarg[yycount++] = YY_CAST (yysymbol_kind_t, yyx);
1113           }
1114     }
1115   if (yyarg && yycount == 0 && 0 < yyargn)
1116     yyarg[0] = YYSYMBOL_YYEMPTY;
1117   return yycount;
1118 }
1119
1120
1121
1122
1123 #ifndef yystrlen
1124 # if defined __GLIBC__ && defined _STRING_H
1125 #  define yystrlen(S) (YY_CAST (YYPTRDIFF_T, strlen (S)))
1126 # else
1127 /* Return the length of YYSTR.  */
1128 static YYPTRDIFF_T
1129 yystrlen (const char *yystr)
1130 {
1131   YYPTRDIFF_T yylen;
1132   for (yylen = 0; yystr[yylen]; yylen++)
1133     continue;
1134   return yylen;
1135 }
1136 # endif
1137 #endif
1138
1139 #ifndef yystpcpy
1140 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1141 #  define yystpcpy stpcpy
1142 # else
1143 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1144    YYDEST.  */
1145 static char *
1146 yystpcpy (char *yydest, const char *yysrc)
1147 {
1148   char *yyd = yydest;
1149   const char *yys = yysrc;
1150
1151   while ((*yyd++ = *yys++) != '\0')
1152     continue;
1153
1154   return yyd - 1;
1155 }
1156 # endif
1157 #endif
1158
1159 #ifndef yytnamerr
1160 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1161    quotes and backslashes, so that it's suitable for yyerror.  The
1162    heuristic is that double-quoting is unnecessary unless the string
1163    contains an apostrophe, a comma, or backslash (other than
1164    backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
1165    null, do not copy; instead, return the length of what the result
1166    would have been.  */
1167 static YYPTRDIFF_T
1168 yytnamerr (char *yyres, const char *yystr)
1169 {
1170   if (*yystr == '"')
1171     {
1172       YYPTRDIFF_T yyn = 0;
1173       char const *yyp = yystr;
1174       for (;;)
1175         switch (*++yyp)
1176           {
1177           case '\'':
1178           case ',':
1179             goto do_not_strip_quotes;
1180
1181           case '\\':
1182             if (*++yyp != '\\')
1183               goto do_not_strip_quotes;
1184             else
1185               goto append;
1186
1187           append:
1188           default:
1189             if (yyres)
1190               yyres[yyn] = *yyp;
1191             yyn++;
1192             break;
1193
1194           case '"':
1195             if (yyres)
1196               yyres[yyn] = '\0';
1197             return yyn;
1198           }
1199     do_not_strip_quotes: ;
1200     }
1201
1202   if (yyres)
1203     return yystpcpy (yyres, yystr) - yyres;
1204   else
1205     return yystrlen (yystr);
1206 }
1207 #endif
1208
1209
1210 static int
1211 yy_syntax_error_arguments (const yypcontext_t *yyctx,
1212                            yysymbol_kind_t yyarg[], int yyargn)
1213 {
1214   /* Actual size of YYARG. */
1215   int yycount = 0;
1216   /* There are many possibilities here to consider:
1217      - If this state is a consistent state with a default action, then
1218        the only way this function was invoked is if the default action
1219        is an error action.  In that case, don't check for expected
1220        tokens because there are none.
1221      - The only way there can be no lookahead present (in yychar) is if
1222        this state is a consistent state with a default action.  Thus,
1223        detecting the absence of a lookahead is sufficient to determine
1224        that there is no unexpected or expected token to report.  In that
1225        case, just report a simple "syntax error".
1226      - Don't assume there isn't a lookahead just because this state is a
1227        consistent state with a default action.  There might have been a
1228        previous inconsistent state, consistent state with a non-default
1229        action, or user semantic action that manipulated yychar.
1230      - Of course, the expected token list depends on states to have
1231        correct lookahead information, and it depends on the parser not
1232        to perform extra reductions after fetching a lookahead from the
1233        scanner and before detecting a syntax error.  Thus, state merging
1234        (from LALR or IELR) and default reductions corrupt the expected
1235        token list.  However, the list is correct for canonical LR with
1236        one exception: it will still contain any token that will not be
1237        accepted due to an error action in a later state.
1238   */
1239   if (yyctx->yytoken != YYSYMBOL_YYEMPTY)
1240     {
1241       int yyn;
1242       if (yyarg)
1243         yyarg[yycount] = yyctx->yytoken;
1244       ++yycount;
1245       yyn = yypcontext_expected_tokens (yyctx,
1246                                         yyarg ? yyarg + 1 : yyarg, yyargn - 1);
1247       if (yyn == YYENOMEM)
1248         return YYENOMEM;
1249       else
1250         yycount += yyn;
1251     }
1252   return yycount;
1253 }
1254
1255 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1256    about the unexpected token YYTOKEN for the state stack whose top is
1257    YYSSP.
1258
1259    Return 0 if *YYMSG was successfully written.  Return -1 if *YYMSG is
1260    not large enough to hold the message.  In that case, also set
1261    *YYMSG_ALLOC to the required number of bytes.  Return YYENOMEM if the
1262    required number of bytes is too large to store.  */
1263 static int
1264 yysyntax_error (YYPTRDIFF_T *yymsg_alloc, char **yymsg,
1265                 const yypcontext_t *yyctx)
1266 {
1267   enum { YYARGS_MAX = 5 };
1268   /* Internationalized format string. */
1269   const char *yyformat = YY_NULLPTR;
1270   /* Arguments of yyformat: reported tokens (one for the "unexpected",
1271      one per "expected"). */
1272   yysymbol_kind_t yyarg[YYARGS_MAX];
1273   /* Cumulated lengths of YYARG.  */
1274   YYPTRDIFF_T yysize = 0;
1275
1276   /* Actual size of YYARG. */
1277   int yycount = yy_syntax_error_arguments (yyctx, yyarg, YYARGS_MAX);
1278   if (yycount == YYENOMEM)
1279     return YYENOMEM;
1280
1281   switch (yycount)
1282     {
1283 #define YYCASE_(N, S)                       \
1284       case N:                               \
1285         yyformat = S;                       \
1286         break
1287     default: /* Avoid compiler warnings. */
1288       YYCASE_(0, YY_("syntax error"));
1289       YYCASE_(1, YY_("syntax error, unexpected %s"));
1290       YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1291       YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1292       YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1293       YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1294 #undef YYCASE_
1295     }
1296
1297   /* Compute error message size.  Don't count the "%s"s, but reserve
1298      room for the terminator.  */
1299   yysize = yystrlen (yyformat) - 2 * yycount + 1;
1300   {
1301     int yyi;
1302     for (yyi = 0; yyi < yycount; ++yyi)
1303       {
1304         YYPTRDIFF_T yysize1
1305           = yysize + yytnamerr (YY_NULLPTR, yytname[yyarg[yyi]]);
1306         if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)
1307           yysize = yysize1;
1308         else
1309           return YYENOMEM;
1310       }
1311   }
1312
1313   if (*yymsg_alloc < yysize)
1314     {
1315       *yymsg_alloc = 2 * yysize;
1316       if (! (yysize <= *yymsg_alloc
1317              && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1318         *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1319       return -1;
1320     }
1321
1322   /* Avoid sprintf, as that infringes on the user's name space.
1323      Don't have undefined behavior even if the translation
1324      produced a string with the wrong number of "%s"s.  */
1325   {
1326     char *yyp = *yymsg;
1327     int yyi = 0;
1328     while ((*yyp = *yyformat) != '\0')
1329       if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1330         {
1331           yyp += yytnamerr (yyp, yytname[yyarg[yyi++]]);
1332           yyformat += 2;
1333         }
1334       else
1335         {
1336           ++yyp;
1337           ++yyformat;
1338         }
1339   }
1340   return 0;
1341 }
1342
1343
1344 /*-----------------------------------------------.
1345 | Release the memory associated to this symbol.  |
1346 `-----------------------------------------------*/
1347
1348 static void
1349 yydestruct (const char *yymsg,
1350             yysymbol_kind_t yykind, YYSTYPE *yyvaluep, yyscan_t yyscanner)
1351 {
1352   YY_USE (yyvaluep);
1353   YY_USE (yyscanner);
1354   if (!yymsg)
1355     yymsg = "Deleting";
1356   YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp);
1357
1358   YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1359   switch (yykind)
1360     {
1361     case YYSYMBOL_STRING: /* STRING  */
1362 #line 100 "cmFortranParser.y"
1363             { free(((*yyvaluep).string)); }
1364 #line 1365 "cmFortranParser.cxx"
1365         break;
1366
1367     case YYSYMBOL_WORD: /* WORD  */
1368 #line 100 "cmFortranParser.y"
1369             { free(((*yyvaluep).string)); }
1370 #line 1371 "cmFortranParser.cxx"
1371         break;
1372
1373     case YYSYMBOL_CPP_INCLUDE_ANGLE: /* CPP_INCLUDE_ANGLE  */
1374 #line 100 "cmFortranParser.y"
1375             { free(((*yyvaluep).string)); }
1376 #line 1377 "cmFortranParser.cxx"
1377         break;
1378
1379       default:
1380         break;
1381     }
1382   YY_IGNORE_MAYBE_UNINITIALIZED_END
1383 }
1384
1385
1386
1387
1388
1389
1390 /*----------.
1391 | yyparse.  |
1392 `----------*/
1393
1394 int
1395 yyparse (yyscan_t yyscanner)
1396 {
1397 /* Lookahead token kind.  */
1398 int yychar;
1399
1400
1401 /* The semantic value of the lookahead symbol.  */
1402 /* Default value used for initialization, for pacifying older GCCs
1403    or non-GCC compilers.  */
1404 YY_INITIAL_VALUE (static YYSTYPE yyval_default;)
1405 YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default);
1406
1407     /* Number of syntax errors so far.  */
1408     int yynerrs = 0;
1409
1410     yy_state_fast_t yystate = 0;
1411     /* Number of tokens to shift before error messages enabled.  */
1412     int yyerrstatus = 0;
1413
1414     /* Refer to the stacks through separate pointers, to allow yyoverflow
1415        to reallocate them elsewhere.  */
1416
1417     /* Their size.  */
1418     YYPTRDIFF_T yystacksize = YYINITDEPTH;
1419
1420     /* The state stack: array, bottom, top.  */
1421     yy_state_t yyssa[YYINITDEPTH];
1422     yy_state_t *yyss = yyssa;
1423     yy_state_t *yyssp = yyss;
1424
1425     /* The semantic value stack: array, bottom, top.  */
1426     YYSTYPE yyvsa[YYINITDEPTH];
1427     YYSTYPE *yyvs = yyvsa;
1428     YYSTYPE *yyvsp = yyvs;
1429
1430   int yyn;
1431   /* The return value of yyparse.  */
1432   int yyresult;
1433   /* Lookahead symbol kind.  */
1434   yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY;
1435   /* The variables used to return semantic value and location from the
1436      action routines.  */
1437   YYSTYPE yyval;
1438
1439   /* Buffer for error messages, and its allocated size.  */
1440   char yymsgbuf[128];
1441   char *yymsg = yymsgbuf;
1442   YYPTRDIFF_T yymsg_alloc = sizeof yymsgbuf;
1443
1444 #define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
1445
1446   /* The number of symbols on the RHS of the reduced rule.
1447      Keep to zero when no symbol should be popped.  */
1448   int yylen = 0;
1449
1450   YYDPRINTF ((stderr, "Starting parse\n"));
1451
1452   yychar = YYEMPTY; /* Cause a token to be read.  */
1453
1454   goto yysetstate;
1455
1456
1457 /*------------------------------------------------------------.
1458 | yynewstate -- push a new state, which is found in yystate.  |
1459 `------------------------------------------------------------*/
1460 yynewstate:
1461   /* In all cases, when you get here, the value and location stacks
1462      have just been pushed.  So pushing a state here evens the stacks.  */
1463   yyssp++;
1464
1465
1466 /*--------------------------------------------------------------------.
1467 | yysetstate -- set current state (the top of the stack) to yystate.  |
1468 `--------------------------------------------------------------------*/
1469 yysetstate:
1470   YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1471   YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
1472   YY_IGNORE_USELESS_CAST_BEGIN
1473   *yyssp = YY_CAST (yy_state_t, yystate);
1474   YY_IGNORE_USELESS_CAST_END
1475   YY_STACK_PRINT (yyss, yyssp);
1476
1477   if (yyss + yystacksize - 1 <= yyssp)
1478 #if !defined yyoverflow && !defined YYSTACK_RELOCATE
1479     YYNOMEM;
1480 #else
1481     {
1482       /* Get the current used size of the three stacks, in elements.  */
1483       YYPTRDIFF_T yysize = yyssp - yyss + 1;
1484
1485 # if defined yyoverflow
1486       {
1487         /* Give user a chance to reallocate the stack.  Use copies of
1488            these so that the &'s don't force the real ones into
1489            memory.  */
1490         yy_state_t *yyss1 = yyss;
1491         YYSTYPE *yyvs1 = yyvs;
1492
1493         /* Each stack pointer address is followed by the size of the
1494            data in use in that stack, in bytes.  This used to be a
1495            conditional around just the two extra args, but that might
1496            be undefined if yyoverflow is a macro.  */
1497         yyoverflow (YY_("memory exhausted"),
1498                     &yyss1, yysize * YYSIZEOF (*yyssp),
1499                     &yyvs1, yysize * YYSIZEOF (*yyvsp),
1500                     &yystacksize);
1501         yyss = yyss1;
1502         yyvs = yyvs1;
1503       }
1504 # else /* defined YYSTACK_RELOCATE */
1505       /* Extend the stack our own way.  */
1506       if (YYMAXDEPTH <= yystacksize)
1507         YYNOMEM;
1508       yystacksize *= 2;
1509       if (YYMAXDEPTH < yystacksize)
1510         yystacksize = YYMAXDEPTH;
1511
1512       {
1513         yy_state_t *yyss1 = yyss;
1514         union yyalloc *yyptr =
1515           YY_CAST (union yyalloc *,
1516                    YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize))));
1517         if (! yyptr)
1518           YYNOMEM;
1519         YYSTACK_RELOCATE (yyss_alloc, yyss);
1520         YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1521 #  undef YYSTACK_RELOCATE
1522         if (yyss1 != yyssa)
1523           YYSTACK_FREE (yyss1);
1524       }
1525 # endif
1526
1527       yyssp = yyss + yysize - 1;
1528       yyvsp = yyvs + yysize - 1;
1529
1530       YY_IGNORE_USELESS_CAST_BEGIN
1531       YYDPRINTF ((stderr, "Stack size increased to %ld\n",
1532                   YY_CAST (long, yystacksize)));
1533       YY_IGNORE_USELESS_CAST_END
1534
1535       if (yyss + yystacksize - 1 <= yyssp)
1536         YYABORT;
1537     }
1538 #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
1539
1540
1541   if (yystate == YYFINAL)
1542     YYACCEPT;
1543
1544   goto yybackup;
1545
1546
1547 /*-----------.
1548 | yybackup.  |
1549 `-----------*/
1550 yybackup:
1551   /* Do appropriate processing given the current state.  Read a
1552      lookahead token if we need one and don't already have one.  */
1553
1554   /* First try to decide what to do without reference to lookahead token.  */
1555   yyn = yypact[yystate];
1556   if (yypact_value_is_default (yyn))
1557     goto yydefault;
1558
1559   /* Not known => get a lookahead token if don't already have one.  */
1560
1561   /* YYCHAR is either empty, or end-of-input, or a valid lookahead.  */
1562   if (yychar == YYEMPTY)
1563     {
1564       YYDPRINTF ((stderr, "Reading a token\n"));
1565       yychar = yylex (&yylval, yyscanner);
1566     }
1567
1568   if (yychar <= YYEOF)
1569     {
1570       yychar = YYEOF;
1571       yytoken = YYSYMBOL_YYEOF;
1572       YYDPRINTF ((stderr, "Now at end of input.\n"));
1573     }
1574   else if (yychar == YYerror)
1575     {
1576       /* The scanner already issued an error message, process directly
1577          to error recovery.  But do not keep the error token as
1578          lookahead, it is too special and may lead us to an endless
1579          loop in error recovery. */
1580       yychar = YYUNDEF;
1581       yytoken = YYSYMBOL_YYerror;
1582       goto yyerrlab1;
1583     }
1584   else
1585     {
1586       yytoken = YYTRANSLATE (yychar);
1587       YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1588     }
1589
1590   /* If the proper action on seeing token YYTOKEN is to reduce or to
1591      detect an error, take that action.  */
1592   yyn += yytoken;
1593   if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1594     goto yydefault;
1595   yyn = yytable[yyn];
1596   if (yyn <= 0)
1597     {
1598       if (yytable_value_is_error (yyn))
1599         goto yyerrlab;
1600       yyn = -yyn;
1601       goto yyreduce;
1602     }
1603
1604   /* Count tokens shifted since error; after three, turn off error
1605      status.  */
1606   if (yyerrstatus)
1607     yyerrstatus--;
1608
1609   /* Shift the lookahead token.  */
1610   YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1611   yystate = yyn;
1612   YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1613   *++yyvsp = yylval;
1614   YY_IGNORE_MAYBE_UNINITIALIZED_END
1615
1616   /* Discard the shifted token.  */
1617   yychar = YYEMPTY;
1618   goto yynewstate;
1619
1620
1621 /*-----------------------------------------------------------.
1622 | yydefault -- do the default action for the current state.  |
1623 `-----------------------------------------------------------*/
1624 yydefault:
1625   yyn = yydefact[yystate];
1626   if (yyn == 0)
1627     goto yyerrlab;
1628   goto yyreduce;
1629
1630
1631 /*-----------------------------.
1632 | yyreduce -- do a reduction.  |
1633 `-----------------------------*/
1634 yyreduce:
1635   /* yyn is the number of a rule to reduce with.  */
1636   yylen = yyr2[yyn];
1637
1638   /* If YYLEN is nonzero, implement the default value of the action:
1639      '$$ = $1'.
1640
1641      Otherwise, the following line sets YYVAL to garbage.
1642      This behavior is undocumented and Bison
1643      users should not rely upon it.  Assigning to YYVAL
1644      unconditionally makes the parser a bit smaller, and it avoids a
1645      GCC warning that YYVAL may be used uninitialized.  */
1646   yyval = yyvsp[1-yylen];
1647
1648
1649   YY_REDUCE_PRINT (yyn);
1650   switch (yyn)
1651     {
1652   case 4: /* stmt: INTERFACE EOSTMT  */
1653 #line 109 "cmFortranParser.y"
1654                    {
1655     cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
1656     cmFortranParser_SetInInterface(parser, true);
1657   }
1658 #line 1659 "cmFortranParser.cxx"
1659     break;
1660
1661   case 5: /* stmt: USE WORD other EOSTMT  */
1662 #line 113 "cmFortranParser.y"
1663                         {
1664     cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
1665     cmFortranParser_RuleUse(parser, (yyvsp[-2].string));
1666     free((yyvsp[-2].string));
1667   }
1668 #line 1669 "cmFortranParser.cxx"
1669     break;
1670
1671   case 6: /* stmt: MODULE WORD other EOSTMT  */
1672 #line 118 "cmFortranParser.y"
1673                            {
1674     cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
1675     if (cmsysString_strcasecmp((yyvsp[-2].string), "function") != 0 &&
1676         cmsysString_strcasecmp((yyvsp[-2].string), "procedure") != 0 &&
1677         cmsysString_strcasecmp((yyvsp[-2].string), "subroutine") != 0) {
1678       cmFortranParser_RuleModule(parser, (yyvsp[-2].string));
1679     }
1680     free((yyvsp[-2].string));
1681   }
1682 #line 1683 "cmFortranParser.cxx"
1683     break;
1684
1685   case 7: /* stmt: SUBMODULE LPAREN WORD RPAREN WORD other EOSTMT  */
1686 #line 127 "cmFortranParser.y"
1687                                                  {
1688     cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
1689     cmFortranParser_RuleSubmodule(parser, (yyvsp[-4].string), (yyvsp[-2].string));
1690     free((yyvsp[-4].string));
1691     free((yyvsp[-2].string));
1692   }
1693 #line 1694 "cmFortranParser.cxx"
1694     break;
1695
1696   case 8: /* stmt: SUBMODULE LPAREN WORD COLON WORD RPAREN WORD other EOSTMT  */
1697 #line 133 "cmFortranParser.y"
1698                                                             {
1699     cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
1700     cmFortranParser_RuleSubmoduleNested(parser, (yyvsp[-6].string), (yyvsp[-4].string), (yyvsp[-2].string));
1701     free((yyvsp[-6].string));
1702     free((yyvsp[-4].string));
1703     free((yyvsp[-2].string));
1704   }
1705 #line 1706 "cmFortranParser.cxx"
1706     break;
1707
1708   case 9: /* stmt: INTERFACE WORD other EOSTMT  */
1709 #line 140 "cmFortranParser.y"
1710                               {
1711     cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
1712     cmFortranParser_SetInInterface(parser, true);
1713     free((yyvsp[-2].string));
1714   }
1715 #line 1716 "cmFortranParser.cxx"
1716     break;
1717
1718   case 10: /* stmt: END INTERFACE other EOSTMT  */
1719 #line 145 "cmFortranParser.y"
1720                              {
1721     cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
1722     cmFortranParser_SetInInterface(parser, false);
1723   }
1724 #line 1725 "cmFortranParser.cxx"
1725     break;
1726
1727   case 11: /* stmt: USE DCOLON WORD other EOSTMT  */
1728 #line 149 "cmFortranParser.y"
1729                                {
1730     cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
1731     cmFortranParser_RuleUse(parser, (yyvsp[-2].string));
1732     free((yyvsp[-2].string));
1733   }
1734 #line 1735 "cmFortranParser.cxx"
1735     break;
1736
1737   case 12: /* stmt: USE COMMA WORD DCOLON WORD other EOSTMT  */
1738 #line 154 "cmFortranParser.y"
1739                                           {
1740     if (cmsysString_strcasecmp((yyvsp[-4].string), "non_intrinsic") == 0) {
1741       cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
1742       cmFortranParser_RuleUse(parser, (yyvsp[-2].string));
1743     }
1744     if (cmsysString_strcasecmp((yyvsp[-4].string), "intrinsic") == 0) {
1745       cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
1746       cmFortranParser_RuleUseIntrinsic(parser, (yyvsp[-2].string));
1747     }
1748     free((yyvsp[-4].string));
1749     free((yyvsp[-2].string));
1750   }
1751 #line 1752 "cmFortranParser.cxx"
1752     break;
1753
1754   case 13: /* stmt: INCLUDE STRING other EOSTMT  */
1755 #line 166 "cmFortranParser.y"
1756                               {
1757     cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
1758     cmFortranParser_RuleInclude(parser, (yyvsp[-2].string));
1759     free((yyvsp[-2].string));
1760   }
1761 #line 1762 "cmFortranParser.cxx"
1762     break;
1763
1764   case 14: /* stmt: CPP_LINE_DIRECTIVE STRING other EOSTMT  */
1765 #line 171 "cmFortranParser.y"
1766                                          {
1767     cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
1768     cmFortranParser_RuleLineDirective(parser, (yyvsp[-2].string));
1769     free((yyvsp[-2].string));
1770   }
1771 #line 1772 "cmFortranParser.cxx"
1772     break;
1773
1774   case 15: /* stmt: CPP_INCLUDE_ANGLE other EOSTMT  */
1775 #line 176 "cmFortranParser.y"
1776                                  {
1777     cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
1778     cmFortranParser_RuleInclude(parser, (yyvsp[-2].string));
1779     free((yyvsp[-2].string));
1780   }
1781 #line 1782 "cmFortranParser.cxx"
1782     break;
1783
1784   case 16: /* stmt: include STRING other EOSTMT  */
1785 #line 181 "cmFortranParser.y"
1786                               {
1787     cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
1788     cmFortranParser_RuleInclude(parser, (yyvsp[-2].string));
1789     free((yyvsp[-2].string));
1790   }
1791 #line 1792 "cmFortranParser.cxx"
1792     break;
1793
1794   case 17: /* stmt: define WORD other EOSTMT  */
1795 #line 186 "cmFortranParser.y"
1796                            {
1797     cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
1798     cmFortranParser_RuleDefine(parser, (yyvsp[-2].string));
1799     free((yyvsp[-2].string));
1800   }
1801 #line 1802 "cmFortranParser.cxx"
1802     break;
1803
1804   case 18: /* stmt: undef WORD other EOSTMT  */
1805 #line 191 "cmFortranParser.y"
1806                           {
1807     cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
1808     cmFortranParser_RuleUndef(parser, (yyvsp[-2].string));
1809     free((yyvsp[-2].string));
1810   }
1811 #line 1812 "cmFortranParser.cxx"
1812     break;
1813
1814   case 19: /* stmt: ifdef WORD other EOSTMT  */
1815 #line 196 "cmFortranParser.y"
1816                           {
1817     cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
1818     cmFortranParser_RuleIfdef(parser, (yyvsp[-2].string));
1819     free((yyvsp[-2].string));
1820   }
1821 #line 1822 "cmFortranParser.cxx"
1822     break;
1823
1824   case 20: /* stmt: ifndef WORD other EOSTMT  */
1825 #line 201 "cmFortranParser.y"
1826                            {
1827     cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
1828     cmFortranParser_RuleIfndef(parser, (yyvsp[-2].string));
1829     free((yyvsp[-2].string));
1830   }
1831 #line 1832 "cmFortranParser.cxx"
1832     break;
1833
1834   case 21: /* stmt: if other EOSTMT  */
1835 #line 206 "cmFortranParser.y"
1836                   {
1837     cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
1838     cmFortranParser_RuleIf(parser);
1839   }
1840 #line 1841 "cmFortranParser.cxx"
1841     break;
1842
1843   case 22: /* stmt: elif other EOSTMT  */
1844 #line 210 "cmFortranParser.y"
1845                     {
1846     cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
1847     cmFortranParser_RuleElif(parser);
1848   }
1849 #line 1850 "cmFortranParser.cxx"
1850     break;
1851
1852   case 23: /* stmt: else other EOSTMT  */
1853 #line 214 "cmFortranParser.y"
1854                     {
1855     cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
1856     cmFortranParser_RuleElse(parser);
1857   }
1858 #line 1859 "cmFortranParser.cxx"
1859     break;
1860
1861   case 24: /* stmt: endif other EOSTMT  */
1862 #line 218 "cmFortranParser.y"
1863                      {
1864     cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
1865     cmFortranParser_RuleEndif(parser);
1866   }
1867 #line 1868 "cmFortranParser.cxx"
1868     break;
1869
1870   case 48: /* misc_code: WORD  */
1871 #line 240 "cmFortranParser.y"
1872                       { free ((yyvsp[0].string)); }
1873 #line 1874 "cmFortranParser.cxx"
1874     break;
1875
1876   case 55: /* misc_code: STRING  */
1877 #line 247 "cmFortranParser.y"
1878                       { free ((yyvsp[0].string)); }
1879 #line 1880 "cmFortranParser.cxx"
1880     break;
1881
1882
1883 #line 1884 "cmFortranParser.cxx"
1884
1885       default: break;
1886     }
1887   /* User semantic actions sometimes alter yychar, and that requires
1888      that yytoken be updated with the new translation.  We take the
1889      approach of translating immediately before every use of yytoken.
1890      One alternative is translating here after every semantic action,
1891      but that translation would be missed if the semantic action invokes
1892      YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
1893      if it invokes YYBACKUP.  In the case of YYABORT or YYACCEPT, an
1894      incorrect destructor might then be invoked immediately.  In the
1895      case of YYERROR or YYBACKUP, subsequent parser actions might lead
1896      to an incorrect destructor call or verbose syntax error message
1897      before the lookahead is translated.  */
1898   YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc);
1899
1900   YYPOPSTACK (yylen);
1901   yylen = 0;
1902
1903   *++yyvsp = yyval;
1904
1905   /* Now 'shift' the result of the reduction.  Determine what state
1906      that goes to, based on the state we popped back to and the rule
1907      number reduced by.  */
1908   {
1909     const int yylhs = yyr1[yyn] - YYNTOKENS;
1910     const int yyi = yypgoto[yylhs] + *yyssp;
1911     yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
1912                ? yytable[yyi]
1913                : yydefgoto[yylhs]);
1914   }
1915
1916   goto yynewstate;
1917
1918
1919 /*--------------------------------------.
1920 | yyerrlab -- here on detecting error.  |
1921 `--------------------------------------*/
1922 yyerrlab:
1923   /* Make sure we have latest lookahead translation.  See comments at
1924      user semantic actions for why this is necessary.  */
1925   yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar);
1926   /* If not already recovering from an error, report this error.  */
1927   if (!yyerrstatus)
1928     {
1929       ++yynerrs;
1930       {
1931         yypcontext_t yyctx
1932           = {yyssp, yytoken};
1933         char const *yymsgp = YY_("syntax error");
1934         int yysyntax_error_status;
1935         yysyntax_error_status = yysyntax_error (&yymsg_alloc, &yymsg, &yyctx);
1936         if (yysyntax_error_status == 0)
1937           yymsgp = yymsg;
1938         else if (yysyntax_error_status == -1)
1939           {
1940             if (yymsg != yymsgbuf)
1941               YYSTACK_FREE (yymsg);
1942             yymsg = YY_CAST (char *,
1943                              YYSTACK_ALLOC (YY_CAST (YYSIZE_T, yymsg_alloc)));
1944             if (yymsg)
1945               {
1946                 yysyntax_error_status
1947                   = yysyntax_error (&yymsg_alloc, &yymsg, &yyctx);
1948                 yymsgp = yymsg;
1949               }
1950             else
1951               {
1952                 yymsg = yymsgbuf;
1953                 yymsg_alloc = sizeof yymsgbuf;
1954                 yysyntax_error_status = YYENOMEM;
1955               }
1956           }
1957         yyerror (yyscanner, yymsgp);
1958         if (yysyntax_error_status == YYENOMEM)
1959           YYNOMEM;
1960       }
1961     }
1962
1963   if (yyerrstatus == 3)
1964     {
1965       /* If just tried and failed to reuse lookahead token after an
1966          error, discard it.  */
1967
1968       if (yychar <= YYEOF)
1969         {
1970           /* Return failure if at end of input.  */
1971           if (yychar == YYEOF)
1972             YYABORT;
1973         }
1974       else
1975         {
1976           yydestruct ("Error: discarding",
1977                       yytoken, &yylval, yyscanner);
1978           yychar = YYEMPTY;
1979         }
1980     }
1981
1982   /* Else will try to reuse lookahead token after shifting the error
1983      token.  */
1984   goto yyerrlab1;
1985
1986
1987 /*---------------------------------------------------.
1988 | yyerrorlab -- error raised explicitly by YYERROR.  |
1989 `---------------------------------------------------*/
1990 yyerrorlab:
1991   /* Pacify compilers when the user code never invokes YYERROR and the
1992      label yyerrorlab therefore never appears in user code.  */
1993   if (0)
1994     YYERROR;
1995   ++yynerrs;
1996
1997   /* Do not reclaim the symbols of the rule whose action triggered
1998      this YYERROR.  */
1999   YYPOPSTACK (yylen);
2000   yylen = 0;
2001   YY_STACK_PRINT (yyss, yyssp);
2002   yystate = *yyssp;
2003   goto yyerrlab1;
2004
2005
2006 /*-------------------------------------------------------------.
2007 | yyerrlab1 -- common code for both syntax error and YYERROR.  |
2008 `-------------------------------------------------------------*/
2009 yyerrlab1:
2010   yyerrstatus = 3;      /* Each real token shifted decrements this.  */
2011
2012   /* Pop stack until we find a state that shifts the error token.  */
2013   for (;;)
2014     {
2015       yyn = yypact[yystate];
2016       if (!yypact_value_is_default (yyn))
2017         {
2018           yyn += YYSYMBOL_YYerror;
2019           if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror)
2020             {
2021               yyn = yytable[yyn];
2022               if (0 < yyn)
2023                 break;
2024             }
2025         }
2026
2027       /* Pop the current state because it cannot handle the error token.  */
2028       if (yyssp == yyss)
2029         YYABORT;
2030
2031
2032       yydestruct ("Error: popping",
2033                   YY_ACCESSING_SYMBOL (yystate), yyvsp, yyscanner);
2034       YYPOPSTACK (1);
2035       yystate = *yyssp;
2036       YY_STACK_PRINT (yyss, yyssp);
2037     }
2038
2039   YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
2040   *++yyvsp = yylval;
2041   YY_IGNORE_MAYBE_UNINITIALIZED_END
2042
2043
2044   /* Shift the error token.  */
2045   YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp);
2046
2047   yystate = yyn;
2048   goto yynewstate;
2049
2050
2051 /*-------------------------------------.
2052 | yyacceptlab -- YYACCEPT comes here.  |
2053 `-------------------------------------*/
2054 yyacceptlab:
2055   yyresult = 0;
2056   goto yyreturnlab;
2057
2058
2059 /*-----------------------------------.
2060 | yyabortlab -- YYABORT comes here.  |
2061 `-----------------------------------*/
2062 yyabortlab:
2063   yyresult = 1;
2064   goto yyreturnlab;
2065
2066
2067 /*-----------------------------------------------------------.
2068 | yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here.  |
2069 `-----------------------------------------------------------*/
2070 yyexhaustedlab:
2071   yyerror (yyscanner, YY_("memory exhausted"));
2072   yyresult = 2;
2073   goto yyreturnlab;
2074
2075
2076 /*----------------------------------------------------------.
2077 | yyreturnlab -- parsing is finished, clean up and return.  |
2078 `----------------------------------------------------------*/
2079 yyreturnlab:
2080   if (yychar != YYEMPTY)
2081     {
2082       /* Make sure we have latest lookahead translation.  See comments at
2083          user semantic actions for why this is necessary.  */
2084       yytoken = YYTRANSLATE (yychar);
2085       yydestruct ("Cleanup: discarding lookahead",
2086                   yytoken, &yylval, yyscanner);
2087     }
2088   /* Do not reclaim the symbols of the rule whose action triggered
2089      this YYABORT or YYACCEPT.  */
2090   YYPOPSTACK (yylen);
2091   YY_STACK_PRINT (yyss, yyssp);
2092   while (yyssp != yyss)
2093     {
2094       yydestruct ("Cleanup: popping",
2095                   YY_ACCESSING_SYMBOL (+*yyssp), yyvsp, yyscanner);
2096       YYPOPSTACK (1);
2097     }
2098 #ifndef yyoverflow
2099   if (yyss != yyssa)
2100     YYSTACK_FREE (yyss);
2101 #endif
2102   if (yymsg != yymsgbuf)
2103     YYSTACK_FREE (yymsg);
2104   return yyresult;
2105 }
2106
2107 #line 259 "cmFortranParser.y"
2108
2109 /* End of grammar */