Imported Upstream version 3.25.0
[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   432
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  121
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_uint8 yyrline[] =
612 {
613        0,   106,   106,   106,   109,   113,   118,   123,   129,   136,
614      141,   145,   150,   162,   167,   172,   177,   182,   187,   192,
615      197,   202,   206,   210,   214,   218,   219,   224,   224,   224,
616      225,   225,   226,   226,   227,   227,   228,   228,   229,   229,
617      230,   230,   231,   231,   232,   232,   233,   233,   236,   237,
618      238,   239,   240,   241,   242,   243,   244,   245,   246,   247,
619      248,   249,   250,   251,   252
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,     5,   -39,   -23,   -39,   -39,   -39,   -39,
670      -39,   -39,   -39,   -39,   -39,   -39,   -39,   -39,   -39,   -39,
671      -39,   -39,   -39,   -39,   -39,   -39,   -25,   -19,    20,    -8,
672      -15,   -22,   -39,    -6,    14,    15,    16,    17,   -39,   -39,
673      -39,   -39,   -39,   -39,    59,    49,    51,   -39,    63,    64,
674       35,    36,    37,   -39,   -39,   -39,   -39,   -39,   -39,    74,
675      112,   127,   165,   180,   -39,   -39,   -39,   -39,   -39,   -39,
676      -39,   -39,   -39,   -39,   -39,   -39,   -39,   -39,   -39,   -39,
677      -39,   -39,   -39,   -39,   -39,   -39,   -39,   -20,    43,   -39,
678      218,   233,   271,   286,   324,   339,   -39,   -39,   -39,   -39,
679      -39,    39,    40,    41,   377,   -39,   -39,   -39,   -39,   -39,
680      -39,    46,    78,   -39,   -39,    50,   -39,   392,    79,   -39,
681      -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,     0,     0,     4,     0,     0,
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,    10,    13,     9,     6,     0,     0,    46,
698        0,     0,     0,     0,     0,     0,    21,    22,    23,    24,
699       14,     0,     0,     0,     0,     5,    16,    17,    18,    19,
700       20,     0,     0,    46,    11,     0,     7,     0,     0,    12,
701        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,    51,    63,    52,   101,    42,    43,
724      102,    53,    45,    46,    50,    90,    91,    92,    93,    94,
725       95,     2,     3,    47,     4,    49,    54,     5,     6,     7,
726        8,     9,    10,    11,    12,    13,    14,    15,    16,    17,
727       18,    19,    20,    21,    22,    23,    24,    55,    56,    57,
728       58,   104,    83,    48,    84,    25,    26,    27,    28,    29,
729       30,    31,    64,    65,    66,    67,    85,    86,    87,    88,
730       89,   103,   111,   112,   113,   117,   115,    96,    65,    66,
731       67,   116,   120,   118,     0,    68,    69,    70,    71,    72,
732       73,    74,    75,     0,    76,    77,    78,    79,    80,    81,
733       68,    69,    70,    71,    72,    73,    74,    75,     0,    76,
734       77,    78,    79,    80,    81,    97,    65,    66,    67,     0,
735        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
736       98,    65,    66,    67,     0,     0,     0,     0,    68,    69,
737       70,    71,    72,    73,    74,    75,     0,    76,    77,    78,
738       79,    80,    81,    68,    69,    70,    71,    72,    73,    74,
739       75,     0,    76,    77,    78,    79,    80,    81,    99,    65,
740       66,    67,     0,     0,     0,     0,     0,     0,     0,     0,
741        0,     0,     0,   100,    65,    66,    67,     0,     0,     0,
742        0,    68,    69,    70,    71,    72,    73,    74,    75,     0,
743       76,    77,    78,    79,    80,    81,    68,    69,    70,    71,
744       72,    73,    74,    75,     0,    76,    77,    78,    79,    80,
745       81,   105,    65,    66,    67,     0,     0,     0,     0,     0,
746        0,     0,     0,     0,     0,     0,   106,    65,    66,    67,
747        0,     0,     0,     0,    68,    69,    70,    71,    72,    73,
748       74,    75,     0,    76,    77,    78,    79,    80,    81,    68,
749       69,    70,    71,    72,    73,    74,    75,     0,    76,    77,
750       78,    79,    80,    81,   107,    65,    66,    67,     0,     0,
751        0,     0,     0,     0,     0,     0,     0,     0,     0,   108,
752       65,    66,    67,     0,     0,     0,     0,    68,    69,    70,
753       71,    72,    73,    74,    75,     0,    76,    77,    78,    79,
754       80,    81,    68,    69,    70,    71,    72,    73,    74,    75,
755        0,    76,    77,    78,    79,    80,    81,   109,    65,    66,
756       67,     0,     0,     0,     0,     0,     0,     0,     0,     0,
757        0,     0,   110,    65,    66,    67,     0,     0,     0,     0,
758       68,    69,    70,    71,    72,    73,    74,    75,     0,    76,
759       77,    78,    79,    80,    81,    68,    69,    70,    71,    72,
760       73,    74,    75,     0,    76,    77,    78,    79,    80,    81,
761      114,    65,    66,    67,     0,     0,     0,     0,     0,     0,
762        0,     0,     0,     0,     0,   119,    65,    66,    67,     0,
763        0,     0,     0,    68,    69,    70,    71,    72,    73,    74,
764       75,     0,    76,    77,    78,    79,    80,    81,    68,    69,
765       70,    71,    72,    73,    74,    75,     0,    76,    77,    78,
766       79,    80,    81
767 };
768
769 static const yytype_int8 yycheck[] =
770 {
771       38,    39,    40,    41,    26,    43,    28,    27,     3,    32,
772       30,    33,    37,    32,    29,    53,    54,    55,    56,    57,
773       58,     0,     1,     3,     3,    33,    32,     6,     7,     8,
774        9,    10,    11,    12,    13,    14,    15,    16,    17,    18,
775       19,    20,    21,    22,    23,    24,    25,    33,    33,    33,
776       33,    89,     3,    33,     3,    34,    35,    36,    37,    38,
777       39,    40,     3,     4,     5,     6,     3,     3,    33,    33,
778       33,    28,    33,    33,    33,   113,    30,     3,     4,     5,
779        6,     3,     3,    33,    -1,    26,    27,    28,    29,    30,
780       31,    32,    33,    -1,    35,    36,    37,    38,    39,    40,
781       26,    27,    28,    29,    30,    31,    32,    33,    -1,    35,
782       36,    37,    38,    39,    40,     3,     4,     5,     6,    -1,
783       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
784        3,     4,     5,     6,    -1,    -1,    -1,    -1,    26,    27,
785       28,    29,    30,    31,    32,    33,    -1,    35,    36,    37,
786       38,    39,    40,    26,    27,    28,    29,    30,    31,    32,
787       33,    -1,    35,    36,    37,    38,    39,    40,     3,     4,
788        5,     6,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
789       -1,    -1,    -1,     3,     4,     5,     6,    -1,    -1,    -1,
790       -1,    26,    27,    28,    29,    30,    31,    32,    33,    -1,
791       35,    36,    37,    38,    39,    40,    26,    27,    28,    29,
792       30,    31,    32,    33,    -1,    35,    36,    37,    38,    39,
793       40,     3,     4,     5,     6,    -1,    -1,    -1,    -1,    -1,
794       -1,    -1,    -1,    -1,    -1,    -1,     3,     4,     5,     6,
795       -1,    -1,    -1,    -1,    26,    27,    28,    29,    30,    31,
796       32,    33,    -1,    35,    36,    37,    38,    39,    40,    26,
797       27,    28,    29,    30,    31,    32,    33,    -1,    35,    36,
798       37,    38,    39,    40,     3,     4,     5,     6,    -1,    -1,
799       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,     3,
800        4,     5,     6,    -1,    -1,    -1,    -1,    26,    27,    28,
801       29,    30,    31,    32,    33,    -1,    35,    36,    37,    38,
802       39,    40,    26,    27,    28,    29,    30,    31,    32,    33,
803       -1,    35,    36,    37,    38,    39,    40,     3,     4,     5,
804        6,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
805       -1,    -1,     3,     4,     5,     6,    -1,    -1,    -1,    -1,
806       26,    27,    28,    29,    30,    31,    32,    33,    -1,    35,
807       36,    37,    38,    39,    40,    26,    27,    28,    29,    30,
808       31,    32,    33,    -1,    35,    36,    37,    38,    39,    40,
809        3,     4,     5,     6,    -1,    -1,    -1,    -1,    -1,    -1,
810       -1,    -1,    -1,    -1,    -1,     3,     4,     5,     6,    -1,
811       -1,    -1,    -1,    26,    27,    28,    29,    30,    31,    32,
812       33,    -1,    35,    36,    37,    38,    39,    40,    26,    27,
813       28,    29,    30,    31,    32,    33,    -1,    35,    36,    37,
814       38,    39,    40
815 };
816
817 /* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of
818    state STATE-NUM.  */
819 static const yytype_int8 yystos[] =
820 {
821        0,    42,     0,     1,     3,     6,     7,     8,     9,    10,
822       11,    12,    13,    14,    15,    16,    17,    18,    19,    20,
823       21,    22,    23,    24,    25,    34,    35,    36,    37,    38,
824       39,    40,    43,    44,    45,    46,    47,    48,    49,    50,
825       51,    52,     3,    32,    53,    37,    32,     3,    33,    33,
826       29,    26,    28,    33,    32,    33,    33,    33,    33,    53,
827       53,    53,    53,    53,     3,     4,     5,     6,    26,    27,
828       28,    29,    30,    31,    32,    33,    35,    36,    37,    38,
829       39,    40,    54,     3,     3,     3,     3,    33,    33,    33,
830       53,    53,    53,    53,    53,    53,     3,     3,     3,     3,
831        3,    27,    30,    28,    53,     3,     3,     3,     3,     3,
832        3,    33,    33,    33,     3,    30,     3,    53,    33,     3,
833        3
834 };
835
836 /* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM.  */
837 static const yytype_int8 yyr1[] =
838 {
839        0,    41,    42,    42,    43,    43,    43,    43,    43,    43,
840       43,    43,    43,    43,    43,    43,    43,    43,    43,    43,
841       43,    43,    43,    43,    43,    43,    43,    44,    44,    44,
842       45,    45,    46,    46,    47,    47,    48,    48,    49,    49,
843       50,    50,    51,    51,    52,    52,    53,    53,    54,    54,
844       54,    54,    54,    54,    54,    54,    54,    54,    54,    54,
845       54,    54,    54,    54,    54
846 };
847
848 /* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM.  */
849 static const yytype_int8 yyr2[] =
850 {
851        0,     2,     0,     2,     2,     4,     3,     6,     8,     3,
852        3,     5,     7,     3,     4,     3,     4,     4,     4,     4,
853        4,     3,     3,     3,     3,     1,     2,     1,     1,     1,
854        1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
855        1,     1,     1,     1,     1,     1,     0,     2,     1,     1,
856        1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
857        1,     1,     1,     1,     1
858 };
859
860
861 enum { YYENOMEM = -2 };
862
863 #define yyerrok         (yyerrstatus = 0)
864 #define yyclearin       (yychar = YYEMPTY)
865
866 #define YYACCEPT        goto yyacceptlab
867 #define YYABORT         goto yyabortlab
868 #define YYERROR         goto yyerrorlab
869 #define YYNOMEM         goto yyexhaustedlab
870
871
872 #define YYRECOVERING()  (!!yyerrstatus)
873
874 #define YYBACKUP(Token, Value)                                    \
875   do                                                              \
876     if (yychar == YYEMPTY)                                        \
877       {                                                           \
878         yychar = (Token);                                         \
879         yylval = (Value);                                         \
880         YYPOPSTACK (yylen);                                       \
881         yystate = *yyssp;                                         \
882         goto yybackup;                                            \
883       }                                                           \
884     else                                                          \
885       {                                                           \
886         yyerror (yyscanner, YY_("syntax error: cannot back up")); \
887         YYERROR;                                                  \
888       }                                                           \
889   while (0)
890
891 /* Backward compatibility with an undocumented macro.
892    Use YYerror or YYUNDEF. */
893 #define YYERRCODE YYUNDEF
894
895
896 /* Enable debugging if requested.  */
897 #if YYDEBUG
898
899 # ifndef YYFPRINTF
900 #  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
901 #  define YYFPRINTF fprintf
902 # endif
903
904 # define YYDPRINTF(Args)                        \
905 do {                                            \
906   if (yydebug)                                  \
907     YYFPRINTF Args;                             \
908 } while (0)
909
910
911
912
913 # define YY_SYMBOL_PRINT(Title, Kind, Value, Location)                    \
914 do {                                                                      \
915   if (yydebug)                                                            \
916     {                                                                     \
917       YYFPRINTF (stderr, "%s ", Title);                                   \
918       yy_symbol_print (stderr,                                            \
919                   Kind, Value, yyscanner); \
920       YYFPRINTF (stderr, "\n");                                           \
921     }                                                                     \
922 } while (0)
923
924
925 /*-----------------------------------.
926 | Print this symbol's value on YYO.  |
927 `-----------------------------------*/
928
929 static void
930 yy_symbol_value_print (FILE *yyo,
931                        yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, yyscan_t yyscanner)
932 {
933   FILE *yyoutput = yyo;
934   YY_USE (yyoutput);
935   YY_USE (yyscanner);
936   if (!yyvaluep)
937     return;
938   YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
939   YY_USE (yykind);
940   YY_IGNORE_MAYBE_UNINITIALIZED_END
941 }
942
943
944 /*---------------------------.
945 | Print this symbol on YYO.  |
946 `---------------------------*/
947
948 static void
949 yy_symbol_print (FILE *yyo,
950                  yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, yyscan_t yyscanner)
951 {
952   YYFPRINTF (yyo, "%s %s (",
953              yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind));
954
955   yy_symbol_value_print (yyo, yykind, yyvaluep, yyscanner);
956   YYFPRINTF (yyo, ")");
957 }
958
959 /*------------------------------------------------------------------.
960 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
961 | TOP (included).                                                   |
962 `------------------------------------------------------------------*/
963
964 static void
965 yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop)
966 {
967   YYFPRINTF (stderr, "Stack now");
968   for (; yybottom <= yytop; yybottom++)
969     {
970       int yybot = *yybottom;
971       YYFPRINTF (stderr, " %d", yybot);
972     }
973   YYFPRINTF (stderr, "\n");
974 }
975
976 # define YY_STACK_PRINT(Bottom, Top)                            \
977 do {                                                            \
978   if (yydebug)                                                  \
979     yy_stack_print ((Bottom), (Top));                           \
980 } while (0)
981
982
983 /*------------------------------------------------.
984 | Report that the YYRULE is going to be reduced.  |
985 `------------------------------------------------*/
986
987 static void
988 yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp,
989                  int yyrule, yyscan_t yyscanner)
990 {
991   int yylno = yyrline[yyrule];
992   int yynrhs = yyr2[yyrule];
993   int yyi;
994   YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n",
995              yyrule - 1, yylno);
996   /* The symbols being reduced.  */
997   for (yyi = 0; yyi < yynrhs; yyi++)
998     {
999       YYFPRINTF (stderr, "   $%d = ", yyi + 1);
1000       yy_symbol_print (stderr,
1001                        YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]),
1002                        &yyvsp[(yyi + 1) - (yynrhs)], yyscanner);
1003       YYFPRINTF (stderr, "\n");
1004     }
1005 }
1006
1007 # define YY_REDUCE_PRINT(Rule)          \
1008 do {                                    \
1009   if (yydebug)                          \
1010     yy_reduce_print (yyssp, yyvsp, Rule, yyscanner); \
1011 } while (0)
1012
1013 /* Nonzero means print parse trace.  It is left uninitialized so that
1014    multiple parsers can coexist.  */
1015 int yydebug;
1016 #else /* !YYDEBUG */
1017 # define YYDPRINTF(Args) ((void) 0)
1018 # define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
1019 # define YY_STACK_PRINT(Bottom, Top)
1020 # define YY_REDUCE_PRINT(Rule)
1021 #endif /* !YYDEBUG */
1022
1023
1024 /* YYINITDEPTH -- initial size of the parser's stacks.  */
1025 #ifndef YYINITDEPTH
1026 # define YYINITDEPTH 200
1027 #endif
1028
1029 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1030    if the built-in stack extension method is used).
1031
1032    Do not make this value too large; the results are undefined if
1033    YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1034    evaluated with infinite-precision integer arithmetic.  */
1035
1036 #ifndef YYMAXDEPTH
1037 # define YYMAXDEPTH 10000
1038 #endif
1039
1040
1041 /* Context of a parse error.  */
1042 typedef struct
1043 {
1044   yy_state_t *yyssp;
1045   yysymbol_kind_t yytoken;
1046 } yypcontext_t;
1047
1048 /* Put in YYARG at most YYARGN of the expected tokens given the
1049    current YYCTX, and return the number of tokens stored in YYARG.  If
1050    YYARG is null, return the number of expected tokens (guaranteed to
1051    be less than YYNTOKENS).  Return YYENOMEM on memory exhaustion.
1052    Return 0 if there are more than YYARGN expected tokens, yet fill
1053    YYARG up to YYARGN. */
1054 static int
1055 yypcontext_expected_tokens (const yypcontext_t *yyctx,
1056                             yysymbol_kind_t yyarg[], int yyargn)
1057 {
1058   /* Actual size of YYARG. */
1059   int yycount = 0;
1060   int yyn = yypact[+*yyctx->yyssp];
1061   if (!yypact_value_is_default (yyn))
1062     {
1063       /* Start YYX at -YYN if negative to avoid negative indexes in
1064          YYCHECK.  In other words, skip the first -YYN actions for
1065          this state because they are default actions.  */
1066       int yyxbegin = yyn < 0 ? -yyn : 0;
1067       /* Stay within bounds of both yycheck and yytname.  */
1068       int yychecklim = YYLAST - yyn + 1;
1069       int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1070       int yyx;
1071       for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1072         if (yycheck[yyx + yyn] == yyx && yyx != YYSYMBOL_YYerror
1073             && !yytable_value_is_error (yytable[yyx + yyn]))
1074           {
1075             if (!yyarg)
1076               ++yycount;
1077             else if (yycount == yyargn)
1078               return 0;
1079             else
1080               yyarg[yycount++] = YY_CAST (yysymbol_kind_t, yyx);
1081           }
1082     }
1083   if (yyarg && yycount == 0 && 0 < yyargn)
1084     yyarg[0] = YYSYMBOL_YYEMPTY;
1085   return yycount;
1086 }
1087
1088
1089
1090
1091 #ifndef yystrlen
1092 # if defined __GLIBC__ && defined _STRING_H
1093 #  define yystrlen(S) (YY_CAST (YYPTRDIFF_T, strlen (S)))
1094 # else
1095 /* Return the length of YYSTR.  */
1096 static YYPTRDIFF_T
1097 yystrlen (const char *yystr)
1098 {
1099   YYPTRDIFF_T yylen;
1100   for (yylen = 0; yystr[yylen]; yylen++)
1101     continue;
1102   return yylen;
1103 }
1104 # endif
1105 #endif
1106
1107 #ifndef yystpcpy
1108 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1109 #  define yystpcpy stpcpy
1110 # else
1111 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1112    YYDEST.  */
1113 static char *
1114 yystpcpy (char *yydest, const char *yysrc)
1115 {
1116   char *yyd = yydest;
1117   const char *yys = yysrc;
1118
1119   while ((*yyd++ = *yys++) != '\0')
1120     continue;
1121
1122   return yyd - 1;
1123 }
1124 # endif
1125 #endif
1126
1127 #ifndef yytnamerr
1128 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1129    quotes and backslashes, so that it's suitable for yyerror.  The
1130    heuristic is that double-quoting is unnecessary unless the string
1131    contains an apostrophe, a comma, or backslash (other than
1132    backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
1133    null, do not copy; instead, return the length of what the result
1134    would have been.  */
1135 static YYPTRDIFF_T
1136 yytnamerr (char *yyres, const char *yystr)
1137 {
1138   if (*yystr == '"')
1139     {
1140       YYPTRDIFF_T yyn = 0;
1141       char const *yyp = yystr;
1142       for (;;)
1143         switch (*++yyp)
1144           {
1145           case '\'':
1146           case ',':
1147             goto do_not_strip_quotes;
1148
1149           case '\\':
1150             if (*++yyp != '\\')
1151               goto do_not_strip_quotes;
1152             else
1153               goto append;
1154
1155           append:
1156           default:
1157             if (yyres)
1158               yyres[yyn] = *yyp;
1159             yyn++;
1160             break;
1161
1162           case '"':
1163             if (yyres)
1164               yyres[yyn] = '\0';
1165             return yyn;
1166           }
1167     do_not_strip_quotes: ;
1168     }
1169
1170   if (yyres)
1171     return yystpcpy (yyres, yystr) - yyres;
1172   else
1173     return yystrlen (yystr);
1174 }
1175 #endif
1176
1177
1178 static int
1179 yy_syntax_error_arguments (const yypcontext_t *yyctx,
1180                            yysymbol_kind_t yyarg[], int yyargn)
1181 {
1182   /* Actual size of YYARG. */
1183   int yycount = 0;
1184   /* There are many possibilities here to consider:
1185      - If this state is a consistent state with a default action, then
1186        the only way this function was invoked is if the default action
1187        is an error action.  In that case, don't check for expected
1188        tokens because there are none.
1189      - The only way there can be no lookahead present (in yychar) is if
1190        this state is a consistent state with a default action.  Thus,
1191        detecting the absence of a lookahead is sufficient to determine
1192        that there is no unexpected or expected token to report.  In that
1193        case, just report a simple "syntax error".
1194      - Don't assume there isn't a lookahead just because this state is a
1195        consistent state with a default action.  There might have been a
1196        previous inconsistent state, consistent state with a non-default
1197        action, or user semantic action that manipulated yychar.
1198      - Of course, the expected token list depends on states to have
1199        correct lookahead information, and it depends on the parser not
1200        to perform extra reductions after fetching a lookahead from the
1201        scanner and before detecting a syntax error.  Thus, state merging
1202        (from LALR or IELR) and default reductions corrupt the expected
1203        token list.  However, the list is correct for canonical LR with
1204        one exception: it will still contain any token that will not be
1205        accepted due to an error action in a later state.
1206   */
1207   if (yyctx->yytoken != YYSYMBOL_YYEMPTY)
1208     {
1209       int yyn;
1210       if (yyarg)
1211         yyarg[yycount] = yyctx->yytoken;
1212       ++yycount;
1213       yyn = yypcontext_expected_tokens (yyctx,
1214                                         yyarg ? yyarg + 1 : yyarg, yyargn - 1);
1215       if (yyn == YYENOMEM)
1216         return YYENOMEM;
1217       else
1218         yycount += yyn;
1219     }
1220   return yycount;
1221 }
1222
1223 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1224    about the unexpected token YYTOKEN for the state stack whose top is
1225    YYSSP.
1226
1227    Return 0 if *YYMSG was successfully written.  Return -1 if *YYMSG is
1228    not large enough to hold the message.  In that case, also set
1229    *YYMSG_ALLOC to the required number of bytes.  Return YYENOMEM if the
1230    required number of bytes is too large to store.  */
1231 static int
1232 yysyntax_error (YYPTRDIFF_T *yymsg_alloc, char **yymsg,
1233                 const yypcontext_t *yyctx)
1234 {
1235   enum { YYARGS_MAX = 5 };
1236   /* Internationalized format string. */
1237   const char *yyformat = YY_NULLPTR;
1238   /* Arguments of yyformat: reported tokens (one for the "unexpected",
1239      one per "expected"). */
1240   yysymbol_kind_t yyarg[YYARGS_MAX];
1241   /* Cumulated lengths of YYARG.  */
1242   YYPTRDIFF_T yysize = 0;
1243
1244   /* Actual size of YYARG. */
1245   int yycount = yy_syntax_error_arguments (yyctx, yyarg, YYARGS_MAX);
1246   if (yycount == YYENOMEM)
1247     return YYENOMEM;
1248
1249   switch (yycount)
1250     {
1251 #define YYCASE_(N, S)                       \
1252       case N:                               \
1253         yyformat = S;                       \
1254         break
1255     default: /* Avoid compiler warnings. */
1256       YYCASE_(0, YY_("syntax error"));
1257       YYCASE_(1, YY_("syntax error, unexpected %s"));
1258       YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1259       YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1260       YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1261       YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1262 #undef YYCASE_
1263     }
1264
1265   /* Compute error message size.  Don't count the "%s"s, but reserve
1266      room for the terminator.  */
1267   yysize = yystrlen (yyformat) - 2 * yycount + 1;
1268   {
1269     int yyi;
1270     for (yyi = 0; yyi < yycount; ++yyi)
1271       {
1272         YYPTRDIFF_T yysize1
1273           = yysize + yytnamerr (YY_NULLPTR, yytname[yyarg[yyi]]);
1274         if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)
1275           yysize = yysize1;
1276         else
1277           return YYENOMEM;
1278       }
1279   }
1280
1281   if (*yymsg_alloc < yysize)
1282     {
1283       *yymsg_alloc = 2 * yysize;
1284       if (! (yysize <= *yymsg_alloc
1285              && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1286         *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1287       return -1;
1288     }
1289
1290   /* Avoid sprintf, as that infringes on the user's name space.
1291      Don't have undefined behavior even if the translation
1292      produced a string with the wrong number of "%s"s.  */
1293   {
1294     char *yyp = *yymsg;
1295     int yyi = 0;
1296     while ((*yyp = *yyformat) != '\0')
1297       if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1298         {
1299           yyp += yytnamerr (yyp, yytname[yyarg[yyi++]]);
1300           yyformat += 2;
1301         }
1302       else
1303         {
1304           ++yyp;
1305           ++yyformat;
1306         }
1307   }
1308   return 0;
1309 }
1310
1311
1312 /*-----------------------------------------------.
1313 | Release the memory associated to this symbol.  |
1314 `-----------------------------------------------*/
1315
1316 static void
1317 yydestruct (const char *yymsg,
1318             yysymbol_kind_t yykind, YYSTYPE *yyvaluep, yyscan_t yyscanner)
1319 {
1320   YY_USE (yyvaluep);
1321   YY_USE (yyscanner);
1322   if (!yymsg)
1323     yymsg = "Deleting";
1324   YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp);
1325
1326   YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1327   switch (yykind)
1328     {
1329     case YYSYMBOL_STRING: /* STRING  */
1330 #line 100 "cmFortranParser.y"
1331             { free(((*yyvaluep).string)); }
1332 #line 1333 "cmFortranParser.cxx"
1333         break;
1334
1335     case YYSYMBOL_WORD: /* WORD  */
1336 #line 100 "cmFortranParser.y"
1337             { free(((*yyvaluep).string)); }
1338 #line 1339 "cmFortranParser.cxx"
1339         break;
1340
1341     case YYSYMBOL_CPP_INCLUDE_ANGLE: /* CPP_INCLUDE_ANGLE  */
1342 #line 100 "cmFortranParser.y"
1343             { free(((*yyvaluep).string)); }
1344 #line 1345 "cmFortranParser.cxx"
1345         break;
1346
1347       default:
1348         break;
1349     }
1350   YY_IGNORE_MAYBE_UNINITIALIZED_END
1351 }
1352
1353
1354
1355
1356
1357
1358 /*----------.
1359 | yyparse.  |
1360 `----------*/
1361
1362 int
1363 yyparse (yyscan_t yyscanner)
1364 {
1365 /* Lookahead token kind.  */
1366 int yychar;
1367
1368
1369 /* The semantic value of the lookahead symbol.  */
1370 /* Default value used for initialization, for pacifying older GCCs
1371    or non-GCC compilers.  */
1372 YY_INITIAL_VALUE (static YYSTYPE yyval_default;)
1373 YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default);
1374
1375     /* Number of syntax errors so far.  */
1376     int yynerrs = 0;
1377
1378     yy_state_fast_t yystate = 0;
1379     /* Number of tokens to shift before error messages enabled.  */
1380     int yyerrstatus = 0;
1381
1382     /* Refer to the stacks through separate pointers, to allow yyoverflow
1383        to reallocate them elsewhere.  */
1384
1385     /* Their size.  */
1386     YYPTRDIFF_T yystacksize = YYINITDEPTH;
1387
1388     /* The state stack: array, bottom, top.  */
1389     yy_state_t yyssa[YYINITDEPTH];
1390     yy_state_t *yyss = yyssa;
1391     yy_state_t *yyssp = yyss;
1392
1393     /* The semantic value stack: array, bottom, top.  */
1394     YYSTYPE yyvsa[YYINITDEPTH];
1395     YYSTYPE *yyvs = yyvsa;
1396     YYSTYPE *yyvsp = yyvs;
1397
1398   int yyn;
1399   /* The return value of yyparse.  */
1400   int yyresult;
1401   /* Lookahead symbol kind.  */
1402   yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY;
1403   /* The variables used to return semantic value and location from the
1404      action routines.  */
1405   YYSTYPE yyval;
1406
1407   /* Buffer for error messages, and its allocated size.  */
1408   char yymsgbuf[128];
1409   char *yymsg = yymsgbuf;
1410   YYPTRDIFF_T yymsg_alloc = sizeof yymsgbuf;
1411
1412 #define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
1413
1414   /* The number of symbols on the RHS of the reduced rule.
1415      Keep to zero when no symbol should be popped.  */
1416   int yylen = 0;
1417
1418   YYDPRINTF ((stderr, "Starting parse\n"));
1419
1420   yychar = YYEMPTY; /* Cause a token to be read.  */
1421
1422   goto yysetstate;
1423
1424
1425 /*------------------------------------------------------------.
1426 | yynewstate -- push a new state, which is found in yystate.  |
1427 `------------------------------------------------------------*/
1428 yynewstate:
1429   /* In all cases, when you get here, the value and location stacks
1430      have just been pushed.  So pushing a state here evens the stacks.  */
1431   yyssp++;
1432
1433
1434 /*--------------------------------------------------------------------.
1435 | yysetstate -- set current state (the top of the stack) to yystate.  |
1436 `--------------------------------------------------------------------*/
1437 yysetstate:
1438   YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1439   YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
1440   YY_IGNORE_USELESS_CAST_BEGIN
1441   *yyssp = YY_CAST (yy_state_t, yystate);
1442   YY_IGNORE_USELESS_CAST_END
1443   YY_STACK_PRINT (yyss, yyssp);
1444
1445   if (yyss + yystacksize - 1 <= yyssp)
1446 #if !defined yyoverflow && !defined YYSTACK_RELOCATE
1447     YYNOMEM;
1448 #else
1449     {
1450       /* Get the current used size of the three stacks, in elements.  */
1451       YYPTRDIFF_T yysize = yyssp - yyss + 1;
1452
1453 # if defined yyoverflow
1454       {
1455         /* Give user a chance to reallocate the stack.  Use copies of
1456            these so that the &'s don't force the real ones into
1457            memory.  */
1458         yy_state_t *yyss1 = yyss;
1459         YYSTYPE *yyvs1 = yyvs;
1460
1461         /* Each stack pointer address is followed by the size of the
1462            data in use in that stack, in bytes.  This used to be a
1463            conditional around just the two extra args, but that might
1464            be undefined if yyoverflow is a macro.  */
1465         yyoverflow (YY_("memory exhausted"),
1466                     &yyss1, yysize * YYSIZEOF (*yyssp),
1467                     &yyvs1, yysize * YYSIZEOF (*yyvsp),
1468                     &yystacksize);
1469         yyss = yyss1;
1470         yyvs = yyvs1;
1471       }
1472 # else /* defined YYSTACK_RELOCATE */
1473       /* Extend the stack our own way.  */
1474       if (YYMAXDEPTH <= yystacksize)
1475         YYNOMEM;
1476       yystacksize *= 2;
1477       if (YYMAXDEPTH < yystacksize)
1478         yystacksize = YYMAXDEPTH;
1479
1480       {
1481         yy_state_t *yyss1 = yyss;
1482         union yyalloc *yyptr =
1483           YY_CAST (union yyalloc *,
1484                    YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize))));
1485         if (! yyptr)
1486           YYNOMEM;
1487         YYSTACK_RELOCATE (yyss_alloc, yyss);
1488         YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1489 #  undef YYSTACK_RELOCATE
1490         if (yyss1 != yyssa)
1491           YYSTACK_FREE (yyss1);
1492       }
1493 # endif
1494
1495       yyssp = yyss + yysize - 1;
1496       yyvsp = yyvs + yysize - 1;
1497
1498       YY_IGNORE_USELESS_CAST_BEGIN
1499       YYDPRINTF ((stderr, "Stack size increased to %ld\n",
1500                   YY_CAST (long, yystacksize)));
1501       YY_IGNORE_USELESS_CAST_END
1502
1503       if (yyss + yystacksize - 1 <= yyssp)
1504         YYABORT;
1505     }
1506 #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
1507
1508
1509   if (yystate == YYFINAL)
1510     YYACCEPT;
1511
1512   goto yybackup;
1513
1514
1515 /*-----------.
1516 | yybackup.  |
1517 `-----------*/
1518 yybackup:
1519   /* Do appropriate processing given the current state.  Read a
1520      lookahead token if we need one and don't already have one.  */
1521
1522   /* First try to decide what to do without reference to lookahead token.  */
1523   yyn = yypact[yystate];
1524   if (yypact_value_is_default (yyn))
1525     goto yydefault;
1526
1527   /* Not known => get a lookahead token if don't already have one.  */
1528
1529   /* YYCHAR is either empty, or end-of-input, or a valid lookahead.  */
1530   if (yychar == YYEMPTY)
1531     {
1532       YYDPRINTF ((stderr, "Reading a token\n"));
1533       yychar = yylex (&yylval, yyscanner);
1534     }
1535
1536   if (yychar <= YYEOF)
1537     {
1538       yychar = YYEOF;
1539       yytoken = YYSYMBOL_YYEOF;
1540       YYDPRINTF ((stderr, "Now at end of input.\n"));
1541     }
1542   else if (yychar == YYerror)
1543     {
1544       /* The scanner already issued an error message, process directly
1545          to error recovery.  But do not keep the error token as
1546          lookahead, it is too special and may lead us to an endless
1547          loop in error recovery. */
1548       yychar = YYUNDEF;
1549       yytoken = YYSYMBOL_YYerror;
1550       goto yyerrlab1;
1551     }
1552   else
1553     {
1554       yytoken = YYTRANSLATE (yychar);
1555       YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1556     }
1557
1558   /* If the proper action on seeing token YYTOKEN is to reduce or to
1559      detect an error, take that action.  */
1560   yyn += yytoken;
1561   if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1562     goto yydefault;
1563   yyn = yytable[yyn];
1564   if (yyn <= 0)
1565     {
1566       if (yytable_value_is_error (yyn))
1567         goto yyerrlab;
1568       yyn = -yyn;
1569       goto yyreduce;
1570     }
1571
1572   /* Count tokens shifted since error; after three, turn off error
1573      status.  */
1574   if (yyerrstatus)
1575     yyerrstatus--;
1576
1577   /* Shift the lookahead token.  */
1578   YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1579   yystate = yyn;
1580   YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1581   *++yyvsp = yylval;
1582   YY_IGNORE_MAYBE_UNINITIALIZED_END
1583
1584   /* Discard the shifted token.  */
1585   yychar = YYEMPTY;
1586   goto yynewstate;
1587
1588
1589 /*-----------------------------------------------------------.
1590 | yydefault -- do the default action for the current state.  |
1591 `-----------------------------------------------------------*/
1592 yydefault:
1593   yyn = yydefact[yystate];
1594   if (yyn == 0)
1595     goto yyerrlab;
1596   goto yyreduce;
1597
1598
1599 /*-----------------------------.
1600 | yyreduce -- do a reduction.  |
1601 `-----------------------------*/
1602 yyreduce:
1603   /* yyn is the number of a rule to reduce with.  */
1604   yylen = yyr2[yyn];
1605
1606   /* If YYLEN is nonzero, implement the default value of the action:
1607      '$$ = $1'.
1608
1609      Otherwise, the following line sets YYVAL to garbage.
1610      This behavior is undocumented and Bison
1611      users should not rely upon it.  Assigning to YYVAL
1612      unconditionally makes the parser a bit smaller, and it avoids a
1613      GCC warning that YYVAL may be used uninitialized.  */
1614   yyval = yyvsp[1-yylen];
1615
1616
1617   YY_REDUCE_PRINT (yyn);
1618   switch (yyn)
1619     {
1620   case 4: /* stmt: INTERFACE EOSTMT  */
1621 #line 109 "cmFortranParser.y"
1622                    {
1623     cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
1624     cmFortranParser_SetInInterface(parser, true);
1625   }
1626 #line 1627 "cmFortranParser.cxx"
1627     break;
1628
1629   case 5: /* stmt: USE WORD other EOSTMT  */
1630 #line 113 "cmFortranParser.y"
1631                         {
1632     cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
1633     cmFortranParser_RuleUse(parser, (yyvsp[-2].string));
1634     free((yyvsp[-2].string));
1635   }
1636 #line 1637 "cmFortranParser.cxx"
1637     break;
1638
1639   case 6: /* stmt: MODULE WORD EOSTMT  */
1640 #line 118 "cmFortranParser.y"
1641                      {
1642     cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
1643     cmFortranParser_RuleModule(parser, (yyvsp[-1].string));
1644     free((yyvsp[-1].string));
1645   }
1646 #line 1647 "cmFortranParser.cxx"
1647     break;
1648
1649   case 7: /* stmt: SUBMODULE LPAREN WORD RPAREN WORD EOSTMT  */
1650 #line 123 "cmFortranParser.y"
1651                                            {
1652     cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
1653     cmFortranParser_RuleSubmodule(parser, (yyvsp[-3].string), (yyvsp[-1].string));
1654     free((yyvsp[-3].string));
1655     free((yyvsp[-1].string));
1656   }
1657 #line 1658 "cmFortranParser.cxx"
1658     break;
1659
1660   case 8: /* stmt: SUBMODULE LPAREN WORD COLON WORD RPAREN WORD EOSTMT  */
1661 #line 129 "cmFortranParser.y"
1662                                                       {
1663     cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
1664     cmFortranParser_RuleSubmoduleNested(parser, (yyvsp[-5].string), (yyvsp[-3].string), (yyvsp[-1].string));
1665     free((yyvsp[-5].string));
1666     free((yyvsp[-3].string));
1667     free((yyvsp[-1].string));
1668   }
1669 #line 1670 "cmFortranParser.cxx"
1670     break;
1671
1672   case 9: /* stmt: INTERFACE WORD EOSTMT  */
1673 #line 136 "cmFortranParser.y"
1674                         {
1675     cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
1676     cmFortranParser_SetInInterface(parser, true);
1677     free((yyvsp[-1].string));
1678   }
1679 #line 1680 "cmFortranParser.cxx"
1680     break;
1681
1682   case 10: /* stmt: END INTERFACE EOSTMT  */
1683 #line 141 "cmFortranParser.y"
1684                        {
1685     cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
1686     cmFortranParser_SetInInterface(parser, false);
1687   }
1688 #line 1689 "cmFortranParser.cxx"
1689     break;
1690
1691   case 11: /* stmt: USE DCOLON WORD other EOSTMT  */
1692 #line 145 "cmFortranParser.y"
1693                                {
1694     cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
1695     cmFortranParser_RuleUse(parser, (yyvsp[-2].string));
1696     free((yyvsp[-2].string));
1697   }
1698 #line 1699 "cmFortranParser.cxx"
1699     break;
1700
1701   case 12: /* stmt: USE COMMA WORD DCOLON WORD other EOSTMT  */
1702 #line 150 "cmFortranParser.y"
1703                                           {
1704     if (cmsysString_strcasecmp((yyvsp[-4].string), "non_intrinsic") == 0) {
1705       cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
1706       cmFortranParser_RuleUse(parser, (yyvsp[-2].string));
1707     }
1708     if (cmsysString_strcasecmp((yyvsp[-4].string), "intrinsic") == 0) {
1709       cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
1710       cmFortranParser_RuleUseIntrinsic(parser, (yyvsp[-2].string));
1711     }
1712     free((yyvsp[-4].string));
1713     free((yyvsp[-2].string));
1714   }
1715 #line 1716 "cmFortranParser.cxx"
1716     break;
1717
1718   case 13: /* stmt: INCLUDE STRING EOSTMT  */
1719 #line 162 "cmFortranParser.y"
1720                         {
1721     cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
1722     cmFortranParser_RuleInclude(parser, (yyvsp[-1].string));
1723     free((yyvsp[-1].string));
1724   }
1725 #line 1726 "cmFortranParser.cxx"
1726     break;
1727
1728   case 14: /* stmt: CPP_LINE_DIRECTIVE STRING other EOSTMT  */
1729 #line 167 "cmFortranParser.y"
1730                                          {
1731     cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
1732     cmFortranParser_RuleLineDirective(parser, (yyvsp[-2].string));
1733     free((yyvsp[-2].string));
1734   }
1735 #line 1736 "cmFortranParser.cxx"
1736     break;
1737
1738   case 15: /* stmt: CPP_INCLUDE_ANGLE other EOSTMT  */
1739 #line 172 "cmFortranParser.y"
1740                                  {
1741     cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
1742     cmFortranParser_RuleInclude(parser, (yyvsp[-2].string));
1743     free((yyvsp[-2].string));
1744   }
1745 #line 1746 "cmFortranParser.cxx"
1746     break;
1747
1748   case 16: /* stmt: include STRING other EOSTMT  */
1749 #line 177 "cmFortranParser.y"
1750                               {
1751     cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
1752     cmFortranParser_RuleInclude(parser, (yyvsp[-2].string));
1753     free((yyvsp[-2].string));
1754   }
1755 #line 1756 "cmFortranParser.cxx"
1756     break;
1757
1758   case 17: /* stmt: define WORD other EOSTMT  */
1759 #line 182 "cmFortranParser.y"
1760                            {
1761     cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
1762     cmFortranParser_RuleDefine(parser, (yyvsp[-2].string));
1763     free((yyvsp[-2].string));
1764   }
1765 #line 1766 "cmFortranParser.cxx"
1766     break;
1767
1768   case 18: /* stmt: undef WORD other EOSTMT  */
1769 #line 187 "cmFortranParser.y"
1770                           {
1771     cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
1772     cmFortranParser_RuleUndef(parser, (yyvsp[-2].string));
1773     free((yyvsp[-2].string));
1774   }
1775 #line 1776 "cmFortranParser.cxx"
1776     break;
1777
1778   case 19: /* stmt: ifdef WORD other EOSTMT  */
1779 #line 192 "cmFortranParser.y"
1780                           {
1781     cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
1782     cmFortranParser_RuleIfdef(parser, (yyvsp[-2].string));
1783     free((yyvsp[-2].string));
1784   }
1785 #line 1786 "cmFortranParser.cxx"
1786     break;
1787
1788   case 20: /* stmt: ifndef WORD other EOSTMT  */
1789 #line 197 "cmFortranParser.y"
1790                            {
1791     cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
1792     cmFortranParser_RuleIfndef(parser, (yyvsp[-2].string));
1793     free((yyvsp[-2].string));
1794   }
1795 #line 1796 "cmFortranParser.cxx"
1796     break;
1797
1798   case 21: /* stmt: if other EOSTMT  */
1799 #line 202 "cmFortranParser.y"
1800                   {
1801     cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
1802     cmFortranParser_RuleIf(parser);
1803   }
1804 #line 1805 "cmFortranParser.cxx"
1805     break;
1806
1807   case 22: /* stmt: elif other EOSTMT  */
1808 #line 206 "cmFortranParser.y"
1809                     {
1810     cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
1811     cmFortranParser_RuleElif(parser);
1812   }
1813 #line 1814 "cmFortranParser.cxx"
1814     break;
1815
1816   case 23: /* stmt: else other EOSTMT  */
1817 #line 210 "cmFortranParser.y"
1818                     {
1819     cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
1820     cmFortranParser_RuleElse(parser);
1821   }
1822 #line 1823 "cmFortranParser.cxx"
1823     break;
1824
1825   case 24: /* stmt: endif other EOSTMT  */
1826 #line 214 "cmFortranParser.y"
1827                      {
1828     cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
1829     cmFortranParser_RuleEndif(parser);
1830   }
1831 #line 1832 "cmFortranParser.cxx"
1832     break;
1833
1834   case 48: /* misc_code: WORD  */
1835 #line 236 "cmFortranParser.y"
1836                       { free ((yyvsp[0].string)); }
1837 #line 1838 "cmFortranParser.cxx"
1838     break;
1839
1840   case 55: /* misc_code: STRING  */
1841 #line 243 "cmFortranParser.y"
1842                       { free ((yyvsp[0].string)); }
1843 #line 1844 "cmFortranParser.cxx"
1844     break;
1845
1846
1847 #line 1848 "cmFortranParser.cxx"
1848
1849       default: break;
1850     }
1851   /* User semantic actions sometimes alter yychar, and that requires
1852      that yytoken be updated with the new translation.  We take the
1853      approach of translating immediately before every use of yytoken.
1854      One alternative is translating here after every semantic action,
1855      but that translation would be missed if the semantic action invokes
1856      YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
1857      if it invokes YYBACKUP.  In the case of YYABORT or YYACCEPT, an
1858      incorrect destructor might then be invoked immediately.  In the
1859      case of YYERROR or YYBACKUP, subsequent parser actions might lead
1860      to an incorrect destructor call or verbose syntax error message
1861      before the lookahead is translated.  */
1862   YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc);
1863
1864   YYPOPSTACK (yylen);
1865   yylen = 0;
1866
1867   *++yyvsp = yyval;
1868
1869   /* Now 'shift' the result of the reduction.  Determine what state
1870      that goes to, based on the state we popped back to and the rule
1871      number reduced by.  */
1872   {
1873     const int yylhs = yyr1[yyn] - YYNTOKENS;
1874     const int yyi = yypgoto[yylhs] + *yyssp;
1875     yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
1876                ? yytable[yyi]
1877                : yydefgoto[yylhs]);
1878   }
1879
1880   goto yynewstate;
1881
1882
1883 /*--------------------------------------.
1884 | yyerrlab -- here on detecting error.  |
1885 `--------------------------------------*/
1886 yyerrlab:
1887   /* Make sure we have latest lookahead translation.  See comments at
1888      user semantic actions for why this is necessary.  */
1889   yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar);
1890   /* If not already recovering from an error, report this error.  */
1891   if (!yyerrstatus)
1892     {
1893       ++yynerrs;
1894       {
1895         yypcontext_t yyctx
1896           = {yyssp, yytoken};
1897         char const *yymsgp = YY_("syntax error");
1898         int yysyntax_error_status;
1899         yysyntax_error_status = yysyntax_error (&yymsg_alloc, &yymsg, &yyctx);
1900         if (yysyntax_error_status == 0)
1901           yymsgp = yymsg;
1902         else if (yysyntax_error_status == -1)
1903           {
1904             if (yymsg != yymsgbuf)
1905               YYSTACK_FREE (yymsg);
1906             yymsg = YY_CAST (char *,
1907                              YYSTACK_ALLOC (YY_CAST (YYSIZE_T, yymsg_alloc)));
1908             if (yymsg)
1909               {
1910                 yysyntax_error_status
1911                   = yysyntax_error (&yymsg_alloc, &yymsg, &yyctx);
1912                 yymsgp = yymsg;
1913               }
1914             else
1915               {
1916                 yymsg = yymsgbuf;
1917                 yymsg_alloc = sizeof yymsgbuf;
1918                 yysyntax_error_status = YYENOMEM;
1919               }
1920           }
1921         yyerror (yyscanner, yymsgp);
1922         if (yysyntax_error_status == YYENOMEM)
1923           YYNOMEM;
1924       }
1925     }
1926
1927   if (yyerrstatus == 3)
1928     {
1929       /* If just tried and failed to reuse lookahead token after an
1930          error, discard it.  */
1931
1932       if (yychar <= YYEOF)
1933         {
1934           /* Return failure if at end of input.  */
1935           if (yychar == YYEOF)
1936             YYABORT;
1937         }
1938       else
1939         {
1940           yydestruct ("Error: discarding",
1941                       yytoken, &yylval, yyscanner);
1942           yychar = YYEMPTY;
1943         }
1944     }
1945
1946   /* Else will try to reuse lookahead token after shifting the error
1947      token.  */
1948   goto yyerrlab1;
1949
1950
1951 /*---------------------------------------------------.
1952 | yyerrorlab -- error raised explicitly by YYERROR.  |
1953 `---------------------------------------------------*/
1954 yyerrorlab:
1955   /* Pacify compilers when the user code never invokes YYERROR and the
1956      label yyerrorlab therefore never appears in user code.  */
1957   if (0)
1958     YYERROR;
1959   ++yynerrs;
1960
1961   /* Do not reclaim the symbols of the rule whose action triggered
1962      this YYERROR.  */
1963   YYPOPSTACK (yylen);
1964   yylen = 0;
1965   YY_STACK_PRINT (yyss, yyssp);
1966   yystate = *yyssp;
1967   goto yyerrlab1;
1968
1969
1970 /*-------------------------------------------------------------.
1971 | yyerrlab1 -- common code for both syntax error and YYERROR.  |
1972 `-------------------------------------------------------------*/
1973 yyerrlab1:
1974   yyerrstatus = 3;      /* Each real token shifted decrements this.  */
1975
1976   /* Pop stack until we find a state that shifts the error token.  */
1977   for (;;)
1978     {
1979       yyn = yypact[yystate];
1980       if (!yypact_value_is_default (yyn))
1981         {
1982           yyn += YYSYMBOL_YYerror;
1983           if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror)
1984             {
1985               yyn = yytable[yyn];
1986               if (0 < yyn)
1987                 break;
1988             }
1989         }
1990
1991       /* Pop the current state because it cannot handle the error token.  */
1992       if (yyssp == yyss)
1993         YYABORT;
1994
1995
1996       yydestruct ("Error: popping",
1997                   YY_ACCESSING_SYMBOL (yystate), yyvsp, yyscanner);
1998       YYPOPSTACK (1);
1999       yystate = *yyssp;
2000       YY_STACK_PRINT (yyss, yyssp);
2001     }
2002
2003   YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
2004   *++yyvsp = yylval;
2005   YY_IGNORE_MAYBE_UNINITIALIZED_END
2006
2007
2008   /* Shift the error token.  */
2009   YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp);
2010
2011   yystate = yyn;
2012   goto yynewstate;
2013
2014
2015 /*-------------------------------------.
2016 | yyacceptlab -- YYACCEPT comes here.  |
2017 `-------------------------------------*/
2018 yyacceptlab:
2019   yyresult = 0;
2020   goto yyreturnlab;
2021
2022
2023 /*-----------------------------------.
2024 | yyabortlab -- YYABORT comes here.  |
2025 `-----------------------------------*/
2026 yyabortlab:
2027   yyresult = 1;
2028   goto yyreturnlab;
2029
2030
2031 /*-----------------------------------------------------------.
2032 | yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here.  |
2033 `-----------------------------------------------------------*/
2034 yyexhaustedlab:
2035   yyerror (yyscanner, YY_("memory exhausted"));
2036   yyresult = 2;
2037   goto yyreturnlab;
2038
2039
2040 /*----------------------------------------------------------.
2041 | yyreturnlab -- parsing is finished, clean up and return.  |
2042 `----------------------------------------------------------*/
2043 yyreturnlab:
2044   if (yychar != YYEMPTY)
2045     {
2046       /* Make sure we have latest lookahead translation.  See comments at
2047          user semantic actions for why this is necessary.  */
2048       yytoken = YYTRANSLATE (yychar);
2049       yydestruct ("Cleanup: discarding lookahead",
2050                   yytoken, &yylval, yyscanner);
2051     }
2052   /* Do not reclaim the symbols of the rule whose action triggered
2053      this YYABORT or YYACCEPT.  */
2054   YYPOPSTACK (yylen);
2055   YY_STACK_PRINT (yyss, yyssp);
2056   while (yyssp != yyss)
2057     {
2058       yydestruct ("Cleanup: popping",
2059                   YY_ACCESSING_SYMBOL (+*yyssp), yyvsp, yyscanner);
2060       YYPOPSTACK (1);
2061     }
2062 #ifndef yyoverflow
2063   if (yyss != yyssa)
2064     YYSTACK_FREE (yyss);
2065 #endif
2066   if (yymsg != yymsgbuf)
2067     YYSTACK_FREE (yymsg);
2068   return yyresult;
2069 }
2070
2071 #line 255 "cmFortranParser.y"
2072
2073 /* End of grammar */